diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-10-16 21:16:46 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-10-16 21:16:46 +0000 |
commit | 0be050c8b6579abd76f4a405a1964532d4e71bf1 (patch) | |
tree | 646250b525d2fc2116b54455cd3e1146ebf85e7f /libc/stdlib/malloc/heap_debug.c | |
parent | 9674f4133f323e0d312a0e8f5ff3886c590f459e (diff) |
This should fix malloc with debug and without threads. (Chase N Douglas)
This should have been in r23660. Untested.
Diffstat (limited to 'libc/stdlib/malloc/heap_debug.c')
-rw-r--r-- | libc/stdlib/malloc/heap_debug.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libc/stdlib/malloc/heap_debug.c b/libc/stdlib/malloc/heap_debug.c index a2a9f4ec1..59a1780cd 100644 --- a/libc/stdlib/malloc/heap_debug.c +++ b/libc/stdlib/malloc/heap_debug.c @@ -31,10 +31,10 @@ int __heap_debug = 0; static void -__heap_dump_freelist (struct heap *heap) +__heap_dump_freelist (struct heap_free_area *heap) { struct heap_free_area *fa; - for (fa = heap->free_areas; fa; fa = fa->next) + for (fa = heap; fa; fa = fa->next) __malloc_debug_printf (0, "0x%lx: 0x%lx - 0x%lx (%d)\tP=0x%lx, N=0x%lx", (long)fa, @@ -47,7 +47,7 @@ __heap_dump_freelist (struct heap *heap) /* Output a text representation of HEAP to stderr, labelling it with STR. */ void -__heap_dump (struct heap *heap, const char *str) +__heap_dump (struct heap_free_area *heap, const char *str) { static smallint recursed; @@ -69,7 +69,7 @@ __heap_dump (struct heap *heap, const char *str) /* Output an error message to stderr, and exit. STR is printed with the failure message. */ static void attribute_noreturn -__heap_check_failure (struct heap *heap, struct heap_free_area *fa, +__heap_check_failure (struct heap_free_area *heap, struct heap_free_area *fa, const char *str, char *fmt, ...) { va_list val; @@ -95,11 +95,11 @@ __heap_check_failure (struct heap *heap, struct heap_free_area *fa, /* Do some consistency checks on HEAP. If they fail, output an error message to stderr, and exit. STR is printed with the failure message. */ void -__heap_check (struct heap *heap, const char *str) +__heap_check (struct heap_free_area *heap, const char *str) { typedef unsigned long ul_t; struct heap_free_area *fa, *prev; - struct heap_free_area *first_fa = heap->free_areas; + struct heap_free_area *first_fa = heap; if (first_fa && first_fa->prev) __heap_check_failure (heap, first_fa, str, |