Commit ca032936 by Tobias Fuchs

algorithms_cpp: Fix and cleanup of MergeSort

parent 2f755525
......@@ -116,7 +116,7 @@ void ForEachRecursive(RAI first, RAI last, Function unary,
block_size = 1;
}
}
// Perform check of task number sufficiency
// Check task number sufficiency
if (((distance / block_size) * 2) + 1 > MTAPI_NODE_MAX_TASKS_DEFAULT) {
EMBB_THROW(embb::base::ErrorException,
"Not enough MTAPI tasks available for parallel foreach");
......
......@@ -168,7 +168,7 @@ void MergeSortAllocate(
typename std::iterator_traits<RAI>::difference_type distance = last - first;
typedef typename std::iterator_traits<RAI>::value_type value_type;
value_type* temporary = static_cast<value_type*>(
Alloc::Allocate(distance * sizeof(value_type)));
Alloc::Allocate(distance * sizeof(value_type)));
MergeSort(first, last, temporary, comparison, policy, block_size);
Alloc::Free(temporary);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment