1 //////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // See http://www.boost.org/libs/container for documentation.
9 //////////////////////////////////////////////////////////////////////////////
11 #define BOOST_CONTAINER_SOURCE
12 #include <boost/container/detail/config_begin.hpp>
13 #include <boost/container/detail/workaround.hpp>
15 #include <boost/container/pmr/unsynchronized_pool_resource.hpp>
21 unsynchronized_pool_resource::unsynchronized_pool_resource(const pool_options
& opts
, memory_resource
* upstream
) BOOST_NOEXCEPT
22 : m_resource(opts
, upstream
)
25 unsynchronized_pool_resource::unsynchronized_pool_resource() BOOST_NOEXCEPT
29 unsynchronized_pool_resource::unsynchronized_pool_resource(memory_resource
* upstream
) BOOST_NOEXCEPT
30 : m_resource(upstream
)
33 unsynchronized_pool_resource::unsynchronized_pool_resource(const pool_options
& opts
) BOOST_NOEXCEPT
37 unsynchronized_pool_resource::~unsynchronized_pool_resource() //virtual
40 void unsynchronized_pool_resource::release()
45 memory_resource
* unsynchronized_pool_resource::upstream_resource() const
46 { return m_resource
.upstream_resource(); }
48 pool_options
unsynchronized_pool_resource::options() const
49 { return m_resource
.options(); }
51 void* unsynchronized_pool_resource::do_allocate(std::size_t bytes
, std::size_t alignment
) //virtual
52 { return m_resource
.do_allocate(bytes
, alignment
); }
54 void unsynchronized_pool_resource::do_deallocate(void* p
, std::size_t bytes
, std::size_t alignment
) //virtual
55 { return m_resource
.do_deallocate(p
, bytes
, alignment
); }
57 bool unsynchronized_pool_resource::do_is_equal(const memory_resource
& other
) const BOOST_NOEXCEPT
//virtual
58 { return this == dynamic_cast<const unsynchronized_pool_resource
*>(&other
); }
60 std::size_t unsynchronized_pool_resource::pool_count() const
61 { return m_resource
.pool_count(); }
63 std::size_t unsynchronized_pool_resource::pool_index(std::size_t bytes
) const
64 { return m_resource
.pool_index(bytes
); }
66 std::size_t unsynchronized_pool_resource::pool_next_blocks_per_chunk(std::size_t pool_idx
) const
67 { return m_resource
.pool_next_blocks_per_chunk(pool_idx
); }
69 std::size_t unsynchronized_pool_resource::pool_block(std::size_t pool_idx
) const
70 { return m_resource
.pool_block(pool_idx
); }
72 std::size_t unsynchronized_pool_resource::pool_cached_blocks(std::size_t pool_idx
) const
73 { return m_resource
.pool_cached_blocks(pool_idx
); }
76 } //namespace container {
79 #include <boost/container/detail/config_end.hpp>