File indexing completed on 2025-01-30 10:01:10
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_THREAD_DETAIL_MEMORY_HPP
0013 #define BOOST_THREAD_DETAIL_MEMORY_HPP
0014
0015 #include <boost/config.hpp>
0016
0017 #include <boost/thread/csbl/memory/pointer_traits.hpp>
0018 #include <boost/thread/csbl/memory/allocator_arg.hpp>
0019 #include <boost/thread/csbl/memory/allocator_traits.hpp>
0020 #include <boost/thread/csbl/memory/scoped_allocator.hpp>
0021
0022 namespace boost
0023 {
0024 namespace thread_detail
0025 {
0026 template <class _Alloc>
0027 class allocator_destructor
0028 {
0029 typedef csbl::allocator_traits<_Alloc> alloc_traits;
0030 public:
0031 typedef typename alloc_traits::pointer pointer;
0032 typedef typename alloc_traits::size_type size_type;
0033 private:
0034 _Alloc alloc_;
0035 size_type s_;
0036 public:
0037 allocator_destructor(_Alloc& a, size_type s)BOOST_NOEXCEPT
0038 : alloc_(a), s_(s)
0039 {}
0040 void operator()(pointer p)BOOST_NOEXCEPT
0041 {
0042 alloc_traits::destroy(alloc_, p);
0043 alloc_traits::deallocate(alloc_, p, s_);
0044 }
0045 };
0046 }
0047 }
0048 #endif