summaryrefslogtreecommitdiff
path: root/malloc
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2016-09-21 16:28:08 +0200
committerFlorian Weimer <fweimer@redhat.com>2016-09-21 16:28:08 +0200
commitcbb47fa1c6476af73f393a81cd62fc926e1b8f6e (patch)
treef69ec7916eb45064634f06f09521bea14fe77712 /malloc
parentbe728303a6bcf7d2cf8d6c6ccc56d98d65309b81 (diff)
malloc: Manual part of conversion to __libc_lock
This removes the old mutex_t-related definitions from malloc-machine.h, too.
Diffstat (limited to 'malloc')
-rw-r--r--malloc/arena.c6
-rw-r--r--malloc/malloc.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/malloc/arena.c b/malloc/arena.c
index 922ae49e2f..976048370a 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -73,7 +73,7 @@ static __thread mstate thread_arena attribute_tls_model_ie;
members of struct malloc_state objects. No other locks must be
acquired after free_list_lock has been acquired. */
-static mutex_t free_list_lock = _LIBC_LOCK_INITIALIZER;
+__libc_lock_define_initialized (static, free_list_lock);
static size_t narenas = 1;
static mstate free_list;
@@ -89,7 +89,7 @@ static mstate free_list;
acquired, no arena lock must have been acquired, but it is
permitted to acquire arena locks subsequently, while list_lock is
acquired. */
-static mutex_t list_lock = _LIBC_LOCK_INITIALIZER;
+__libc_lock_define_initialized (static, list_lock);
/* Already initialized? */
int __malloc_initialized = -1;
@@ -112,7 +112,7 @@ int __malloc_initialized = -1;
#define arena_lock(ptr, size) do { \
if (ptr && !arena_is_corrupt (ptr)) \
- __libc_lock_lock (ptr->mutex); \
+ __libc_lock_lock (ptr->mutex); \
else \
ptr = arena_get2 ((size), NULL); \
} while (0)
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 20acb73c3e..ef04360b91 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1616,7 +1616,7 @@ typedef struct malloc_chunk *mfastbinptr;
struct malloc_state
{
/* Serialize access. */
- mutex_t mutex;
+ __libc_lock_define (, mutex);
/* Flags (formerly in max_fast). */
int flags;