/usr/include/boost/container/detail
NameSizeModeActions
adaptive_node_pool.hpp55690644editdlrm
adaptive_node_pool_impl.hpp540880644editdlrm
addressof.hpp10630644editdlrm
advanced_insert_int.hpp176680644editdlrm
algorithm.hpp38800644editdlrm
allocation_type.hpp20170644editdlrm
allocator_version_traits.hpp56320644editdlrm
alloc_helpers.hpp18670644editdlrm
alloc_lib.h117420644editdlrm
auto_link.hpp16570644editdlrm
block_list.hpp41990644editdlrm
block_slist.hpp45030644editdlrm
compare_functors.hpp39920644editdlrm
config_begin.hpp36370644editdlrm
config_end.hpp4800644editdlrm
construct_in_place.hpp29520644editdlrm
container_or_allocator_rebind.hpp17430644editdlrm
container_rebind.hpp66100644editdlrm
copy_move_algo.hpp385310644editdlrm
destroyers.hpp93380644editdlrm
dispatch_uses_allocator.hpp197330644editdlrm
dlmalloc.hpp34440644editdlrm
flat_tree.hpp616630644editdlrm
function_detector.hpp35580644editdlrm
is_container.hpp22130644editdlrm
is_contiguous_container.hpp17120644editdlrm
is_sorted.hpp14650644editdlrm
iterator.hpp25900644editdlrm
iterators.hpp298820644editdlrm
iterator_to_raw_pointer.hpp9710644editdlrm
math_functions.hpp38720644editdlrm
minimal_char_traits_header.hpp10570644editdlrm
min_max.hpp9970644editdlrm
mpl.hpp38340644editdlrm
multiallocation_chain.hpp103170644editdlrm
mutex.hpp86650644editdlrm
next_capacity.hpp21400644editdlrm
node_alloc_holder.hpp176510644editdlrm
node_pool.hpp48080644editdlrm
node_pool_impl.hpp131710644editdlrm
pair.hpp212810644editdlrm
pair_key_mapped_of_value.hpp14660644editdlrm
placement_new.hpp9140644editdlrm
pool_common.hpp16060644editdlrm
pool_common_alloc.hpp27300644editdlrm
pool_resource.hpp77440644editdlrm
singleton.hpp44650644editdlrm
std_fwd.hpp14500644editdlrm
thread_mutex.hpp44490644editdlrm
transform_iterator.hpp51030644editdlrm
tree.hpp570380644editdlrm
type_traits.hpp27140644editdlrm
value_functors.hpp11180644editdlrm
value_init.hpp11350644editdlrm
variadic_templates_tools.hpp49590644editdlrm
version_type.hpp24160644editdlrm
workaround.hpp45010644editdlrm
Edit: /usr/include/boost/container/detail/adaptive_node_pool.hpp (5569B)
////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2005-2013. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// #ifndef BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_HPP #define BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_HPP #ifndef BOOST_CONFIG_HPP # include #endif #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif #include #include #include #include #include #include #include #include #include #include #include #include namespace boost { namespace container { namespace dtl { //!Pooled memory allocator using an smart adaptive pool. Includes //!a reference count but the class does not delete itself, this is //!responsibility of user classes. Node size (NodeSize) and the number of //!nodes allocated per block (NodesPerBlock) are known at compile time. template< std::size_t NodeSize , std::size_t NodesPerBlock , std::size_t MaxFreeBlocks , std::size_t OverheadPercent > class private_adaptive_node_pool : public private_adaptive_node_pool_impl_ct < fake_segment_manager , MaxFreeBlocks , NodeSize , NodesPerBlock , OverheadPercent , unsigned(OverheadPercent == 0)*::boost::container::adaptive_pool_flag::align_only | ::boost::container::adaptive_pool_flag::size_ordered | ::boost::container::adaptive_pool_flag::address_ordered > { typedef private_adaptive_node_pool_impl_ct < fake_segment_manager , MaxFreeBlocks , NodeSize , NodesPerBlock , OverheadPercent , unsigned(OverheadPercent == 0)*::boost::container::adaptive_pool_flag::align_only | ::boost::container::adaptive_pool_flag::size_ordered | ::boost::container::adaptive_pool_flag::address_ordered > base_t; //Non-copyable private_adaptive_node_pool(const private_adaptive_node_pool &); private_adaptive_node_pool &operator=(const private_adaptive_node_pool &); public: static const std::size_t nodes_per_block = NodesPerBlock; //!Constructor. Never throws private_adaptive_node_pool() : base_t(0) {} }; //!Pooled memory allocator using adaptive pool. Includes //!a reference count but the class does not delete itself, this is //!responsibility of user classes. Node size (NodeSize) and the number of //!nodes allocated per block (NodesPerBlock) are known at compile time template< std::size_t NodeSize , std::size_t NodesPerBlock , std::size_t MaxFreeBlocks , std::size_t OverheadPercent > class shared_adaptive_node_pool : public private_adaptive_node_pool { private: typedef private_adaptive_node_pool private_node_allocator_t; public: typedef typename private_node_allocator_t::multiallocation_chain multiallocation_chain; //!Constructor. Never throws shared_adaptive_node_pool() : private_node_allocator_t(){} //!Destructor. Deallocates all allocated blocks. Never throws ~shared_adaptive_node_pool() {} //!Allocates array of count elements. Can throw std::bad_alloc void *allocate_node() { //----------------------- scoped_lock guard(mutex_); //----------------------- return private_node_allocator_t::allocate_node(); } //!Deallocates an array pointed by ptr. Never throws void deallocate_node(void *ptr) { //----------------------- scoped_lock guard(mutex_); //----------------------- private_node_allocator_t::deallocate_node(ptr); } //!Allocates a singly linked list of n nodes ending in null pointer. //!can throw std::bad_alloc void allocate_nodes(const std::size_t n, multiallocation_chain &chain) { //----------------------- scoped_lock guard(mutex_); //----------------------- return private_node_allocator_t::allocate_nodes(n, chain); } void deallocate_nodes(multiallocation_chain &chain) { //----------------------- scoped_lock guard(mutex_); //----------------------- private_node_allocator_t::deallocate_nodes(chain); } //!Deallocates all the free blocks of memory. Never throws void deallocate_free_blocks() { //----------------------- scoped_lock guard(mutex_); //----------------------- private_node_allocator_t::deallocate_free_blocks(); } private: default_mutex mutex_; }; } //namespace dtl { } //namespace container { } //namespace boost { #include #endif //#ifndef BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_HPP