diff options
author | Siddhesh Poyarekar <siddhesh@redhat.com> | 2014-06-06 02:59:49 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@redhat.com> | 2014-06-06 03:04:05 +0530 |
commit | fc75bf464d128f6a722d6cca7012c996f1f73425 (patch) | |
tree | f38452e2e898b63fd85792a807398009570aca34 /nptl/allocatestack.c | |
parent | d89b3d80f92035acda41010b8d68b32bc471b846 (diff) | |
download | glibc-fc75bf464d128f6a722d6cca7012c996f1f73425.tar.gz |
Inline nested function check_list
Diffstat (limited to 'nptl/allocatestack.c')
-rw-r--r-- | nptl/allocatestack.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 1e22f7da90..d0d155c056 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -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 { |