View | Details | Raw Unified | Return to bug 19048 | Differences between
and this patch

Collapse All | Expand All

(-)a/malloc/arena.c (-3 / +20 lines)
Lines 935-942 arena_thread_freeres (void) Link Here
935
  if (a != NULL)
935
  if (a != NULL)
936
    {
936
    {
937
      (void) mutex_lock (&list_lock);
937
      (void) mutex_lock (&list_lock);
938
      a->next_free = free_list;
938
      /* Use other arenas before "a".  */
939
      free_list = a;
939
      if (a == free_list)
940
	free_list = free_list->next_free;
941
      /* Insert "a" last in free_list.  */
942
      if (free_list != NULL)
943
	{
944
	  mstate b = free_list;
945
	  while (b->next_free != NULL)
946
	    {
947
	      /* Make sure to check if "a" is already in free_list. */
948
	      if (b->next_free == a)
949
		b->next_free = a->next_free;
950
	      else
951
		b = b->next_free;
952
	    }
953
	  b->next_free = a;
954
	}
955
      else
956
	free_list = a;
957
      a->next_free = NULL;
940
      (void) mutex_unlock (&list_lock);
958
      (void) mutex_unlock (&list_lock);
941
    }
959
    }
942
}
960
}
943
- 

Return to bug 19048