1 /* 2 * Copyright (c) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 * 4 * UniProton is licensed under Mulan PSL v2. 5 * You can use this software according to the terms and conditions of the Mulan PSL v2. 6 * You may obtain a copy of Mulan PSL v2 at: 7 * http://license.coscl.org.cn/MulanPSL2 8 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, 9 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, 10 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 11 * See the Mulan PSL v2 for more details. 12 * Create: 2022-11-15 13 * Description: malloc free功能实现 14 */ 15 #include "prt_posix_internal.h" 16 #include "prt_mem.h" 17 malloc(size_t size)18void *malloc(size_t size) 19 { 20 return PRT_MemAlloc(0, OS_MEM_DEFAULT_FSC_PT, size); 21 } 22 free(void * mem)23void free(void *mem) 24 { 25 U32 ret; 26 27 ret = PRT_MemFree(0, mem); 28 if (ret != OS_OK) { 29 OsErrRecord(ret); 30 } 31 } 32