# HG changeset patch # User Mike Becker # Date 1350036779 -7200 # Node ID f15c7d6aebb93d529c40c4f10eae7870a78404a2 # Parent bb3eae81aae890f302282faaecea8c3b0bd2f7d3 lists now sort on heap to prevent stack overflows diff -r bb3eae81aae8 -r f15c7d6aebb9 ucx/dlist.c --- a/ucx/dlist.c Fri Oct 12 12:09:00 2012 +0200 +++ b/ucx/dlist.c Fri Oct 12 12:12:59 2012 +0200 @@ -117,7 +117,8 @@ UcxDlist *ucx_dlist_sort_merge(int length, UcxDlist* restrict ls, UcxDlist* restrict le, UcxDlist* restrict re, cmp_func fnc, void* data) { - ucx_dynarray_new(UcxDlist*, sorted, length); + + UcxDlist** sorted = (UcxDlist**) malloc(sizeof(UcxDlist*)*length); UcxDlist *rc, *lc; lc = ls; rc = le; @@ -152,7 +153,7 @@ sorted[length-1]->next = NULL; UcxDlist *ret = sorted[0]; - ucx_dynarray_free(sorted); + free(sorted); return ret; } diff -r bb3eae81aae8 -r f15c7d6aebb9 ucx/list.c --- a/ucx/list.c Fri Oct 12 12:09:00 2012 +0200 +++ b/ucx/list.c Fri Oct 12 12:12:59 2012 +0200 @@ -114,7 +114,7 @@ UcxList* restrict ls, UcxList* restrict le, UcxList* restrict re, cmp_func fnc, void* data) { - ucx_dynarray_new(UcxList*, sorted, length); + UcxList** sorted = (UcxList**) malloc(sizeof(UcxList*)*length); UcxList *rc, *lc; lc = ls; rc = le; @@ -147,7 +147,7 @@ sorted[length-1]->next = NULL; UcxList *ret = sorted[0]; - ucx_dynarray_free(sorted); + free(sorted); return ret; }