From a5fb313cb7b7e692fd4684916aaa98e03ec7e8b6 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 14 Nov 2011 11:41:52 +0100 Subject: Don't call reused_arena when _int_new_arena failed --- malloc/arena.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'malloc/arena.c') diff --git a/malloc/arena.c b/malloc/arena.c index 042cac8..cb8548b 100644 --- a/malloc/arena.c +++ b/malloc/arena.c @@ -844,14 +844,14 @@ arena_get2(mstate a_tsd, size_t size) size_t n = narenas; if (__builtin_expect (n <= mp_.arena_test || n < narenas_limit, 0)) { - if (catomic_compare_and_exchange_bool_acq(&narenas, n + 1, n)) + if (catomic_compare_and_exchange_bool_acq (&narenas, n + 1, n)) goto repeat; a = _int_new_arena (size); - if (__builtin_expect (a != NULL, 1)) - return a; - catomic_decrement(&narenas); + if (__builtin_expect (a == NULL, 0)) + catomic_decrement (&narenas); } - a = reused_arena (); + else + a = reused_arena (); } #else if(!a_tsd) -- cgit v1.1