Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // Copyright (C) 2011-2013 Vicente J. Botet Escriba Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/thread for documentation. Chris@16: // Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: #ifndef BOOST_THREAD_DETAIL_MEMORY_HPP Chris@16: #define BOOST_THREAD_DETAIL_MEMORY_HPP Chris@16: Chris@16: #include Chris@101: Chris@101: #include Chris@101: #include Chris@101: #include Chris@101: #include Chris@16: Chris@16: namespace boost Chris@16: { Chris@16: namespace thread_detail Chris@16: { Chris@16: template Chris@16: class allocator_destructor Chris@16: { Chris@101: typedef csbl::allocator_traits<_Alloc> alloc_traits; Chris@16: public: Chris@16: typedef typename alloc_traits::pointer pointer; Chris@16: typedef typename alloc_traits::size_type size_type; Chris@16: private: Chris@16: _Alloc alloc_; Chris@16: size_type s_; Chris@16: public: Chris@16: allocator_destructor(_Alloc& a, size_type s)BOOST_NOEXCEPT Chris@16: : alloc_(a), s_(s) Chris@16: {} Chris@16: void operator()(pointer p)BOOST_NOEXCEPT Chris@16: { Chris@16: alloc_traits::destroy(alloc_, p); Chris@16: alloc_traits::deallocate(alloc_, p, s_); Chris@16: } Chris@16: }; Chris@16: } //namespace thread_detail Chris@101: } Chris@16: #endif // BOOST_THREAD_DETAIL_MEMORY_HPP