1 //////////////////////////////////////////////////////////////////////////////
3 // Copyright (C) 2011-2013 Vicente J. Botet Escriba
5 // Distributed under the Boost Software License, Version 1.0. (See accompanying
6 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 // See http://www.boost.org/libs/thread for documentation.
10 //////////////////////////////////////////////////////////////////////////////
12 #ifndef BOOST_THREAD_DETAIL_MEMORY_HPP
13 #define BOOST_THREAD_DETAIL_MEMORY_HPP
15 #include <boost/config.hpp>
17 #include <boost/thread/csbl/memory/pointer_traits.hpp>
18 #include <boost/thread/csbl/memory/allocator_arg.hpp>
19 #include <boost/thread/csbl/memory/allocator_traits.hpp>
20 #include <boost/thread/csbl/memory/scoped_allocator.hpp>
24 namespace thread_detail
26 template <class _Alloc>
27 class allocator_destructor
29 typedef csbl::allocator_traits<_Alloc> alloc_traits;
31 typedef typename alloc_traits::pointer pointer;
32 typedef typename alloc_traits::size_type size_type;
37 allocator_destructor(_Alloc& a, size_type s)BOOST_NOEXCEPT
40 void operator()(pointer p)BOOST_NOEXCEPT
42 alloc_traits::destroy(alloc_, p);
43 alloc_traits::deallocate(alloc_, p, s_);
46 } //namespace thread_detail
48 #endif // BOOST_THREAD_DETAIL_MEMORY_HPP