diff options
| author | Dev Jain <dev.jain@arm.com> | 2025-09-15 17:13:29 +0530 |
|---|---|---|
| committer | DJ Delorie <dj@redhat.com> | 2025-09-18 15:50:15 -0400 |
| commit | f807e85c31c67658f861ccd3afdb51d301215258 (patch) | |
| tree | e110fcf154a664411032d79db261444adbc2b9b6 /malloc | |
| parent | 855a67c3cc81be4fc806c66e3e01b53e352a4e9f (diff) | |
malloc: Hoist common unlock out of if-else control block
We currently unlock the arena mutex in arena_get_retry() unconditionally.
Therefore, hoist out the unlock from the if-else control block.
Signed-off-by: Dev Jain <dev.jain@arm.com>
Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'malloc')
| -rw-r--r-- | malloc/arena.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/malloc/arena.c b/malloc/arena.c index 4cc9881d82..4cd79d7244 100644 --- a/malloc/arena.c +++ b/malloc/arena.c @@ -861,15 +861,14 @@ static mstate arena_get_retry (mstate ar_ptr, size_t bytes) { LIBC_PROBE (memory_arena_retry, 2, bytes, ar_ptr); + __libc_lock_unlock (ar_ptr->mutex); if (ar_ptr != &main_arena) { - __libc_lock_unlock (ar_ptr->mutex); ar_ptr = &main_arena; __libc_lock_lock (ar_ptr->mutex); } else { - __libc_lock_unlock (ar_ptr->mutex); ar_ptr = arena_get2 (bytes, ar_ptr); } |
