summaryrefslogtreecommitdiff
path: root/common/malloc_simple.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-08-23 14:27:04 -0600
committerTom Rini <trini@konsulko.com>2024-08-26 14:06:08 -0600
commit92aa3ec321b50065d954185f38a1f38734a5ff0b (patch)
tree49c211da7561f13fb09b60863a8f89e7b9551f39 /common/malloc_simple.c
parentc283a2664eaa328a3767db667a7916c6d9021784 (diff)
global_data: Reduce size of early-malloc vars
The early malloc region is normally quite small and is certainly less than 4GB, so use a 32-bit value for the limit and pointer. Update the comments for clarity while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/malloc_simple.c')
-rw-r--r--common/malloc_simple.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/malloc_simple.c b/common/malloc_simple.c
index 4e6d7952b3c..5a8ec538f8f 100644
--- a/common/malloc_simple.c
+++ b/common/malloc_simple.c
@@ -23,7 +23,7 @@ static void *alloc_simple(size_t bytes, int align)
addr = ALIGN(gd->malloc_base + gd->malloc_ptr, align);
new_ptr = addr + bytes - gd->malloc_base;
- log_debug("size=%lx, ptr=%lx, limit=%lx: ", (ulong)bytes, new_ptr,
+ log_debug("size=%lx, ptr=%lx, limit=%x: ", (ulong)bytes, new_ptr,
gd->malloc_limit);
if (new_ptr > gd->malloc_limit) {
log_err("alloc space exhausted\n");
@@ -87,6 +87,6 @@ void free_simple(void *ptr)
void malloc_simple_info(void)
{
- log_info("malloc_simple: %lx bytes used, %lx remain\n", gd->malloc_ptr,
+ log_info("malloc_simple: %x bytes used, %x remain\n", gd->malloc_ptr,
CONFIG_VAL(SYS_MALLOC_F_LEN) - gd->malloc_ptr);
}