]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Inline nested function check_list
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Thu, 5 Jun 2014 21:29:49 +0000 (02:59 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Thu, 5 Jun 2014 21:34:05 +0000 (03:04 +0530)
ChangeLog
nptl/allocatestack.c

index 17f0c8325c95d0236e06d07da582de6f55dc11d5..8fe1ad08d800f29bb9705b6a69b3b32cc3b28c4e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-06-05  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+       * nptl/allocatestack.c (check_list): Inlined function...
+       (__reclaim_stacks): ... here.
+
 2014-06-05  Ondřej Bílka  <neleai@seznam.cz>
 
        [BZ #15698]
index 1e22f7da900baa1534962ef32e98405111d3fa85..d0d155c0562647662ba4a2a6813e680306e8266b 100644 (file)
@@ -830,26 +830,23 @@ __reclaim_stacks (void)
 
       if (add_p)
        {
-         /* We always add at the beginning of the list.  So in this
-            case we only need to check the beginning of these lists.  */
-         int check_list (list_t *l)
-         {
-           if (l->next->prev != l)
-             {
-               assert (l->next->prev == elem);
-
-               elem->next = l->next;
-               elem->prev = l;
-               l->next = elem;
-
-               return 1;
-             }
-
-           return 0;
-         }
-
-         if (check_list (&stack_used) == 0)
-           (void) check_list (&stack_cache);
+         /* We always add at the beginning of the list.  So in this case we
+            only need to check the beginning of these lists to see if the
+            pointers at the head of the list are inconsistent.  */
+         list_t *l = NULL;
+
+         if (stack_used.next->prev != &stack_used)
+           l = &stack_used;
+         else if (stack_cache.next->prev != &stack_cache)
+           l = &stack_cache;
+
+         if (l != NULL)
+           {
+             assert (l->next->prev == elem);
+             elem->next = l->next;
+             elem->prev = l;
+             l->next = elem;
+           }
        }
       else
        {