summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc/realloc.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-10-16 21:16:46 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-10-16 21:16:46 +0000
commit0be050c8b6579abd76f4a405a1964532d4e71bf1 (patch)
tree646250b525d2fc2116b54455cd3e1146ebf85e7f /libc/stdlib/malloc/realloc.c
parent9674f4133f323e0d312a0e8f5ff3886c590f459e (diff)
This should fix malloc with debug and without threads. (Chase N Douglas)
This should have been in r23660. Untested.
Diffstat (limited to 'libc/stdlib/malloc/realloc.c')
-rw-r--r--libc/stdlib/malloc/realloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libc/stdlib/malloc/realloc.c b/libc/stdlib/malloc/realloc.c
index b3b5bae14..f12123aa9 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;
- __pthread_mutex_lock (&__malloc_heap_lock);
+ __heap_do_lock (&__malloc_heap_lock);
extra = __heap_alloc_at (__malloc_heap, base_mem + size, extra);
- __pthread_mutex_unlock (&__malloc_heap_lock);
+ __heap_do_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. */
{
- __pthread_mutex_lock (&__malloc_heap_lock);
+ __heap_do_lock (&__malloc_heap_lock);
__heap_free (__malloc_heap, base_mem + new_size, size - new_size);
- __pthread_mutex_unlock (&__malloc_heap_lock);
+ __heap_do_unlock (&__malloc_heap_lock);
MALLOC_SET_SIZE (base_mem, new_size);
}