summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc/alloc.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-05-11 16:25:55 +0000
committerEric Andersen <andersen@codepoet.org>2001-05-11 16:25:55 +0000
commit9b39f1ce8980202bcd9db6be04b462e766d7d91c (patch)
treedfbf6d1253feb46f2b9730c33394dd5dbcea19f7 /libc/stdlib/malloc/alloc.c
parent007b8e2060ccae6159a36c52db42d04b13fa2b6f (diff)
A patch from Matthias Kilian <kili@outback.escape.de> to fix -DDEBUG_MALLOC
so that it works for realloc too. -Erik
Diffstat (limited to 'libc/stdlib/malloc/alloc.c')
-rw-r--r--libc/stdlib/malloc/alloc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libc/stdlib/malloc/alloc.c b/libc/stdlib/malloc/alloc.c
index 4988bb055..a521cf2e8 100644
--- a/libc/stdlib/malloc/alloc.c
+++ b/libc/stdlib/malloc/alloc.c
@@ -47,3 +47,14 @@ void free_dbg(void *ptr, char *function, char *file, int line)
}
#endif
+
+#ifdef L_realloc_dbg
+void *realloc_dbg(void *ptr, size_t size, char *function, char *file, int line)
+{
+ fprintf(stderr, "realloc of %p to %ld bytes at %s @%s;%d = ", ptr,
+ size, function, file, line);
+ ptr = realloc(ptr, size);
+ fprintf(stderr, "%p\n", ptr);
+ return ptr;
+}
+#endif