• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //////////////////////////////////////////////////////////////////////////////
2 //
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)
6 //
7 // See http://www.boost.org/libs/container for documentation.
8 //
9 //////////////////////////////////////////////////////////////////////////////
10 
11 #define BOOST_CONTAINER_SOURCE
12 #include <boost/container/detail/config_begin.hpp>
13 #include <boost/container/detail/workaround.hpp>
14 
15 #include <boost/container/pmr/unsynchronized_pool_resource.hpp>
16 
17 namespace boost {
18 namespace container {
19 namespace pmr {
20 
unsynchronized_pool_resource(const pool_options & opts,memory_resource * upstream)21 unsynchronized_pool_resource::unsynchronized_pool_resource(const pool_options& opts, memory_resource* upstream) BOOST_NOEXCEPT
22    : m_resource(opts, upstream)
23 {}
24 
unsynchronized_pool_resource()25 unsynchronized_pool_resource::unsynchronized_pool_resource() BOOST_NOEXCEPT
26    : m_resource()
27 {}
28 
unsynchronized_pool_resource(memory_resource * upstream)29 unsynchronized_pool_resource::unsynchronized_pool_resource(memory_resource* upstream) BOOST_NOEXCEPT
30    : m_resource(upstream)
31 {}
32 
unsynchronized_pool_resource(const pool_options & opts)33 unsynchronized_pool_resource::unsynchronized_pool_resource(const pool_options& opts) BOOST_NOEXCEPT
34    : m_resource(opts)
35 {}
36 
~unsynchronized_pool_resource()37 unsynchronized_pool_resource::~unsynchronized_pool_resource() //virtual
38 {}
39 
release()40 void unsynchronized_pool_resource::release()
41 {
42    m_resource.release();
43 }
44 
upstream_resource() const45 memory_resource* unsynchronized_pool_resource::upstream_resource() const
46 {  return m_resource.upstream_resource();  }
47 
options() const48 pool_options unsynchronized_pool_resource::options() const
49 {  return m_resource.options();  }
50 
do_allocate(std::size_t bytes,std::size_t alignment)51 void* unsynchronized_pool_resource::do_allocate(std::size_t bytes, std::size_t alignment) //virtual
52 {  return m_resource.do_allocate(bytes, alignment);  }
53 
do_deallocate(void * p,std::size_t bytes,std::size_t 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);  }
56 
do_is_equal(const memory_resource & other) const57 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);  }
59 
pool_count() const60 std::size_t unsynchronized_pool_resource::pool_count() const
61 {  return m_resource.pool_count();  }
62 
pool_index(std::size_t bytes) const63 std::size_t unsynchronized_pool_resource::pool_index(std::size_t bytes) const
64 {  return m_resource.pool_index(bytes);  }
65 
pool_next_blocks_per_chunk(std::size_t pool_idx) const66 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);  }
68 
pool_block(std::size_t pool_idx) const69 std::size_t unsynchronized_pool_resource::pool_block(std::size_t pool_idx) const
70 {  return m_resource.pool_block(pool_idx);  }
71 
pool_cached_blocks(std::size_t pool_idx) const72 std::size_t unsynchronized_pool_resource::pool_cached_blocks(std::size_t pool_idx) const
73 {  return m_resource.pool_cached_blocks(pool_idx);  }
74 
75 }  //namespace pmr {
76 }  //namespace container {
77 }  //namespace boost {
78 
79 #include <boost/container/detail/config_end.hpp>
80