From 056f9d98941eb98e453bf4fa308f28b892525baf Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 25 Jul 2002 01:58:57 +0000 Subject: Redo the locking, so that it may actually work. Now locking is done at the malloc/free level, not within the heap abstraction, and there's a separate lock to control sbrk access. Also, get rid of the separate `unmap_free_area' function in free.c, and just put the code in the `free' function directly, which saves a bunch of space (even compared to using an inline function) for some reason. --- libc/stdlib/malloc/heap_alloc.c | 4 ---- 1 file changed, 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 d0e1d752a..8a6c7842e 100644 --- a/libc/stdlib/malloc/heap_alloc.c +++ b/libc/stdlib/malloc/heap_alloc.c @@ -33,8 +33,6 @@ __heap_alloc (struct heap *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_lock (heap); - HEAP_DEBUG (heap, "before __heap_alloc"); /* Look for a free area that can contain _SIZE bytes. */ @@ -49,7 +47,5 @@ __heap_alloc (struct heap *heap, size_t *size) HEAP_DEBUG (heap, "after __heap_alloc"); - __heap_unlock (heap); - return mem; } -- cgit v1.2.3