summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc/realloc.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-10-17 10:37:43 +0000
committerEric Andersen <andersen@codepoet.org>2002-10-17 10:37:43 +0000
commitdb7c5027f4dfaa1cb83d25f7284d124bee4eb574 (patch)
treeed9cdbc72aa1ec980b4a85f2d13a9769396f5518 /libc/stdlib/malloc/realloc.c
parent58445daa9894cd958640f0df32f9c453ee74faa8 (diff)
Fix malloc so it compiles and works when using pthreads
-Erik
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 32cfacd54..9bfe95198 100644
--- a/libc/stdlib/malloc/realloc.c
+++ b/libc/stdlib/malloc/realloc.c
@@ -51,9 +51,9 @@ realloc (void *mem, size_t new_size)
{
size_t extra = new_size - size;
- __heap_lock (heap);
+ __heap_lock (&__malloc_heap);
extra = __heap_alloc_at (&__malloc_heap, base_mem + size, extra);
- __heap_unlock (heap);
+ __heap_unlock (&__malloc_heap);
if (extra)
/* Record the changed size. */
@@ -74,9 +74,9 @@ realloc (void *mem, size_t new_size)
else if (new_size + MALLOC_REALLOC_MIN_FREE_SIZE <= size)
/* Shrink the block. */
{
- __heap_lock (heap);
+ __heap_lock (&__malloc_heap);
__heap_free (&__malloc_heap, base_mem + new_size, size - new_size);
- __heap_unlock (heap);
+ __heap_unlock (&__malloc_heap);
MALLOC_SET_SIZE (base_mem, new_size);
}