Fixes #188 ("Build fails when RTTI is disabled")

This commit is contained in:
Ion Gaztañaga
2021-08-08 00:06:01 +02:00
parent aa479c8eee
commit aaa2485ebf
6 changed files with 16 additions and 17 deletions

View File

@@ -1338,6 +1338,13 @@ use [*Boost.Container]? There are several reasons for that:
[section:release_notes Release Notes] [section:release_notes Release Notes]
[section:release_notes_boost_1_78_00 Boost 1.78 Release]
* Fixed bugs/issues:
* [@https://github.com/boostorg/container/issues/188 GitHub #188: ['"Build fails when RTTI is disabled"]].
[endsect]
[section:release_notes_boost_1_77_00 Boost 1.77 Release] [section:release_notes_boost_1_77_00 Boost 1.77 Release]
* Fixed bugs/issues: * Fixed bugs/issues:

View File

@@ -100,7 +100,7 @@ class pool_resource
//! <b>Effects</b>: Calls //! <b>Effects</b>: Calls
//! `this->release()`. //! `this->release()`.
virtual ~pool_resource(); ~pool_resource();
//! <b>Effects</b>: Calls Calls `upstream_resource()->deallocate()` as necessary //! <b>Effects</b>: Calls Calls `upstream_resource()->deallocate()` as necessary
//! to release all allocated memory. [ Note: memory is released back to //! to release all allocated memory. [ Note: memory is released back to
@@ -131,18 +131,14 @@ class pool_resource
//! using `upstream_resource()->allocate()`. //! using `upstream_resource()->allocate()`.
//! //!
//! <b>Throws</b>: Nothing unless `upstream_resource()->allocate()` throws. //! <b>Throws</b>: Nothing unless `upstream_resource()->allocate()` throws.
virtual void* do_allocate(std::size_t bytes, std::size_t alignment); void* do_allocate(std::size_t bytes, std::size_t alignment);
//! <b>Effects</b>: Return the memory at p to the pool. It is unspecified if or under //! <b>Effects</b>: Return the memory at p to the pool. It is unspecified if or under
//! what circumstances this operation will result in a call to //! what circumstances this operation will result in a call to
//! `upstream_resource()->deallocate()`. //! `upstream_resource()->deallocate()`.
//! //!
//! <b>Throws</b>: Nothing. //! <b>Throws</b>: Nothing.
virtual void do_deallocate(void* p, std::size_t bytes, std::size_t alignment); void do_deallocate(void* p, std::size_t bytes, std::size_t alignment);
//! <b>Returns</b>:
//! `this == dynamic_cast<const pool_resource*>(&other)`.
virtual bool do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT;
//Non-standard observers //Non-standard observers
public: public:

View File

@@ -166,7 +166,7 @@ void monotonic_buffer_resource::do_deallocate(void* p, std::size_t bytes, std::s
{ (void)p; (void)bytes; (void)alignment; } { (void)p; (void)bytes; (void)alignment; }
bool monotonic_buffer_resource::do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT bool monotonic_buffer_resource::do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT
{ return this == dynamic_cast<const monotonic_buffer_resource*>(&other); } { return this == &other; }
} //namespace pmr { } //namespace pmr {
} //namespace container { } //namespace container {

View File

@@ -176,7 +176,7 @@ pool_resource::pool_resource(const pool_options& opts) BOOST_NOEXCEPT
: m_options(opts), m_upstream(*get_default_resource()), m_oversized_list(), m_pool_data(), m_pool_count() : m_options(opts), m_upstream(*get_default_resource()), m_oversized_list(), m_pool_data(), m_pool_count()
{ this->priv_constructor_body(); } { this->priv_constructor_body(); }
pool_resource::~pool_resource() //virtual pool_resource::~pool_resource()
{ {
this->release(); this->release();
@@ -203,7 +203,7 @@ memory_resource* pool_resource::upstream_resource() const
pool_options pool_resource::options() const pool_options pool_resource::options() const
{ return m_options; } { return m_options; }
void* pool_resource::do_allocate(std::size_t bytes, std::size_t alignment) //virtual void* pool_resource::do_allocate(std::size_t bytes, std::size_t alignment)
{ {
if(!m_pool_data){ if(!m_pool_data){
this->priv_init_pools(); this->priv_init_pools();
@@ -224,7 +224,7 @@ void* pool_resource::do_allocate(std::size_t bytes, std::size_t alignment) //vir
} }
} }
void pool_resource::do_deallocate(void* p, std::size_t bytes, std::size_t alignment) //virtual void pool_resource::do_deallocate(void* p, std::size_t bytes, std::size_t alignment)
{ {
(void)alignment; //alignment ignored here, max_align is used by pools (void)alignment; //alignment ignored here, max_align is used by pools
if(bytes > m_options.largest_required_pool_block){ if(bytes > m_options.largest_required_pool_block){
@@ -237,10 +237,6 @@ void pool_resource::do_deallocate(void* p, std::size_t bytes, std::size_t alignm
} }
} }
bool pool_resource::do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT //virtual
{ return this == dynamic_cast<const pool_resource*>(&other); }
std::size_t pool_resource::pool_count() const std::size_t pool_resource::pool_count() const
{ {
if(BOOST_LIKELY((0 != m_pool_data))){ if(BOOST_LIKELY((0 != m_pool_data))){

View File

@@ -87,7 +87,7 @@ void synchronized_pool_resource::do_deallocate(void* p, std::size_t bytes, std::
} }
bool synchronized_pool_resource::do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT //virtual bool synchronized_pool_resource::do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT //virtual
{ return this == dynamic_cast<const synchronized_pool_resource*>(&other); } { return this == &other; }
std::size_t synchronized_pool_resource::pool_count() const std::size_t synchronized_pool_resource::pool_count() const
{ return m_pool_resource.pool_count(); } { return m_pool_resource.pool_count(); }

View File

@@ -55,7 +55,7 @@ void unsynchronized_pool_resource::do_deallocate(void* p, std::size_t bytes, std
{ return m_resource.do_deallocate(p, bytes, alignment); } { return m_resource.do_deallocate(p, bytes, alignment); }
bool unsynchronized_pool_resource::do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT //virtual bool unsynchronized_pool_resource::do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT //virtual
{ return this == dynamic_cast<const unsynchronized_pool_resource*>(&other); } { return this == &other; }
std::size_t unsynchronized_pool_resource::pool_count() const std::size_t unsynchronized_pool_resource::pool_count() const
{ return m_resource.pool_count(); } { return m_resource.pool_count(); }