forked from boostorg/container
Make sure test suite/examples/bench compile with exceptions disabled (exception-handling=off)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user