Skip to content

Commit

Permalink
Inline nested function check_list
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddhesh Poyarekar committed Jun 5, 2014
1 parent d89b3d8 commit fc75bf4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
37 changes: 17 additions & 20 deletions nptl/allocatestack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit fc75bf4

Please sign in to comment.