From 7d602faf7652cbd8358ff90a9eaa53ac5230dabe Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 28 Oct 2008 06:48:06 +0000 Subject: Finally fix the MALLOC=y and MALLOC_SIMPLE=y breakage from svn 23660. (I found it, this is Bernhard's patch to fix it. Tested and it Works For Me (tm)). --- libc/stdlib/malloc/heap_alloc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libc/stdlib/malloc/heap_alloc.c') diff --git a/libc/stdlib/malloc/heap_alloc.c b/libc/stdlib/malloc/heap_alloc.c index cd52038d3..77b7d8560 100644 --- a/libc/stdlib/malloc/heap_alloc.c +++ b/libc/stdlib/malloc/heap_alloc.c @@ -20,7 +20,7 @@ *SIZE is adjusted to reflect the actual amount allocated (which may be greater than requested). */ void * -__heap_alloc (struct heap_free_area *heap, size_t *size) +__heap_alloc (struct heap_free_area **heap, size_t *size) { struct heap_free_area *fa; size_t _size = *size; @@ -33,10 +33,10 @@ __heap_alloc (struct heap_free_area *heap, size_t *size) we must make sure that every allocated block can hold one. */ _size = HEAP_ADJUST_SIZE (sizeof (struct heap_free_area)); - HEAP_DEBUG (heap, "before __heap_alloc"); + HEAP_DEBUG (*heap, "before __heap_alloc"); /* Look for a free area that can contain _SIZE bytes. */ - for (fa = heap; fa; fa = fa->next) + for (fa = *heap; fa; fa = fa->next) if (fa->size >= _size) { /* Found one! */ @@ -45,7 +45,7 @@ __heap_alloc (struct heap_free_area *heap, size_t *size) break; } - HEAP_DEBUG (heap, "after __heap_alloc"); + HEAP_DEBUG (*heap, "after __heap_alloc"); return mem; } -- cgit v1.2.3