!862 feature:支持厂商自定义malloc替换系统默认实现
Merge pull request !862 from Zhaotianyu/20221028iar_malloc
This commit is contained in:
commit
e540254ed9
|
@ -43,6 +43,7 @@ rsource "newlib/Kconfig"
|
|||
|
||||
config LIBC_ICCARM
|
||||
bool "iar libc"
|
||||
depends on COMPILER_ICCARM
|
||||
rsource "iccarm/Kconfig"
|
||||
|
||||
endchoice
|
||||
|
|
|
@ -35,4 +35,10 @@ config LIBC_ICCARM_FS
|
|||
help
|
||||
This enables POSIX style file system related APIs.
|
||||
|
||||
config LIBC_ICCARM_MALLOC
|
||||
bool "Enable POSIX malloc/free API support"
|
||||
default y
|
||||
help
|
||||
This enables POSIX malloc/free related APIs.
|
||||
|
||||
endif # LIBC_ICCARM
|
||||
|
|
|
@ -36,4 +36,10 @@ config LIBC_NEWLIB_FS
|
|||
help
|
||||
This enables POSIX style file system related APIs.
|
||||
|
||||
config LIBC_NEWLIB_MALLOC
|
||||
bool "Enable POSIX malloc/free API support"
|
||||
default y
|
||||
help
|
||||
This enables POSIX malloc/free related APIs.
|
||||
|
||||
endif # LIBC_NEWLIB
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "los_memory.h"
|
||||
#include <malloc.h>
|
||||
|
||||
#ifdef LOSCFG_LIBC_NEWLIB_MALLOC
|
||||
void *zalloc(size_t size)
|
||||
{
|
||||
void *ptr = NULL;
|
||||
|
@ -111,3 +112,4 @@ void *__wrap__calloc_r(struct _reent *reent, size_t nitems, size_t size)
|
|||
}
|
||||
return ptr;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue