diff options
author | Miles Bader <miles@lsi.nec.co.jp> | 2002-07-25 07:31:09 +0000 |
---|---|---|
committer | Miles Bader <miles@lsi.nec.co.jp> | 2002-07-25 07:31:09 +0000 |
commit | c5568de190ec2806ce36e063865bfee66d30d032 (patch) | |
tree | 319336d7c9fa8da24fbe33c01b103d8ba4de937b /libc/stdlib/malloc/malloc.c | |
parent | 5446f4e74f052ca4fea226a8fdb89502d6520a32 (diff) |
Size tweaks.
Diffstat (limited to 'libc/stdlib/malloc/malloc.c')
-rw-r--r-- | libc/stdlib/malloc/malloc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libc/stdlib/malloc/malloc.c b/libc/stdlib/malloc/malloc.c index 2ec12218c..bb1e07dfb 100644 --- a/libc/stdlib/malloc/malloc.c +++ b/libc/stdlib/malloc/malloc.c @@ -36,6 +36,7 @@ void * malloc (size_t size) { void *mem; + struct heap *heap = &__malloc_heap; MALLOC_DEBUG ("malloc: %d bytes\n", size); @@ -44,7 +45,7 @@ malloc (size_t size) __malloc_lock (); - mem = __heap_alloc (&__malloc_heap, &size); + mem = __heap_alloc (heap, &size); if (! mem) /* We couldn't allocate from the heap, so get some more memory from the system, add it to the heap, and try again. */ @@ -108,10 +109,10 @@ malloc (size_t size) (long)block, (long)block + block_size, block_size); /* Put BLOCK into the heap. */ - __heap_free (&__malloc_heap, block, block_size); + __heap_free (heap, block, block_size); /* Try again to allocate. */ - mem = __heap_alloc (&__malloc_heap, &size); + mem = __heap_alloc (heap, &size); } } |