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
+7 -5
View File
@@ -13,6 +13,8 @@
#endif
#include <boost/container/detail/dlmalloc.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/container/throw_exception.hpp>
#define BOOST_INTERPROCESS_VECTOR_ALLOC_STATS
@@ -61,7 +63,7 @@ void allocation_timing_test(unsigned int num_iterations, unsigned int num_elemen
dlmalloc_free(first_mem);
++numalloc;
try{
BOOST_TRY{
dlmalloc_command_ret_t ret;
for(size_t e = capacity + 1; e < num_elements; ++e){
size_t received_size;
@@ -73,8 +75,7 @@ void allocation_timing_test(unsigned int num_iterations, unsigned int num_elemen
( m_mode, sizeof(POD)
, min, max, &received_size, addr);
if(!ret.first){
std::cout << "(!ret.first)!" << std::endl;
throw int(0);
throw_runtime_error("!ret.first)");
}
if(!ret.second){
assert(m_mode == BOOST_CONTAINER_ALLOCATE_NEW);
@@ -100,10 +101,11 @@ void allocation_timing_test(unsigned int num_iterations, unsigned int num_elemen
}
dlmalloc_free(addr);
}
catch(...){
BOOST_CATCH(...){
dlmalloc_free(addr);
throw;
BOOST_RETHROW;
}
BOOST_CATCH_END
}
assert( dlmalloc_allocated_memory() == 0);