summaryrefslogtreecommitdiff
path: root/malloc/arena.c
diff options
context:
space:
mode:
authorOndřej Bílka <neleai@seznam.cz>2014-02-10 14:45:42 +0100
committerOndřej Bílka <neleai@seznam.cz>2014-02-10 15:07:12 +0100
commita1ffb40e32741f992c743e7b16c061fefa3747ac (patch)
tree246a29a87b26cfd5d07b17070f85eb3785018de9 /malloc/arena.c
parent1448f3244714a9dabb5240ec18b094f100887d5c (diff)
Use glibc_likely instead __builtin_expect.
Diffstat (limited to 'malloc/arena.c')
-rw-r--r--malloc/arena.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/malloc/arena.c b/malloc/arena.c
index 71678a9dc4..60ae9a4c31 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -376,7 +376,7 @@ ptmalloc_init (void)
tsd_setspecific (arena_key, (void *) &main_arena);
thread_atfork (ptmalloc_lock_all, ptmalloc_unlock_all, ptmalloc_unlock_all2);
const char *s = NULL;
- if (__builtin_expect (_environ != NULL, 1))
+ if (__glibc_likely (_environ != NULL))
{
char **runp = _environ;
char *envline;
@@ -624,7 +624,7 @@ shrink_heap (heap_info *h, long diff)
/* Try to re-map the extra heap space freshly to save memory, and make it
inaccessible. See malloc-sysdep.h to know when this is true. */
- if (__builtin_expect (check_may_shrink_heap (), 0))
+ if (__glibc_unlikely (check_may_shrink_heap ()))
{
if ((char *) MMAP ((char *) h + new_size, diff, PROT_NONE,
MAP_FIXED) == (char *) MAP_FAILED)
@@ -863,12 +863,12 @@ arena_get2 (mstate a_tsd, size_t size, mstate avoid_arena)
narenas_limit is 0. There is no possibility for narenas to
be too big for the test to always fail since there is not
enough address space to create that many arenas. */
- if (__builtin_expect (n <= narenas_limit - 1, 0))
+ if (__glibc_unlikely (n <= narenas_limit - 1))
{
if (catomic_compare_and_exchange_bool_acq (&narenas, n + 1, n))
goto repeat;
a = _int_new_arena (size);
- if (__builtin_expect (a == NULL, 0))
+ if (__glibc_unlikely (a == NULL))
catomic_decrement (&narenas);
}
else