From: Shengyu Qu Date: Thu, 24 Aug 2023 16:25:19 +0000 (+0800) Subject: dlmalloc: Add support for SPL_SYS_MALLOC_CLEAR_ON_INIT X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=c9db9a2ef5558dc1e83965e452030dbf5ce93de2;p=u-boot.git 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 Signed-off-by: Shengyu Qu Reviewed-by: Tom Rini --- diff --git a/common/dlmalloc.c b/common/dlmalloc.c index 0f9b7262d5..dcecdb8623 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) {