diff options
author | Rob Landley <rob@landley.net> | 2008-10-28 06:48:06 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2008-10-28 06:48:06 +0000 |
commit | 7d602faf7652cbd8358ff90a9eaa53ac5230dabe (patch) | |
tree | 6739a0f15b6a24fc94fdf2b6a16a2807a405a976 /libc/stdlib/malloc/realloc.c | |
parent | 346792d2a1494d3451837c205343c2ecbf5ee810 (diff) |
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)).
Diffstat (limited to 'libc/stdlib/malloc/realloc.c')
-rw-r--r-- | libc/stdlib/malloc/realloc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libc/stdlib/malloc/realloc.c b/libc/stdlib/malloc/realloc.c index f12123aa9..a8271995b 100644 --- a/libc/stdlib/malloc/realloc.c +++ b/libc/stdlib/malloc/realloc.c @@ -59,9 +59,9 @@ realloc (void *mem, size_t new_size) { size_t extra = new_size - size; - __heap_do_lock (&__malloc_heap_lock); - extra = __heap_alloc_at (__malloc_heap, base_mem + size, extra); - __heap_do_unlock (&__malloc_heap_lock); + __heap_lock (&__malloc_heap_lock); + extra = __heap_alloc_at (&__malloc_heap, base_mem + size, extra); + __heap_unlock (&__malloc_heap_lock); if (extra) /* Record the changed size. */ @@ -82,9 +82,9 @@ realloc (void *mem, size_t new_size) else if (new_size + MALLOC_REALLOC_MIN_FREE_SIZE <= size) /* Shrink the block. */ { - __heap_do_lock (&__malloc_heap_lock); - __heap_free (__malloc_heap, base_mem + new_size, size - new_size); - __heap_do_unlock (&__malloc_heap_lock); + __heap_lock (&__malloc_heap_lock); + __heap_free (&__malloc_heap, base_mem + new_size, size - new_size); + __heap_unlock (&__malloc_heap_lock); MALLOC_SET_SIZE (base_mem, new_size); } |