aboutsummaryrefslogtreecommitdiff
path: root/common/dlmalloc.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-09-26 08:14:27 -0600
committerTom Rini <trini@konsulko.com>2023-10-06 14:38:12 -0400
commit3d6d50751469fbadec3e34fbb6d06f21746619dd (patch)
tree9dee21255e4963c896bb6c3a2edbd7cef8ca2a47 /common/dlmalloc.c
parenta57204180799489bacfdad3f6b32dc520ed545df (diff)
downloadu-boot-3d6d50751469fbadec3e34fbb6d06f21746619dd.zip
u-boot-3d6d50751469fbadec3e34fbb6d06f21746619dd.tar.gz
u-boot-3d6d50751469fbadec3e34fbb6d06f21746619dd.tar.bz2
spl: Use SYS_MALLOC_F instead of SYS_MALLOC_F_LEN
Use the new SPL/TPL/VPL_SYS_MALLOC_F symbols to determine whether the malloc pool exists. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
Diffstat (limited to 'common/dlmalloc.c')
-rw-r--r--common/dlmalloc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index aa933bd..87a09d3 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -1291,7 +1291,7 @@ Void_t* mALLOc(bytes) size_t bytes;
INTERNAL_SIZE_T nb;
-#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
if (!(gd->flags & GD_FLG_FULL_MALLOC_INIT))
return malloc_simple(bytes);
#endif
@@ -1572,7 +1572,7 @@ void fREe(mem) Void_t* mem;
mchunkptr fwd; /* misc temp for linking */
int islr; /* track whether merging with last_remainder */
-#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
/* free() is a no-op - all the memory will be freed on relocation */
if (!(gd->flags & GD_FLG_FULL_MALLOC_INIT)) {
VALGRIND_FREELIKE_BLOCK(mem, SIZE_SZ);
@@ -1735,7 +1735,7 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes;
/* realloc of null is supposed to be same as malloc */
if (oldmem == NULL) return mALLOc(bytes);
-#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
if (!(gd->flags & GD_FLG_FULL_MALLOC_INIT)) {
/* This is harder to support and should not be needed */
panic("pre-reloc realloc() is not supported");
@@ -1957,7 +1957,7 @@ Void_t* mEMALIGn(alignment, bytes) size_t alignment; size_t bytes;
if ((long)bytes < 0) return NULL;
-#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
if (!(gd->flags & GD_FLG_FULL_MALLOC_INIT)) {
return memalign_simple(alignment, bytes);
}
@@ -2153,7 +2153,7 @@ Void_t* cALLOc(n, elem_size) size_t n; size_t elem_size;
return NULL;
else
{
-#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
if (!(gd->flags & GD_FLG_FULL_MALLOC_INIT)) {
memset(mem, 0, sz);
return mem;
@@ -2455,7 +2455,7 @@ int mALLOPt(param_number, value) int param_number; int value;
int initf_malloc(void)
{
-#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
assert(gd->malloc_base); /* Set up by crt0.S */
gd->malloc_limit = CONFIG_VAL(SYS_MALLOC_F_LEN);
gd->malloc_ptr = 0;