diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2011-03-21 14:43:50 +0100 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2012-06-15 14:00:30 +0200 |
commit | 3b879e2627693437365b0966d56223c4f00f8d60 (patch) | |
tree | 4aec66ea96ba06e230c91626954a259de96b36cb /libc/stdlib/malloc/malloc.c | |
parent | e75dfc1f73715d8cfe8fbd5998b111506d8881de (diff) |
malloc: use uClibc_mutex.h provided macros consequently
use the __UCLIBC_MUTEX macros
remove unused code
remove duplicated code (likely,unlikely)
hide internal __x() functions (mainly debug related)
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/stdlib/malloc/malloc.c')
-rw-r--r-- | libc/stdlib/malloc/malloc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libc/stdlib/malloc/malloc.c b/libc/stdlib/malloc/malloc.c index d58a7d0ee..550d5b994 100644 --- a/libc/stdlib/malloc/malloc.c +++ b/libc/stdlib/malloc/malloc.c @@ -26,12 +26,12 @@ HEAP_DECLARE_STATIC_FREE_AREA (initial_fa, 256); struct heap_free_area *__malloc_heap = HEAP_INIT_WITH_FA (initial_fa); #ifdef HEAP_USE_LOCKING -malloc_mutex_t __malloc_heap_lock = PTHREAD_MUTEX_INITIALIZER; +__UCLIBC_MUTEX_INIT(__malloc_heap_lock,PTHREAD_MUTEX_INITIALIZER); #endif #if defined(MALLOC_USE_LOCKING) && defined(MALLOC_USE_SBRK) /* A lock protecting our use of sbrk. */ -malloc_mutex_t __malloc_sbrk_lock; +__UCLIBC_MUTEX(__malloc_sbrk_lock); #endif /* MALLOC_USE_LOCKING && MALLOC_USE_SBRK */ @@ -46,7 +46,7 @@ struct malloc_mmb *__malloc_mmapped_blocks = 0; HEAP_DECLARE_STATIC_FREE_AREA (initial_mmb_fa, 48); /* enough for 3 mmbs */ struct heap_free_area *__malloc_mmb_heap = HEAP_INIT_WITH_FA (initial_mmb_fa); #ifdef HEAP_USE_LOCKING -malloc_mutex_t __malloc_mmb_heap_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; +__UCLIBC_MUTEX_INIT(__malloc_mmb_heap_lock,PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP); #endif #endif /* __UCLIBC_UCLINUX_BROKEN_MUNMAP__ */ @@ -59,7 +59,7 @@ malloc_mutex_t __malloc_mmb_heap_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; static void * __malloc_from_heap (size_t size, struct heap_free_area **heap #ifdef HEAP_USE_LOCKING - , malloc_mutex_t *heap_lock + , __UCLIBC_MUTEX_TYPE *heap_lock #endif ) { |