Make sure test suite/examples/bench compile with exceptions disabled (exception-handling=off)

This commit is contained in:
Ion Gaztañaga
2020-10-22 01:12:59 +02:00
parent 03f030af69
commit 4bebeb2353
16 changed files with 399 additions and 323 deletions
+5 -3
View File
@@ -13,6 +13,7 @@
#endif
#include <boost/container/allocator.hpp>
#include <boost/core/no_exceptions_support.hpp>
#define BOOST_CONTAINER_VECTOR_ALLOC_STATS
@@ -109,7 +110,7 @@ void vector_test_template(unsigned int num_iterations, unsigned int num_elements
bc::vector<MyInt, IntAllocator> v;
v.reset_alloc_stats();
void *first_mem = 0;
try{
BOOST_TRY{
first_mem = bc::dlmalloc_malloc(sizeof(MyInt)*num_elements*3/2);
v.push_back(MyInt(0));
bc::dlmalloc_free(first_mem);
@@ -121,10 +122,11 @@ void vector_test_template(unsigned int num_iterations, unsigned int num_elements
numexpand += v.num_expand_bwd;
capacity = static_cast<unsigned int>(v.capacity());
}
catch(...){
BOOST_CATCH(...){
bc::dlmalloc_free(first_mem);
throw;
BOOST_RETHROW;
}
BOOST_CATCH_END
}
assert(bc::dlmalloc_allocated_memory() == 0);