diff options
author | Ondřej Bílka <neleai@seznam.cz> | 2014-02-10 14:45:42 +0100 |
---|---|---|
committer | Ondřej Bílka <neleai@seznam.cz> | 2014-02-10 15:07:12 +0100 |
commit | a1ffb40e32741f992c743e7b16c061fefa3747ac (patch) | |
tree | 246a29a87b26cfd5d07b17070f85eb3785018de9 /elf/dl-tls.c | |
parent | 1448f3244714a9dabb5240ec18b094f100887d5c (diff) | |
download | glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.gz glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.xz glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.zip |
Use glibc_likely instead __builtin_expect.
Diffstat (limited to 'elf/dl-tls.c')
-rw-r--r-- | elf/dl-tls.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/elf/dl-tls.c b/elf/dl-tls.c index dbaea0aa91..9454d06d72 100644 --- a/elf/dl-tls.c +++ b/elf/dl-tls.c @@ -720,7 +720,7 @@ tls_get_addr_tail (GET_ADDR_ARGS, dtv_t *dtv, struct link_map *the_map) != FORCED_DYNAMIC_TLS_OFFSET, 0)) { __rtld_lock_lock_recursive (GL(dl_load_lock)); - if (__builtin_expect (the_map->l_tls_offset == NO_TLS_OFFSET, 1)) + if (__glibc_likely (the_map->l_tls_offset == NO_TLS_OFFSET)) { the_map->l_tls_offset = FORCED_DYNAMIC_TLS_OFFSET; __rtld_lock_unlock_recursive (GL(dl_load_lock)); @@ -732,7 +732,7 @@ tls_get_addr_tail (GET_ADDR_ARGS, dtv_t *dtv, struct link_map *the_map) != FORCED_DYNAMIC_TLS_OFFSET, 1)) { void *p = dtv[GET_ADDR_MODULE].pointer.val; - if (__builtin_expect (p == TLS_DTV_UNALLOCATED, 0)) + if (__glibc_unlikely (p == TLS_DTV_UNALLOCATED)) goto again; return (char *) p + GET_ADDR_OFFSET; @@ -755,7 +755,7 @@ update_get_addr (GET_ADDR_ARGS) void *p = dtv[GET_ADDR_MODULE].pointer.val; - if (__builtin_expect (p == TLS_DTV_UNALLOCATED, 0)) + if (__glibc_unlikely (p == TLS_DTV_UNALLOCATED)) return tls_get_addr_tail (GET_ADDR_PARAM, dtv, the_map); return (void *) p + GET_ADDR_OFFSET; @@ -769,12 +769,12 @@ __tls_get_addr (GET_ADDR_ARGS) { dtv_t *dtv = THREAD_DTV (); - if (__builtin_expect (dtv[0].counter != GL(dl_tls_generation), 0)) + if (__glibc_unlikely (dtv[0].counter != GL(dl_tls_generation))) return update_get_addr (GET_ADDR_PARAM); void *p = dtv[GET_ADDR_MODULE].pointer.val; - if (__builtin_expect (p == TLS_DTV_UNALLOCATED, 0)) + if (__glibc_unlikely (p == TLS_DTV_UNALLOCATED)) return tls_get_addr_tail (GET_ADDR_PARAM, dtv, NULL); return (char *) p + GET_ADDR_OFFSET; @@ -787,12 +787,12 @@ __tls_get_addr (GET_ADDR_ARGS) void * _dl_tls_get_addr_soft (struct link_map *l) { - if (__builtin_expect (l->l_tls_modid == 0, 0)) + if (__glibc_unlikely (l->l_tls_modid == 0)) /* This module has no TLS segment. */ return NULL; dtv_t *dtv = THREAD_DTV (); - if (__builtin_expect (dtv[0].counter != GL(dl_tls_generation), 0)) + if (__glibc_unlikely (dtv[0].counter != GL(dl_tls_generation))) { /* This thread's DTV is not completely current, but it might already cover this module. */ @@ -817,7 +817,7 @@ _dl_tls_get_addr_soft (struct link_map *l) } void *data = dtv[l->l_tls_modid].pointer.val; - if (__builtin_expect (data == TLS_DTV_UNALLOCATED, 0)) + if (__glibc_unlikely (data == TLS_DTV_UNALLOCATED)) /* The DTV is current, but this thread has not yet needed to allocate this module's segment. */ data = NULL; |