/
usr
/
include
/
boost
/
container
/
detail
/
/usr/include/boost/container/detail
mkdir
upload
Name
Size
Mode
Actions
adaptive_node_pool.hpp
5569
0644
edit
dl
rm
adaptive_node_pool_impl.hpp
54088
0644
edit
dl
rm
addressof.hpp
1063
0644
edit
dl
rm
advanced_insert_int.hpp
17668
0644
edit
dl
rm
algorithm.hpp
3880
0644
edit
dl
rm
allocation_type.hpp
2017
0644
edit
dl
rm
allocator_version_traits.hpp
5632
0644
edit
dl
rm
alloc_helpers.hpp
1867
0644
edit
dl
rm
alloc_lib.h
11742
0644
edit
dl
rm
auto_link.hpp
1657
0644
edit
dl
rm
block_list.hpp
4199
0644
edit
dl
rm
block_slist.hpp
4503
0644
edit
dl
rm
compare_functors.hpp
3992
0644
edit
dl
rm
config_begin.hpp
3637
0644
edit
dl
rm
config_end.hpp
480
0644
edit
dl
rm
construct_in_place.hpp
2952
0644
edit
dl
rm
container_or_allocator_rebind.hpp
1743
0644
edit
dl
rm
container_rebind.hpp
6610
0644
edit
dl
rm
copy_move_algo.hpp
38531
0644
edit
dl
rm
destroyers.hpp
9338
0644
edit
dl
rm
dispatch_uses_allocator.hpp
19733
0644
edit
dl
rm
dlmalloc.hpp
3444
0644
edit
dl
rm
flat_tree.hpp
61663
0644
edit
dl
rm
function_detector.hpp
3558
0644
edit
dl
rm
is_container.hpp
2213
0644
edit
dl
rm
is_contiguous_container.hpp
1712
0644
edit
dl
rm
is_sorted.hpp
1465
0644
edit
dl
rm
iterator.hpp
2590
0644
edit
dl
rm
iterators.hpp
29882
0644
edit
dl
rm
iterator_to_raw_pointer.hpp
971
0644
edit
dl
rm
math_functions.hpp
3872
0644
edit
dl
rm
minimal_char_traits_header.hpp
1057
0644
edit
dl
rm
min_max.hpp
997
0644
edit
dl
rm
mpl.hpp
3834
0644
edit
dl
rm
multiallocation_chain.hpp
10317
0644
edit
dl
rm
mutex.hpp
8665
0644
edit
dl
rm
next_capacity.hpp
2140
0644
edit
dl
rm
node_alloc_holder.hpp
17651
0644
edit
dl
rm
node_pool.hpp
4808
0644
edit
dl
rm
node_pool_impl.hpp
13171
0644
edit
dl
rm
pair.hpp
21281
0644
edit
dl
rm
pair_key_mapped_of_value.hpp
1466
0644
edit
dl
rm
placement_new.hpp
914
0644
edit
dl
rm
pool_common.hpp
1606
0644
edit
dl
rm
pool_common_alloc.hpp
2730
0644
edit
dl
rm
pool_resource.hpp
7744
0644
edit
dl
rm
singleton.hpp
4465
0644
edit
dl
rm
std_fwd.hpp
1450
0644
edit
dl
rm
thread_mutex.hpp
4449
0644
edit
dl
rm
transform_iterator.hpp
5103
0644
edit
dl
rm
tree.hpp
57038
0644
edit
dl
rm
type_traits.hpp
2714
0644
edit
dl
rm
value_functors.hpp
1118
0644
edit
dl
rm
value_init.hpp
1135
0644
edit
dl
rm
variadic_templates_tools.hpp
4959
0644
edit
dl
rm
version_type.hpp
2416
0644
edit
dl
rm
workaround.hpp
4501
0644
edit
dl
rm
Edit:
/usr/include/boost/container/detail/allocator_version_traits.hpp
(5632B)
////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2012-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_ALLOCATOR_VERSION_TRAITS_HPP #define BOOST_CONTAINER_DETAIL_ALLOCATOR_VERSION_TRAITS_HPP #ifndef BOOST_CONFIG_HPP # include <boost/config.hpp> #endif #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif #include <boost/container/detail/config_begin.hpp> #include <boost/container/detail/workaround.hpp> #include <boost/container/allocator_traits.hpp> //allocator_traits #include <boost/container/throw_exception.hpp> #include <boost/container/detail/multiallocation_chain.hpp> //multiallocation_chain #include <boost/container/detail/version_type.hpp> //version_type #include <boost/container/detail/allocation_type.hpp> //allocation_type #include <boost/container/detail/mpl.hpp> //integral_constant #include <boost/intrusive/pointer_traits.hpp> //pointer_traits #include <boost/core/no_exceptions_support.hpp> //BOOST_TRY namespace boost { namespace container { namespace dtl { template<class Allocator, unsigned Version = boost::container::dtl::version<Allocator>::value> struct allocator_version_traits { typedef ::boost::container::dtl::integral_constant <unsigned, Version> alloc_version; typedef typename Allocator::multiallocation_chain multiallocation_chain; typedef typename boost::container::allocator_traits<Allocator>::pointer pointer; typedef typename boost::container::allocator_traits<Allocator>::size_type size_type; //Node allocation interface static pointer allocate_one(Allocator &a) { return a.allocate_one(); } static void deallocate_one(Allocator &a, const pointer &p) { a.deallocate_one(p); } static void allocate_individual(Allocator &a, size_type n, multiallocation_chain &m) { return a.allocate_individual(n, m); } static void deallocate_individual(Allocator &a, multiallocation_chain &holder) { a.deallocate_individual(holder); } static pointer allocation_command(Allocator &a, allocation_type command, size_type limit_size, size_type &prefer_in_recvd_out_size, pointer &reuse) { return a.allocation_command(command, limit_size, prefer_in_recvd_out_size, reuse); } }; template<class Allocator> struct allocator_version_traits<Allocator, 1> { typedef ::boost::container::dtl::integral_constant <unsigned, 1> alloc_version; typedef typename boost::container::allocator_traits<Allocator>::pointer pointer; typedef typename boost::container::allocator_traits<Allocator>::size_type size_type; typedef typename boost::container::allocator_traits<Allocator>::value_type value_type; typedef typename boost::intrusive::pointer_traits<pointer>:: template rebind_pointer<void>::type void_ptr; typedef dtl::basic_multiallocation_chain <void_ptr> multialloc_cached_counted; typedef boost::container::dtl:: transform_multiallocation_chain < multialloc_cached_counted, value_type> multiallocation_chain; //Node allocation interface static pointer allocate_one(Allocator &a) { return a.allocate(1); } static void deallocate_one(Allocator &a, const pointer &p) { a.deallocate(p, 1); } static void deallocate_individual(Allocator &a, multiallocation_chain &holder) { size_type n = holder.size(); typename multiallocation_chain::iterator it = holder.begin(); while(n){ --n; pointer p = boost::intrusive::pointer_traits<pointer>::pointer_to(*it); ++it; a.deallocate(p, 1); } } struct allocate_individual_rollback { allocate_individual_rollback(Allocator &a, multiallocation_chain &chain) : mr_a(a), mp_chain(&chain) {} ~allocate_individual_rollback() { if(mp_chain) allocator_version_traits::deallocate_individual(mr_a, *mp_chain); } void release() { mp_chain = 0; } Allocator &mr_a; multiallocation_chain * mp_chain; }; static void allocate_individual(Allocator &a, size_type n, multiallocation_chain &m) { allocate_individual_rollback rollback(a, m); while(n--){ m.push_front(a.allocate(1)); } rollback.release(); } static pointer allocation_command(Allocator &a, allocation_type command, size_type, size_type &prefer_in_recvd_out_size, pointer &reuse) { pointer ret = pointer(); if(BOOST_UNLIKELY(!(command & allocate_new) && !(command & nothrow_allocation))){ throw_logic_error("version 1 allocator without allocate_new flag"); } else{ BOOST_TRY{ ret = a.allocate(prefer_in_recvd_out_size); } BOOST_CATCH(...){ if(!(command & nothrow_allocation)){ BOOST_RETHROW } } BOOST_CATCH_END reuse = pointer(); } return ret; } }; } //namespace dtl { } //namespace container { } //namespace boost { #include <boost/container/detail/config_end.hpp> #endif // ! defined(BOOST_CONTAINER_DETAIL_ALLOCATOR_VERSION_TRAITS_HPP)
Save
cmd:
run