Skip to content

Commit

Permalink
Merge branch 'embb418-exception-disabled-bug' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-kern committed Mar 3, 2015
2 parents 72cbb0c + bc14a77 commit 6d3c6d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions algorithms_cpp/include/embb/algorithms/merge_sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,18 @@ void MergeSortAllocate(
}
value_type* temporary = static_cast<value_type*>(
Alloc::Allocate(distance * sizeof(value_type)));

EMBB_TRY {
MergeSort(first, last, temporary, comparison, policy, block_size);
} EMBB_CATCH (embb::base::ErrorException & e) {
// embb exception handling does not support catch(...) and rethrow yet.
Alloc::Free(temporary);

// Rethrow only, if exceptions are enabled... Otherwise, the parameter
// e cannot be used, as it is not defined.
#ifdef EMBB_USE_EXCEPTIONS
EMBB_THROW(embb::base::ErrorException, e.what());
#endif
}
Alloc::Free(temporary);
}
Expand Down

0 comments on commit 6d3c6d0

Please sign in to comment.