about summary refs log tree commit diff
path: root/malloc/memusage.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/memusage.c
parent1448f3244714a9dabb5240ec18b094f100887d5c (diff)
downloadglibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.gz
glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.xz
glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.zip
Use glibc_likely instead __builtin_expect.
Diffstat (limited to 'malloc/memusage.c')
-rw-r--r--malloc/memusage.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/malloc/memusage.c b/malloc/memusage.c
index bfbaecc289..bd8bcd9db0 100644
--- a/malloc/memusage.c
+++ b/malloc/memusage.c
@@ -137,20 +137,20 @@ update_data (struct header *result, size_t len, size_t old_len)
      value.  The base stack pointer might not be set if this is not
      the main thread and it is the first call to any of these
      functions.  */
-  if (__builtin_expect (!start_sp, 0))
+  if (__glibc_unlikely (!start_sp))
     start_sp = GETSP ();
 
   uintptr_t sp = GETSP ();
 #ifdef STACK_GROWS_UPWARD
   /* This can happen in threads where we didn't catch the thread's
      stack early enough.  */
-  if (__builtin_expect (sp < start_sp, 0))
+  if (__glibc_unlikely (sp < start_sp))
     start_sp = sp;
   size_t current_stack = sp - start_sp;
 #else
   /* This can happen in threads where we didn't catch the thread's
      stack early enough.  */
-  if (__builtin_expect (sp > start_sp, 0))
+  if (__glibc_unlikely (sp > start_sp))
     start_sp = sp;
   size_t current_stack = start_sp - sp;
 #endif
@@ -330,7 +330,7 @@ malloc (size_t len)
   struct header *result = NULL;
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return NULL;
@@ -382,7 +382,7 @@ realloc (void *old, size_t len)
   size_t old_len;
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return NULL;
@@ -476,7 +476,7 @@ calloc (size_t n, size_t len)
   size_t size = n * len;
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return NULL;
@@ -526,7 +526,7 @@ free (void *ptr)
   struct header *real;
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return;
@@ -578,7 +578,7 @@ mmap (void *start, size_t len, int prot, int flags, int fd, off_t offset)
   void *result = NULL;
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return NULL;
@@ -631,7 +631,7 @@ mmap64 (void *start, size_t len, int prot, int flags, int fd, off64_t offset)
   void *result = NULL;
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return NULL;
@@ -689,7 +689,7 @@ mremap (void *start, size_t old_len, size_t len, int flags, ...)
   va_end (ap);
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return NULL;
@@ -750,7 +750,7 @@ munmap (void *start, size_t len)
   int result;
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return -1;
@@ -766,7 +766,7 @@ munmap (void *start, size_t len)
       /* Keep track of number of calls.  */
       catomic_increment (&calls[idx_munmap]);
 
-      if (__builtin_expect (result == 0, 1))
+      if (__glibc_likely (result == 0))
         {
           /* Keep track of total memory freed using `free'.  */
           catomic_add (&total[idx_munmap], len);