diff options
author | Shengyu Qu <wiagn233@outlook.com> | 2023-08-25 00:25:19 +0800 |
---|---|---|
committer | Leo Yu-Chi Liang <ycliang@andestech.com> | 2023-09-05 10:53:46 +0800 |
commit | c9db9a2ef5558dc1e83965e452030dbf5ce93de2 (patch) | |
tree | 0628e9c819e20885d50d529b86b66f91f05f4a88 /common | |
parent | dd1eb1af2683f5d0e30e70af5bef1bab83f3e594 (diff) | |
download | u-boot-c9db9a2ef5558dc1e83965e452030dbf5ce93de2.zip u-boot-c9db9a2ef5558dc1e83965e452030dbf5ce93de2.tar.gz u-boot-c9db9a2ef5558dc1e83965e452030dbf5ce93de2.tar.bz2 |
dlmalloc: Add support for SPL_SYS_MALLOC_CLEAR_ON_INIT
To support SPL_SYS_MALLOC_CLEAR_ON_INIT, we have to modify
#ifdef CONFIG_SYS_MALLOC_CLEAR_ON_INIT
to #if CONFIG_IS_ENABLED(SYS_MALLOC_CLEAR_ON_INIT)
Signed-off-by: Bo Gan <ganboing@gmail.com>
Signed-off-by: Shengyu Qu <wiagn233@outlook.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/dlmalloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/dlmalloc.c b/common/dlmalloc.c index 0f9b726..dcecdb8 100644 --- a/common/dlmalloc.c +++ b/common/dlmalloc.c @@ -631,7 +631,7 @@ void mem_malloc_init(ulong start, ulong size) debug("using memory %#lx-%#lx for malloc()\n", mem_malloc_start, mem_malloc_end); -#ifdef CONFIG_SYS_MALLOC_CLEAR_ON_INIT +#if CONFIG_IS_ENABLED(SYS_MALLOC_CLEAR_ON_INIT) memset((void *)mem_malloc_start, 0x0, size); #endif malloc_bin_reloc(); @@ -2153,7 +2153,7 @@ Void_t* cALLOc(n, elem_size) size_t n; size_t elem_size; /* check if expand_top called, in which case don't need to clear */ -#ifdef CONFIG_SYS_MALLOC_CLEAR_ON_INIT +#if CONFIG_IS_ENABLED(SYS_MALLOC_CLEAR_ON_INIT) #if MORECORE_CLEARS mchunkptr oldtop = top; INTERNAL_SIZE_T oldtopsize = chunksize(top); @@ -2184,7 +2184,7 @@ Void_t* cALLOc(n, elem_size) size_t n; size_t elem_size; csz = chunksize(p); -#ifdef CONFIG_SYS_MALLOC_CLEAR_ON_INIT +#if CONFIG_IS_ENABLED(SYS_MALLOC_CLEAR_ON_INIT) #if MORECORE_CLEARS if (p == oldtop && csz > oldtopsize) { |