]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - nptl/pthread_setspecific.c
Add per-thread cache to malloc
[thirdparty/glibc.git] / nptl / pthread_setspecific.c
index ec0cc9d95ab76e00e53e782f821fb67962256ede..214af3b661d243362b54dc3c85b5c08dd51c8da9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -22,9 +22,7 @@
 
 
 int
-__pthread_setspecific (key, value)
-     pthread_key_t key;
-     const void *value;
+__pthread_setspecific (pthread_key_t key, const void *value)
 {
   struct pthread *self;
   unsigned int idx1st;
@@ -36,7 +34,7 @@ __pthread_setspecific (key, value)
 
   /* Special case access to the first 2nd-level block.  This is the
      usual case.  */
-  if (__builtin_expect (key < PTHREAD_KEY_2NDLEVEL_SIZE, 1))
+  if (__glibc_likely (key < PTHREAD_KEY_2NDLEVEL_SIZE))
     {
       /* Verify the key is sane.  */
       if (KEY_UNUSED ((seq = __pthread_keys[key].seq)))
@@ -91,5 +89,5 @@ __pthread_setspecific (key, value)
 
   return 0;
 }
-strong_alias (__pthread_setspecific, pthread_setspecific)
+weak_alias (__pthread_setspecific, pthread_setspecific)
 hidden_def (__pthread_setspecific)