1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

Use glibc_likely instead __builtin_expect.

This commit is contained in:
Ondřej Bílka
2014-02-10 14:45:42 +01:00
parent 1448f32447
commit a1ffb40e32
466 changed files with 2224 additions and 1655 deletions

View File

@@ -60,7 +60,7 @@ _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used, Lmid_t ns)
if (runp != NULL)
/* Look through the dependencies of the object. */
while (*runp != NULL)
if (__builtin_expect (*runp++ == thisp, 0))
if (__glibc_unlikely (*runp++ == thisp))
{
move:
/* Move the current object to the back past the last
@@ -90,21 +90,21 @@ _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used, Lmid_t ns)
goto next;
}
if (__builtin_expect (maps[k]->l_reldeps != NULL, 0))
if (__glibc_unlikely (maps[k]->l_reldeps != NULL))
{
unsigned int m = maps[k]->l_reldeps->act;
struct link_map **relmaps = &maps[k]->l_reldeps->list[0];
/* Look through the relocation dependencies of the object. */
while (m-- > 0)
if (__builtin_expect (relmaps[m] == thisp, 0))
if (__glibc_unlikely (relmaps[m] == thisp))
{
/* If a cycle exists with a link time dependency,
preserve the latter. */
struct link_map **runp = thisp->l_initfini;
if (runp != NULL)
while (*runp != NULL)
if (__builtin_expect (*runp++ == maps[k], 0))
if (__glibc_unlikely (*runp++ == maps[k]))
goto ignore;
goto move;
}
@@ -286,7 +286,7 @@ _dl_fini (void)
goto again;
}
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_STATISTICS, 0))
if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_STATISTICS))
_dl_debug_printf ("\nruntime linker statistics:\n"
" final number of relocations: %lu\n"
"final number of relocations from cache: %lu\n",