Skip to content
Snippets Groups Projects
Commit 17f75981 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

fix bug found by peter where the stack can be smaller than the total number of threads.

parent 8eb61c4d
No related branches found
No related tags found
1 merge request!50Parallel sorting
......@@ -492,7 +492,7 @@ void space_parts_sort(struct space *s, int *ind, int N, int min, int max) {
space_sort_struct.parts = s->parts;
space_sort_struct.xparts = s->xparts;
space_sort_struct.ind = ind;
space_sort_struct.stack_size = 2 * (max - min) + 10;
space_sort_struct.stack_size = 2 * (max - min + 1) + 10 + s->e->nr_threads;
if ((space_sort_struct.stack = malloc(sizeof(struct qstack) *
space_sort_struct.stack_size)) == NULL)
error("Failed to allocate sorting stack.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment