diff options
Diffstat (limited to 'boost/interprocess/managed_heap_memory.hpp')
-rw-r--r-- | boost/interprocess/managed_heap_memory.hpp | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/boost/interprocess/managed_heap_memory.hpp b/boost/interprocess/managed_heap_memory.hpp index 87107855f2..77ba56d75a 100644 --- a/boost/interprocess/managed_heap_memory.hpp +++ b/boost/interprocess/managed_heap_memory.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2005-2012. 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) // @@ -11,20 +11,20 @@ #ifndef BOOST_INTERPROCESS_MANAGED_HEAP_MEMORY_HPP #define BOOST_INTERPROCESS_MANAGED_HEAP_MEMORY_HPP -#if (defined _MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif #include <boost/interprocess/detail/config_begin.hpp> #include <boost/interprocess/detail/workaround.hpp> #include <boost/interprocess/creation_tags.hpp> -#include <boost/move/move.hpp> +#include <boost/move/utility_core.hpp> #include <vector> #include <boost/interprocess/detail/managed_memory_impl.hpp> #include <boost/detail/no_exceptions_support.hpp> //These includes needed to fulfill default template parameters of //predeclarations in interprocess_fwd.hpp -#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp> +#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp> #include <boost/interprocess/sync/mutex_family.hpp> #include <boost/interprocess/indexes/iset_index.hpp> @@ -46,13 +46,13 @@ template class basic_managed_heap_memory : public ipcdetail::basic_managed_memory_impl <CharType, AllocationAlgorithm, IndexType> { - /// @cond + #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) private: typedef ipcdetail::basic_managed_memory_impl <CharType, AllocationAlgorithm, IndexType> base_t; BOOST_MOVABLE_BUT_NOT_COPYABLE(basic_managed_heap_memory) - /// @endcond + #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED public: //functions typedef typename base_t::size_type size_type; @@ -99,7 +99,7 @@ class basic_managed_heap_memory //!have some extra bytes to allocate new objects. If returns //!false, the heap allocation has failed. bool grow(size_type extra_bytes) - { + { //If memory is reallocated, data will //be automatically copied BOOST_TRY{ @@ -125,19 +125,38 @@ class basic_managed_heap_memory m_heapmem.swap(other.m_heapmem); } - /// @cond + #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) private: //!Frees resources. Never throws. void priv_close() - { + { base_t::destroy_impl(); std::vector<char>().swap(m_heapmem); } std::vector<char> m_heapmem; - /// @endcond + #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED }; +#ifdef BOOST_INTERPROCESS_DOXYGEN_INVOKED + +//!Typedef for a default basic_managed_heap_memory +//!of narrow characters +typedef basic_managed_heap_memory + <char + ,rbtree_best_fit<null_mutex_family> + ,iset_index> +managed_heap_memory; + +//!Typedef for a default basic_managed_heap_memory +//!of wide characters +typedef basic_managed_heap_memory + <wchar_t + ,rbtree_best_fit<null_mutex_family> + ,iset_index> +wmanaged_heap_memory; + +#endif //#ifdef BOOST_INTERPROCESS_DOXYGEN_INVOKED } //namespace interprocess { } //namespace boost { |