summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc/stdlib/malloc/free.c4
-rw-r--r--libc/stdlib/malloc/malloc.c2
-rw-r--r--libc/stdlib/malloc/realloc.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/libc/stdlib/malloc/free.c b/libc/stdlib/malloc/free.c
index 657604124..6908e16c1 100644
--- a/libc/stdlib/malloc/free.c
+++ b/libc/stdlib/malloc/free.c
@@ -32,7 +32,7 @@ free (void *mem)
mem = MALLOC_BASE (mem);
MALLOC_DEBUG ("free: 0x%lx (base = 0x%lx, total_size = %d)\n",
- (long)mem + MALLOC_ALIGNMENT, (long)mem, size);
+ (long)MALLOC_ADDR (mem), (long)mem, size);
__malloc_lock ();
@@ -68,7 +68,7 @@ free (void *mem)
reasonably cheap. */
if ((void *)end != sbrk (0))
{
- MALLOC_DEBUG (" not unmapping: 0x%lx - 0x%lx (%d bytes)\n",
+ MALLOC_DEBUG (" not unmapping: 0x%lx - 0x%lx (%ld bytes)\n",
start, end, end - start);
__malloc_unlock_sbrk ();
__malloc_unlock ();
diff --git a/libc/stdlib/malloc/malloc.c b/libc/stdlib/malloc/malloc.c
index 54e68a5f3..db953a9c0 100644
--- a/libc/stdlib/malloc/malloc.c
+++ b/libc/stdlib/malloc/malloc.c
@@ -125,7 +125,7 @@ malloc (size_t size)
MALLOC_SET_SIZE (mem, size);
MALLOC_DEBUG (" malloc: returning 0x%lx (base:0x%lx, total_size:%d)\n",
- (long)mem, (long)mem - MALLOC_ALIGNMENT, size);
+ (long)mem, (long)MALLOC_BASE(mem), (long)MALLOC_SIZE(mem));
}
return mem;
diff --git a/libc/stdlib/malloc/realloc.c b/libc/stdlib/malloc/realloc.c
index 4372751d0..f19df8bde 100644
--- a/libc/stdlib/malloc/realloc.c
+++ b/libc/stdlib/malloc/realloc.c
@@ -73,7 +73,7 @@ realloc (void *mem, size_t new_size)
if (mem)
MALLOC_DEBUG (" realloc: returning 0x%lx"
" (base:0x%lx, total_size:%d)\n",
- (long)new_mem, (long)new_mem - sizeof(size_t), size);
+ (long)mem, (long)MALLOC_BASE(mem), (long)MALLOC_SIZE(mem));
return mem;
}