summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc/free.c
diff options
context:
space:
mode:
authorMiles Bader <miles@lsi.nec.co.jp>2002-09-04 02:11:08 +0000
committerMiles Bader <miles@lsi.nec.co.jp>2002-09-04 02:11:08 +0000
commit66dc2a8bbce9b31ca6d45fbe949e7d8d7b2f024c (patch)
tree759c94fa67b5c63a20b61953308d09e9233afeb3 /libc/stdlib/malloc/free.c
parent4d5bd6060d182c4987b679367c201eaf94e91812 (diff)
(free):
Update debug statement. Update to use __heap_delete and __heap_is_empty.
Diffstat (limited to 'libc/stdlib/malloc/free.c')
-rw-r--r--libc/stdlib/malloc/free.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libc/stdlib/malloc/free.c b/libc/stdlib/malloc/free.c
index ac842fc67..c8c687964 100644
--- a/libc/stdlib/malloc/free.c
+++ b/libc/stdlib/malloc/free.c
@@ -32,12 +32,12 @@ free (void *mem)
/* Normal free. */
+ MALLOC_DEBUG ("free: 0x%lx (base = 0x%lx, total_size = %d)\n",
+ (long)mem, (long)MALLOC_BASE (mem), MALLOC_SIZE (mem));
+
size = MALLOC_SIZE (mem);
mem = MALLOC_BASE (mem);
- MALLOC_DEBUG ("free: 0x%lx (base = 0x%lx, total_size = %d)\n",
- (long)MALLOC_ADDR (mem), (long)mem, size);
-
__malloc_lock ();
/* Put MEM back in the heap, and get the free-area it was placed in. */
@@ -84,9 +84,9 @@ free (void *mem)
start, end, end - start);
/* Remove FA from the heap. */
- __heap_unlink_free_area (heap, fa);
+ __heap_delete (heap, fa);
- if (!fa->next && !fa->prev)
+ if (__heap_is_empty (heap))
/* We want to avoid the heap from losing all memory, so reserve
a bit. This test is only a heuristic -- the existance of
another free area, even if it's smaller than