- Replaced default standard exception classes with Boost.Container own classes, reducing considerably the included files overhead

This commit is contained in:
Ion Gaztañaga
2020-12-30 15:07:32 +01:00
parent b17dabf47a
commit d5a830434e
8 changed files with 181 additions and 42 deletions

View File

@@ -18,6 +18,7 @@
#include <boost/container/detail/min_max.hpp>
#include <boost/intrusive/detail/math.hpp>
#include <boost/container/throw_exception.hpp>
#include <new>
#include <cstddef>
@@ -135,8 +136,14 @@ void *monotonic_buffer_resource::allocate_from_current(std::size_t aligner, std:
void* monotonic_buffer_resource::do_allocate(std::size_t bytes, std::size_t alignment)
{
if(alignment > memory_resource::max_align)
if(alignment > memory_resource::max_align){
(void)bytes; (void)alignment;
#if defined(BOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS) || defined(BOOST_NO_EXCEPTIONS)
throw_bad_alloc();
#else
throw std::bad_alloc();
#endif
}
//See if there is room in current buffer
std::size_t aligner = 0u;