From a8b8eac741775c40524f409ebb6b0ec6efe34094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Wed, 7 Jan 2015 00:56:27 +0100 Subject: [PATCH] More dependency reduction: Reused Boost.Move/Boost.Intrusive/Boost.Container utilities, removed some standard headers. Removed some GCC warnings. --- doc/interprocess.qbk | 5 +- .../interprocess/allocators/adaptive_pool.hpp | 1 + .../allocators/node_allocator.hpp | 1 + .../allocators/private_adaptive_pool.hpp | 1 + .../allocators/private_node_allocator.hpp | 1 + .../containers/allocation_type.hpp | 2 +- .../boost/interprocess/detail/cast_tags.hpp | 12 +--- .../detail/in_place_interface.hpp | 4 +- .../detail/intermodule_singleton_common.hpp | 4 +- .../interprocess/detail/intersegment_ptr.hpp | 20 +++---- .../detail/managed_memory_impl.hpp | 2 +- .../detail/managed_multi_shared_memory.hpp | 2 +- .../detail/managed_open_or_create_impl.hpp | 6 +- .../boost/interprocess/detail/named_proxy.hpp | 8 +-- .../interprocess/detail/os_file_functions.hpp | 11 ++-- .../detail/segment_manager_helper.hpp | 56 +++++++++---------- include/boost/interprocess/detail/std_fwd.hpp | 11 ++++ .../detail/transform_iterator.hpp | 43 +++++++------- .../boost/interprocess/detail/utilities.hpp | 3 - .../boost/interprocess/detail/win32_api.hpp | 22 ++++++-- .../interprocess/indexes/flat_map_index.hpp | 7 ++- .../boost/interprocess/ipc/message_queue.hpp | 28 +++++----- .../interprocess/managed_heap_memory.hpp | 2 +- .../mem_algo/detail/mem_algo_common.hpp | 14 +++-- .../detail/multi_simple_seq_fit_impl.hpp | 36 ++++++------ .../mem_algo/detail/simple_seq_fit_impl.hpp | 10 ++-- .../interprocess/mem_algo/rbtree_best_fit.hpp | 40 ++++++------- include/boost/interprocess/offset_ptr.hpp | 24 ++++---- .../boost/interprocess/segment_manager.hpp | 2 +- .../smart_ptr/detail/shared_count.hpp | 2 +- .../smart_ptr/detail/sp_counted_impl.hpp | 1 + .../boost/interprocess/smart_ptr/weak_ptr.hpp | 2 +- test/allocator_v1.hpp | 1 - test/check_equal_containers.hpp | 6 +- test/emplace_test.hpp | 4 +- test/enable_shared_from_this_test.cpp | 2 +- test/expand_bwd_test_template.hpp | 12 ++-- test/intrusive_ptr_test.cpp | 2 +- test/map_test.hpp | 14 +++-- test/memory_algorithm_test.cpp | 4 +- test/memory_algorithm_test_template.hpp | 9 +-- test/message_queue_test.cpp | 5 +- test/named_allocation_test_template.hpp | 20 ++++--- test/named_construct_test.cpp | 3 +- test/shared_ptr_test.cpp | 2 +- test/string_test.cpp | 1 + test/user_buffer_test.cpp | 6 +- 47 files changed, 252 insertions(+), 222 deletions(-) diff --git a/doc/interprocess.qbk b/doc/interprocess.qbk index c7a9078..b519184 100644 --- a/doc/interprocess.qbk +++ b/doc/interprocess.qbk @@ -6364,8 +6364,7 @@ that boost::interprocess::rbtree_best_fit class offers: * The [*allocate()] function must return 0 if there is no more available memory. The memory returned by [*my_algorithm] - must be aligned to the most restrictive memory alignment of the system, for example, - to the value returned by *ipcdetail::alignment_of::value*. + must be aligned to the most restrictive memory alignment of the system. This function should be executed with the synchronization capabilities offered by `typename mutex_family::mutex_type` interprocess_mutex. That means, that if we define `typedef mutex_family mutex_family;` then this function should offer @@ -6734,7 +6733,7 @@ thank them: [section:release_notes Release Notes] [section:release_notes_boost_1_58_00 Boost 1.58 Release] -* Reduced some compile-tim dependencies. Updated to Boost.Container changes. +* Reduced some compile-time dependencies. Updated to Boost.Container changes. * Fixed bugs: * [@https://github.com/boostorg/interprocess/pull/13 GitHub Pull #13 (['"haiku: we don't have XSI shared memory, so don't try to use it"])]. diff --git a/include/boost/interprocess/allocators/adaptive_pool.hpp b/include/boost/interprocess/allocators/adaptive_pool.hpp index 07b0438..9761708 100644 --- a/include/boost/interprocess/allocators/adaptive_pool.hpp +++ b/include/boost/interprocess/allocators/adaptive_pool.hpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/interprocess/allocators/node_allocator.hpp b/include/boost/interprocess/allocators/node_allocator.hpp index d201deb..53b2ece 100644 --- a/include/boost/interprocess/allocators/node_allocator.hpp +++ b/include/boost/interprocess/allocators/node_allocator.hpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/interprocess/allocators/private_adaptive_pool.hpp b/include/boost/interprocess/allocators/private_adaptive_pool.hpp index 32c49a5..9902c5d 100644 --- a/include/boost/interprocess/allocators/private_adaptive_pool.hpp +++ b/include/boost/interprocess/allocators/private_adaptive_pool.hpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/interprocess/allocators/private_node_allocator.hpp b/include/boost/interprocess/allocators/private_node_allocator.hpp index e6d792e..c0b994e 100644 --- a/include/boost/interprocess/allocators/private_node_allocator.hpp +++ b/include/boost/interprocess/allocators/private_node_allocator.hpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/interprocess/containers/allocation_type.hpp b/include/boost/interprocess/containers/allocation_type.hpp index cae9612..7763b92 100644 --- a/include/boost/interprocess/containers/allocation_type.hpp +++ b/include/boost/interprocess/containers/allocation_type.hpp @@ -37,4 +37,4 @@ static const allocation_type zero_memory = boost::container::zero_memory; #include -#endif // #ifndef BOOST_INTERPROCESS_CONTAINERS_VERSION_TYPE_HPP +#endif // #ifndef BOOST_INTERPROCESS_CONTAINERS_ALLOCATION_TYPE_HPP diff --git a/include/boost/interprocess/detail/cast_tags.hpp b/include/boost/interprocess/detail/cast_tags.hpp index 0019af7..d62b077 100644 --- a/include/boost/interprocess/detail/cast_tags.hpp +++ b/include/boost/interprocess/detail/cast_tags.hpp @@ -8,16 +8,13 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTERPROCESS_CAST_TAGS_HPP -#define BOOST_INTERPROCESS_CAST_TAGS_HPP +#ifndef BOOST_INTERPROCESS_DETAIL_CAST_TAGS_HPP +#define BOOST_INTERPROCESS_DETAIL_CAST_TAGS_HPP #if defined(_MSC_VER) # pragma once #endif -#include -#include - namespace boost { namespace interprocess { namespace ipcdetail { struct static_cast_tag {}; @@ -27,7 +24,4 @@ struct reinterpret_cast_tag {}; }}} //namespace boost { namespace interprocess { namespace ipcdetail { -#include - -#endif //#ifndef BOOST_INTERPROCESS_CAST_TAGS_HPP - +#endif //#ifndef BOOST_INTERPROCESS_DETAIL_CAST_TAGS_HPP diff --git a/include/boost/interprocess/detail/in_place_interface.hpp b/include/boost/interprocess/detail/in_place_interface.hpp index 5af5a0d..9512808 100644 --- a/include/boost/interprocess/detail/in_place_interface.hpp +++ b/include/boost/interprocess/detail/in_place_interface.hpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include //alignment_of, aligned_storage #include //typeid //!\file @@ -47,7 +47,7 @@ template struct placement_destroy : public in_place_interface { placement_destroy() - : in_place_interface(::boost::alignment_of::value, sizeof(T), typeid(T).name()) + : in_place_interface(::boost::container::container_detail::alignment_of::value, sizeof(T), typeid(T).name()) {} virtual void destroy_n(void *mem, std::size_t num, std::size_t &destroyed) diff --git a/include/boost/interprocess/detail/intermodule_singleton_common.hpp b/include/boost/interprocess/detail/intermodule_singleton_common.hpp index 10c9ece..9524450 100644 --- a/include/boost/interprocess/detail/intermodule_singleton_common.hpp +++ b/include/boost/interprocess/detail/intermodule_singleton_common.hpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include //alignment_of, aligned_storage #include #include #include @@ -286,7 +286,7 @@ class intermodule_singleton_common static union mem_holder_t { unsigned char map_mem [sizeof(ThreadSafeGlobalMap)]; - ::boost::detail::max_align aligner; + ::boost::container::container_detail::max_align_t aligner; } mem_holder; }; diff --git a/include/boost/interprocess/detail/intersegment_ptr.hpp b/include/boost/interprocess/detail/intersegment_ptr.hpp index fa1b277..c24f7b7 100644 --- a/include/boost/interprocess/detail/intersegment_ptr.hpp +++ b/include/boost/interprocess/detail/intersegment_ptr.hpp @@ -17,26 +17,26 @@ #include #include - +// interprocess #include -#include -#include -#include -#include #include #include #include #include //vector #include //set -#include +// interprocess/detail +#include +#include +#include +#include #include -#include -#include +// other boost +#include #include //BOOST_STATIC_ASSERT -#include //CHAR_BIT #include #include //BOOST_ASSERT -#include +// std +#include //CHAR_BIT //!\file //! diff --git a/include/boost/interprocess/detail/managed_memory_impl.hpp b/include/boost/interprocess/detail/managed_memory_impl.hpp index 3a5c6fb..7b7aaba 100644 --- a/include/boost/interprocess/detail/managed_memory_impl.hpp +++ b/include/boost/interprocess/detail/managed_memory_impl.hpp @@ -26,7 +26,7 @@ #include #include // -#include +#include // #include #include diff --git a/include/boost/interprocess/detail/managed_multi_shared_memory.hpp b/include/boost/interprocess/detail/managed_multi_shared_memory.hpp index d8fdddd..0c21722 100644 --- a/include/boost/interprocess/detail/managed_multi_shared_memory.hpp +++ b/include/boost/interprocess/detail/managed_multi_shared_memory.hpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include diff --git a/include/boost/interprocess/detail/managed_open_or_create_impl.hpp b/include/boost/interprocess/detail/managed_open_or_create_impl.hpp index bd08be5..461821f 100644 --- a/include/boost/interprocess/detail/managed_open_or_create_impl.hpp +++ b/include/boost/interprocess/detail/managed_open_or_create_impl.hpp @@ -27,8 +27,7 @@ #include #include #include -#include -#include +#include //alignment_of, aligned_storage #include #include #include @@ -112,7 +111,8 @@ class managed_open_or_create_impl ct_rounded_size < sizeof(boost::uint32_t) , MemAlignment ? (MemAlignment) : - (::boost::alignment_of< ::boost::detail::max_align >::value) + (::boost::container::container_detail::alignment_of + < ::boost::container::container_detail::max_align_t >::value) >::value; managed_open_or_create_impl() diff --git a/include/boost/interprocess/detail/named_proxy.hpp b/include/boost/interprocess/detail/named_proxy.hpp index ee6668c..8928bfa 100644 --- a/include/boost/interprocess/detail/named_proxy.hpp +++ b/include/boost/interprocess/detail/named_proxy.hpp @@ -18,17 +18,17 @@ #include #include -#include -#include +// interprocess/detail #include #include - #ifndef BOOST_INTERPROCESS_PERFECT_FORWARDING #include #else #include #include #endif //#ifdef BOOST_INTERPROCESS_PERFECT_FORWARDING +// std +#include //for placement new //!\file //!Describes a proxy class that implements named allocation syntax. @@ -252,7 +252,7 @@ struct Ctor0Arg : public placement_destroy private: \ void construct(void *mem, true_) \ { \ - new((void*)mem) T \ + ::new((void*)mem) T \ (BOOST_PP_ENUM(n, BOOST_INTERPROCESS_PP_MEMBER_IT_FORWARD, _)); \ } \ \ diff --git a/include/boost/interprocess/detail/os_file_functions.hpp b/include/boost/interprocess/detail/os_file_functions.hpp index ff25b41..aa7f0fc 100644 --- a/include/boost/interprocess/detail/os_file_functions.hpp +++ b/include/boost/interprocess/detail/os_file_functions.hpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include //make_unsigned #if defined (BOOST_INTERPROCESS_WINDOWS) # include @@ -53,7 +53,7 @@ namespace interprocess { #if defined (BOOST_INTERPROCESS_WINDOWS) typedef void * file_handle_t; -typedef ::boost::long_long_type offset_t; +typedef __int64 offset_t; typedef struct mapping_handle_impl_t{ void * handle; bool is_shm; @@ -150,10 +150,11 @@ inline bool truncate_file (file_handle_t hnd, std::size_t size) if(!winapi::get_file_size(hnd, filesize)) return false; - typedef boost::make_unsigned::type uoffset_t; + typedef ::boost::move_detail::make_unsigned::type uoffset_t; const uoffset_t max_filesize = uoffset_t((std::numeric_limits::max)()); + const uoffset_t uoff_size = uoffset_t(size); //Avoid unused variable warnings in 32 bit systems - if(uoffset_t(size) > max_filesize){ + if(uoff_size > max_filesize){ winapi::set_last_error(winapi::error_file_too_large); return false; } @@ -476,7 +477,7 @@ inline bool delete_file(const char *name) inline bool truncate_file (file_handle_t hnd, std::size_t size) { - typedef boost::make_unsigned::type uoff_t; + typedef boost::move_detail::make_unsigned::type uoff_t; if(uoff_t((std::numeric_limits::max)()) < size){ errno = EINVAL; return false; diff --git a/include/boost/interprocess/detail/segment_manager_helper.hpp b/include/boost/interprocess/detail/segment_manager_helper.hpp index 2b191a7..07ef231 100644 --- a/include/boost/interprocess/detail/segment_manager_helper.hpp +++ b/include/boost/interprocess/detail/segment_manager_helper.hpp @@ -18,24 +18,24 @@ #include #include -#include - -#include +// interprocess +#include +// interprocess/detail #include #include #include -#include -#include -#include -#include +// container/detail +#include //alignment_of #include -#include //std::size_t -#include //std::nothrow -#include //std::iterator_traits +// intrusive +#include +// move/detail +#include //make_unsigned +// other boost #include //BOOST_ASSERT -#ifndef BOOST_NO_EXCEPTIONS -#include -#endif +#include +// std +#include //std::size_t //!\file //!Describes the object placed in a memory segment that provides @@ -113,7 +113,7 @@ struct block_header { return get_rounded_size ( size_type(sizeof(Header)) - , size_type(::boost::alignment_of >::value)) + , size_type(::boost::container::container_detail::alignment_of >::value)) + total_size(); } @@ -153,21 +153,19 @@ struct block_header { return m_num_char < b.m_num_char || (m_num_char < b.m_num_char && - std::char_traits::compare - (name(), b.name(), m_num_char) < 0); + std::char_traits::compare(name(), b.name(), m_num_char) < 0); } template bool equal_comp(const block_header &b) const { return m_num_char == b.m_num_char && - std::char_traits::compare - (name(), b.name(), m_num_char) == 0; + std::char_traits::compare(name(), b.name(), m_num_char) == 0; } template static block_header *block_header_from_value(T *value) - { return block_header_from_value(value, sizeof(T), ::boost::alignment_of::value); } + { return block_header_from_value(value, sizeof(T), ::boost::container::container_detail::alignment_of::value); } static block_header *block_header_from_value(const void *value, std::size_t sz, std::size_t algn) { @@ -187,7 +185,8 @@ struct block_header { block_header * hdr = reinterpret_cast*>(reinterpret_cast(header) + - get_rounded_size(size_type(sizeof(Header)), size_type(::boost::alignment_of >::value))); + get_rounded_size( size_type(sizeof(Header)) + , size_type(::boost::container::container_detail::alignment_of >::value))); //Some sanity checks return hdr; } @@ -197,7 +196,8 @@ struct block_header { Header * hdr = reinterpret_cast(reinterpret_cast(bheader) - - get_rounded_size(size_type(sizeof(Header)), size_type(::boost::alignment_of >::value))); + get_rounded_size( size_type(sizeof(Header)) + , size_type(::boost::container::container_detail::alignment_of >::value))); //Some sanity checks return hdr; } @@ -271,7 +271,7 @@ struct intrusive_value_type_impl intrusive_value_type_impl(){} - enum { BlockHdrAlignment = ::boost::alignment_of >::value }; + enum { BlockHdrAlignment = ::boost::container::container_detail::alignment_of >::value }; block_header *get_block_header() const { @@ -344,7 +344,7 @@ struct index_key rebind_pointer::type const_char_ptr_t; typedef CharT char_type; typedef typename boost::intrusive::pointer_traits::difference_type difference_type; - typedef typename boost::make_unsigned::type size_type; + typedef typename boost::move_detail::make_unsigned::type size_type; private: //Offset pointer to the object's name @@ -363,9 +363,8 @@ struct index_key { return (m_len < right.m_len) || (m_len == right.m_len && - std::char_traits::compare - (to_raw_pointer(mp_str) - ,to_raw_pointer(right.mp_str), m_len) < 0); + std::char_traits::compare + (to_raw_pointer(mp_str),to_raw_pointer(right.mp_str), m_len) < 0); } //!Equal to function for index ordering @@ -373,8 +372,7 @@ struct index_key { return m_len == right.m_len && std::char_traits::compare - (to_raw_pointer(mp_str), - to_raw_pointer(right.mp_str), m_len) == 0; + (to_raw_pointer(mp_str), to_raw_pointer(right.mp_str), m_len) == 0; } void name(const CharT *nm) @@ -482,7 +480,7 @@ struct segment_manager_iterator_transform { typedef segment_manager_iterator_value_adaptor result_type; - result_type operator()(const typename std::iterator_traits::value_type &arg) const + template result_type operator()(const T &arg) const { return result_type(arg); } }; diff --git a/include/boost/interprocess/detail/std_fwd.hpp b/include/boost/interprocess/detail/std_fwd.hpp index b162efb..346c5db 100644 --- a/include/boost/interprocess/detail/std_fwd.hpp +++ b/include/boost/interprocess/detail/std_fwd.hpp @@ -31,11 +31,22 @@ BOOST_INTERPROCESS_STD_NS_BEG +struct input_iterator_tag; +struct forward_iterator_tag; +struct bidirectional_iterator_tag; +struct random_access_iterator_tag; + template struct char_traits; struct nothrow_t; +template +class basic_ostream; + +template +class basic_istream; + BOOST_INTERPROCESS_STD_NS_END #ifdef BOOST_INTERPROCESS_CLANG_INLINE_STD_NS diff --git a/include/boost/interprocess/detail/transform_iterator.hpp b/include/boost/interprocess/detail/transform_iterator.hpp index 5496d19..677ec2f 100644 --- a/include/boost/interprocess/detail/transform_iterator.hpp +++ b/include/boost/interprocess/detail/transform_iterator.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2005-2012. +// (C) Copyright Ion Gaztanaga 2005-2015. // (C) Copyright Gennaro Prota 2003 - 2004. // // Distributed under the Boost Software License, Version 1.0. @@ -21,10 +21,12 @@ #include #include +// interprocess #include - -#include +// interprocess/detail #include +// move/detail +#include namespace boost { namespace interprocess { @@ -60,14 +62,14 @@ struct operator_arrow_proxy template class transform_iterator : public UnaryFunction - , public std::iterator - < typename std::iterator_traits::iterator_category - , typename ipcdetail::remove_reference::type - , typename std::iterator_traits::difference_type - , operator_arrow_proxy - , typename UnaryFunction::result_type> { public: + typedef typename ::boost::container::iterator_traits::iterator_category iterator_category; + typedef typename ipcdetail::remove_reference::type value_type; + typedef typename ::boost::container::iterator_traits::difference_type difference_type; + typedef operator_arrow_proxy pointer; + typedef typename UnaryFunction::result_type reference; + explicit transform_iterator(const Iterator &it, const UnaryFunction &f = UnaryFunction()) : UnaryFunction(f), m_it(it) {} @@ -115,33 +117,33 @@ class transform_iterator friend bool operator>= (const transform_iterator& i, const transform_iterator& i2) { return !(i < i2); } - friend typename std::iterator_traits::difference_type operator- (const transform_iterator& i, const transform_iterator& i2) + friend difference_type operator- (const transform_iterator& i, const transform_iterator& i2) { return i2.distance_to(i); } //Arithmetic - transform_iterator& operator+=(typename std::iterator_traits::difference_type off) + transform_iterator& operator+=(difference_type off) { this->advance(off); return *this; } - transform_iterator operator+(typename std::iterator_traits::difference_type off) const + transform_iterator operator+(difference_type off) const { transform_iterator other(*this); other.advance(off); return other; } - friend transform_iterator operator+(typename std::iterator_traits::difference_type off, const transform_iterator& right) + friend transform_iterator operator+(difference_type off, const transform_iterator& right) { return right + off; } - transform_iterator& operator-=(typename std::iterator_traits::difference_type off) + transform_iterator& operator-=(difference_type off) { this->advance(-off); return *this; } - transform_iterator operator-(typename std::iterator_traits::difference_type off) const + transform_iterator operator-(difference_type off) const { return *this + (-off); } typename UnaryFunction::result_type operator*() const { return dereference(); } - typename UnaryFunction::result_type operator[](typename std::iterator_traits::difference_type off) const + typename UnaryFunction::result_type operator[](difference_type off) const { return UnaryFunction::operator()(m_it[off]); } operator_arrow_proxy @@ -172,11 +174,11 @@ class transform_iterator typename UnaryFunction::result_type dereference() const { return UnaryFunction::operator()(*m_it); } - void advance(typename std::iterator_traits::difference_type n) - { std::advance(m_it, n); } + void advance(difference_type n) + { ::boost::container::iterator_advance(m_it, n); } - typename std::iterator_traits::difference_type distance_to(const transform_iterator &other)const - { return std::distance(other.m_it, m_it); } + difference_type distance_to(const transform_iterator &other)const + { return ::boost::container::iterator_distance(other.m_it, m_it); } }; template @@ -192,4 +194,3 @@ make_transform_iterator(Iterator it, UnaryFunc fun) #include #endif //#ifndef BOOST_INTERPROCESS_DETAIL_TRANSFORM_ITERATORS_HPP - diff --git a/include/boost/interprocess/detail/utilities.hpp b/include/boost/interprocess/detail/utilities.hpp index 25a6b62..a62e6b1 100644 --- a/include/boost/interprocess/detail/utilities.hpp +++ b/include/boost/interprocess/detail/utilities.hpp @@ -23,12 +23,9 @@ #include #include -#include #include #include -#include #include -#include #include #include #include diff --git a/include/boost/interprocess/detail/win32_api.hpp b/include/boost/interprocess/detail/win32_api.hpp index f88c4bf..2e37d8b 100644 --- a/include/boost/interprocess/detail/win32_api.hpp +++ b/include/boost/interprocess/detail/win32_api.hpp @@ -56,6 +56,12 @@ // ////////////////////////////////////////////////////////////////////////////// +//Ignore -pedantic errors here (anonymous structs, etc.) +#if defined(BOOST_GCC) && (BOOST_GCC >= 040600) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-pedantic" +#endif + namespace boost { namespace interprocess { namespace winapi { @@ -94,7 +100,7 @@ struct decimal unsigned long Lo32; unsigned long Mid32; }; - unsigned __int64 Lo64; + ::boost::ulong_long_type Lo64; }; }; @@ -739,8 +745,8 @@ union system_timeofday_information __int64 liExpTimeZoneBias; unsigned long uCurrentTimeZoneId; unsigned long dwReserved; - unsigned __int64 ullBootTimeBias; - unsigned __int64 ullSleepTimeBias; + ::boost::ulong_long_type ullBootTimeBias; + ::boost::ulong_long_type ullSleepTimeBias; } data; unsigned char Reserved1[sizeof(data_t)]; }; @@ -1313,7 +1319,7 @@ class interprocess_all_access_security { return &sa; } }; -inline void * create_file_mapping (void * handle, unsigned long access, unsigned __int64 file_offset, const char * name, interprocess_security_attributes *psec) +inline void * create_file_mapping (void * handle, unsigned long access, ::boost::ulong_long_type file_offset, const char * name, interprocess_security_attributes *psec) { const unsigned long high_size(file_offset >> 32), low_size((boost::uint32_t)file_offset); return CreateFileMappingA (handle, psec, access, high_size, low_size, name); @@ -1322,9 +1328,9 @@ inline void * create_file_mapping (void * handle, unsigned long access, unsigned inline void * open_file_mapping (unsigned long access, const char *name) { return OpenFileMappingA (access, 0, name); } -inline void *map_view_of_file_ex(void *handle, unsigned long file_access, unsigned __int64 offset, std::size_t numbytes, void *base_addr) +inline void *map_view_of_file_ex(void *handle, unsigned long file_access, ::boost::ulong_long_type offset, std::size_t numbytes, void *base_addr) { - const unsigned long offset_low = (unsigned long)(offset & ((unsigned __int64)0xFFFFFFFF)); + const unsigned long offset_low = (unsigned long)(offset & ((::boost::ulong_long_type)0xFFFFFFFF)); const unsigned long offset_high = offset >> 32; return MapViewOfFileEx(handle, file_access, offset_high, offset_low, numbytes, base_addr); } @@ -2331,6 +2337,10 @@ inline unsigned long get_tick_count() } //namespace interprocess } //namespace boost +#if defined(BOOST_GCC) && (BOOST_GCC >= 040600) +# pragma GCC diagnostic pop +#endif + #include #endif //#ifdef BOOST_INTERPROCESS_WIN32_API_HPP diff --git a/include/boost/interprocess/indexes/flat_map_index.hpp b/include/boost/interprocess/indexes/flat_map_index.hpp index 7a5beef..7ac46db 100644 --- a/include/boost/interprocess/indexes/flat_map_index.hpp +++ b/include/boost/interprocess/indexes/flat_map_index.hpp @@ -17,12 +17,13 @@ #include #include -#include +// interprocess #include #include +// intrusive/detail +#include //std::pair +#include //std::less -#include //std::less -#include //std::pair //!\file //!Describes index adaptor of boost::map container, to use it diff --git a/include/boost/interprocess/ipc/message_queue.hpp b/include/boost/interprocess/ipc/message_queue.hpp index 0929058..39951e4 100644 --- a/include/boost/interprocess/ipc/message_queue.hpp +++ b/include/boost/interprocess/ipc/message_queue.hpp @@ -28,11 +28,10 @@ #include #include #include -#include +#include #include #include -#include -#include +#include //make_unsigned, alignment_of #include #include #include //std::lower_bound @@ -71,7 +70,7 @@ class message_queue_t pointer_traits::template rebind_pointer::type char_ptr; typedef typename boost::intrusive::pointer_traits::difference_type difference_type; - typedef typename boost::make_unsigned::type size_type; + typedef typename boost::container::container_detail::make_unsigned::type size_type; //!Creates a process shared message queue with name "name". For this message queue, //!the maximum number of messages will be "max_num_msg" and the maximum message size @@ -208,7 +207,7 @@ class msg_hdr_t pointer_traits::template rebind_pointer::type char_ptr; typedef typename boost::intrusive::pointer_traits::difference_type difference_type; - typedef typename boost::make_unsigned::type size_type; + typedef typename boost::container::container_detail::make_unsigned::type size_type; public: size_type len; // Message length @@ -293,7 +292,8 @@ class mq_hdr_t rebind_pointer::type msg_hdr_ptr_t; typedef typename boost::intrusive::pointer_traits ::difference_type difference_type; - typedef typename boost::make_unsigned::type size_type; + typedef typename boost::container:: + container_detail::make_unsigned::type size_type; typedef typename boost::intrusive:: pointer_traits::template rebind_pointer::type msg_hdr_ptr_ptr_t; @@ -525,8 +525,8 @@ class mq_hdr_t (size_type max_msg_size, size_type max_num_msg) { const size_type - msg_hdr_align = ::boost::alignment_of::value, - index_align = ::boost::alignment_of::value, + msg_hdr_align = ::boost::container::container_detail::alignment_of::value, + index_align = ::boost::container::container_detail::alignment_of::value, r_hdr_size = ipcdetail::ct_rounded_size::value, r_index_size = ipcdetail::get_rounded_size(max_num_msg*sizeof(msg_hdr_ptr_t), msg_hdr_align), r_max_msg_size = ipcdetail::get_rounded_size(max_msg_size, msg_hdr_align) + sizeof(msg_header); @@ -539,8 +539,8 @@ class mq_hdr_t void initialize_memory() { const size_type - msg_hdr_align = ::boost::alignment_of::value, - index_align = ::boost::alignment_of::value, + msg_hdr_align = ::boost::container::container_detail::alignment_of::value, + index_align = ::boost::container::container_detail::alignment_of::value, r_hdr_size = ipcdetail::ct_rounded_size::value, r_index_size = ipcdetail::get_rounded_size(m_max_num_msg*sizeof(msg_hdr_ptr_t), msg_hdr_align), r_max_msg_size = ipcdetail::get_rounded_size(m_max_msg_size, msg_hdr_align) + sizeof(msg_header); @@ -596,9 +596,11 @@ class msg_queue_initialization_func_t public: typedef typename boost::intrusive:: pointer_traits::template - rebind_pointer::type char_ptr; - typedef typename boost::intrusive::pointer_traits::difference_type difference_type; - typedef typename boost::make_unsigned::type size_type; + rebind_pointer::type char_ptr; + typedef typename boost::intrusive::pointer_traits:: + difference_type difference_type; + typedef typename boost::container::container_detail:: + make_unsigned::type size_type; msg_queue_initialization_func_t(size_type maxmsg = 0, size_type maxmsgsize = 0) diff --git a/include/boost/interprocess/managed_heap_memory.hpp b/include/boost/interprocess/managed_heap_memory.hpp index 77ba56d..0d5e6a5 100644 --- a/include/boost/interprocess/managed_heap_memory.hpp +++ b/include/boost/interprocess/managed_heap_memory.hpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include //These includes needed to fulfill default template parameters of //predeclarations in interprocess_fwd.hpp #include diff --git a/include/boost/interprocess/mem_algo/detail/mem_algo_common.hpp b/include/boost/interprocess/mem_algo/detail/mem_algo_common.hpp index 70806f5..f2b0718 100644 --- a/include/boost/interprocess/mem_algo/detail/mem_algo_common.hpp +++ b/include/boost/interprocess/mem_algo/detail/mem_algo_common.hpp @@ -18,18 +18,20 @@ #include #include +// interprocess #include #include -#include -#include +// interprocess/detail #include -#include -#include #include +#include +#include +// container/detail #include -#include +// move +#include +// other boost #include -#include #include //!\file diff --git a/include/boost/interprocess/mem_algo/detail/multi_simple_seq_fit_impl.hpp b/include/boost/interprocess/mem_algo/detail/multi_simple_seq_fit_impl.hpp index c84d4e6..37e1d00 100644 --- a/include/boost/interprocess/mem_algo/detail/multi_simple_seq_fit_impl.hpp +++ b/include/boost/interprocess/mem_algo/detail/multi_simple_seq_fit_impl.hpp @@ -27,8 +27,7 @@ #include #include #include -#include -#include +#include //make_unsigned, alignment_of #include #include #include @@ -70,7 +69,7 @@ class simple_seq_fit_impl typedef VoidPointer void_pointer; typedef typename boost::intrusive::pointer_traits::difference_type difference_type; - typedef typename boost::make_unsigned::type size_type; + typedef typename boost::container::container_detail::make_unsigned::type size_type; private: @@ -157,10 +156,9 @@ class simple_seq_fit_impl //!This function is normally used for security reasons. void clear_free_memory(); - std::pair - allocation_command (boost::interprocess::allocation_type command, size_type limit_size, + void * allocation_command (boost::interprocess::allocation_type command, size_type limit_size, size_type preferred_size,size_type &received_size, - void *reuse_ptr = 0, size_type backwards_multiple = 1); + void *&reuse_ptr, size_type backwards_multiple = 1); /*!Returns the size of the buffer previously allocated pointed by ptr*/ size_type size(void *ptr) const; @@ -224,7 +222,7 @@ class simple_seq_fit_impl /*!Makes a new memory portion available for allocation*/ void priv_add_segment(void *addr, size_type size); - static const std::size_t Alignment = ::boost::alignment_of::value; + static const std::size_t Alignment = ::boost::container::container_detail::alignment_of::value; static const std::size_t BlockCtrlBytes = ipcdetail::ct_rounded_size::value; static const std::size_t BlockCtrlSize = BlockCtrlBytes/Alignment; static const std::size_t MinBlockSize = BlockCtrlSize + Alignment; @@ -400,18 +398,19 @@ inline void* simple_seq_fit_impl:: } template -inline std::pair simple_seq_fit_impl:: +inline void *simple_seq_fit_impl:: allocation_command (boost::interprocess::allocation_type command, size_type min_size, size_type preferred_size,size_type &received_size, - void *reuse_ptr, size_type backwards_multiple) + void *&reuse_ptr, size_type backwards_multiple) { //----------------------- boost::interprocess::scoped_lock guard(m_header); //----------------------- (void)backwards_multiple; command &= ~boost::interprocess::expand_bwd; - if(!command) - return std::pair(0, false); + if(!command){ + return reuse_ptr = 0, 0; + } return priv_allocate(command, min_size, preferred_size, received_size, reuse_ptr); } @@ -545,23 +544,22 @@ void* simple_seq_fit_impl:: } template -std::pair simple_seq_fit_impl:: +void * simple_seq_fit_impl:: priv_allocate(boost::interprocess::allocation_type command ,size_type limit_size ,size_type preferred_size ,size_type &received_size - ,void *reuse_ptr) + ,void *&reuse_ptr) { if(command & boost::interprocess::shrink_in_place){ bool success = this->priv_shrink(reuse_ptr, limit_size, preferred_size, received_size); - return std::pair ((success ? reuse_ptr : 0), true); + return success ? reuse_ptr : 0; } - typedef std::pair return_type; received_size = 0; if(limit_size > preferred_size) - return return_type(0, false); + return reuse_ptr = 0, 0; //Number of units to request (including block_ctrl header) size_type nunits = ipcdetail::get_rounded_size(preferred_size, Alignment)/Alignment + BlockCtrlSize; @@ -581,7 +579,7 @@ std::pair simple_seq_fit_impl:: void *ret = priv_expand_both_sides (command, limit_size, preferred_size, received_size, reuse_ptr, true); if(ret) - return return_type(ret, true); + return ret; } if(command & boost::interprocess::allocate_new){ @@ -608,7 +606,7 @@ std::pair simple_seq_fit_impl:: void *ret = this->priv_check_and_allocate (nunits, prev_biggest_block, biggest_block, received_size); if(ret) - return return_type(ret, false); + return reuse_ptr = 0, ret; } } //Now try to expand both sides with min size @@ -616,7 +614,7 @@ std::pair simple_seq_fit_impl:: return return_type(priv_expand_both_sides (command, limit_size, preferred_size, received_size, reuse_ptr, false), true); } - return return_type(0, false); + return reuse_ptr = 0, 0; } template diff --git a/include/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp b/include/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp index 32ecdc7..a997b3d 100644 --- a/include/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp +++ b/include/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp @@ -32,8 +32,7 @@ #include #include #include -#include -#include +#include //make_unsigned, alignment_of #include #include #include @@ -74,7 +73,7 @@ class simple_seq_fit_impl basic_multiallocation_chain multiallocation_chain; typedef typename boost::intrusive::pointer_traits::difference_type difference_type; - typedef typename boost::make_unsigned::type size_type; + typedef typename boost::container::container_detail::make_unsigned::type size_type; private: @@ -268,7 +267,8 @@ class simple_seq_fit_impl void priv_mark_new_allocated_block(block_ctrl *block); public: - static const size_type Alignment = ::boost::alignment_of< ::boost::detail::max_align>::value; + static const size_type Alignment = ::boost::container::container_detail::alignment_of + < ::boost::container::container_detail::max_align_t>::value; private: static const size_type BlockCtrlBytes = ipcdetail::ct_rounded_size::value; static const size_type BlockCtrlUnits = BlockCtrlBytes/Alignment; @@ -587,7 +587,7 @@ inline T* simple_seq_fit_impl:: void *raw_reuse = reuse_ptr; void * const ret = priv_allocation_command (command, limit_size, prefer_in_recvd_out_size, raw_reuse, sizeof(T)); - BOOST_ASSERT(0 == ((std::size_t)ret % ::boost::alignment_of::value)); + BOOST_ASSERT(0 == ((std::size_t)ret % ::boost::container::container_detail::alignment_of::value)); reuse_ptr = static_cast(raw_reuse); return static_cast(ret); } diff --git a/include/boost/interprocess/mem_algo/rbtree_best_fit.hpp b/include/boost/interprocess/mem_algo/rbtree_best_fit.hpp index d181fd0..46cf621 100644 --- a/include/boost/interprocess/mem_algo/rbtree_best_fit.hpp +++ b/include/boost/interprocess/mem_algo/rbtree_best_fit.hpp @@ -18,33 +18,32 @@ #include #include -#include - +// interprocess +#include +#include #include #include -#include -#include #include -#include -#include +#include +// interprocess/detail #include #include #include -#include -#include -#include -#include +#include +// container +#include +// move/detail +#include //make_unsigned, alignment_of +// intrusive #include +#include +// other boost #include #include +// std #include #include -#include - -#include -#include - -#include +#include //placement new //#define BOOST_INTERPROCESS_RBTREE_BEST_FIT_ABI_V1_HPP //to maintain ABI compatible with the original version @@ -90,7 +89,7 @@ class rbtree_best_fit typedef ipcdetail::basic_multiallocation_chain multiallocation_chain; typedef typename boost::intrusive::pointer_traits::difference_type difference_type; - typedef typename boost::make_unsigned::type size_type; + typedef typename boost::container::container_detail::make_unsigned::type size_type; #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) @@ -327,7 +326,8 @@ class rbtree_best_fit public: static const size_type Alignment = !MemAlignment - ? size_type(::boost::alignment_of< ::boost::detail::max_align>::value) + ? size_type(::boost::container::container_detail::alignment_of + < ::boost::container::container_detail::max_align_t>::value) : size_type(MemAlignment) ; @@ -335,7 +335,7 @@ class rbtree_best_fit //Due to embedded bits in size, Alignment must be at least 4 BOOST_STATIC_ASSERT((Alignment >= 4)); //Due to rbtree size optimizations, Alignment must have at least pointer alignment - BOOST_STATIC_ASSERT((Alignment >= ::boost::alignment_of::value)); + BOOST_STATIC_ASSERT((Alignment >= ::boost::container::container_detail::alignment_of::value)); static const size_type AlignmentMask = (Alignment - 1); static const size_type BlockCtrlBytes = ipcdetail::ct_rounded_size::value; static const size_type BlockCtrlUnits = BlockCtrlBytes/Alignment; @@ -687,7 +687,7 @@ inline T* rbtree_best_fit:: void* raw_reuse = reuse; void* const ret = priv_allocation_command(command, limit_size, prefer_in_recvd_out_size, raw_reuse, sizeof(T)); reuse = static_cast(raw_reuse); - BOOST_ASSERT(0 == ((std::size_t)ret % ::boost::alignment_of::value)); + BOOST_ASSERT(0 == ((std::size_t)ret % ::boost::container::container_detail::alignment_of::value)); return static_cast(ret); } diff --git a/include/boost/interprocess/offset_ptr.hpp b/include/boost/interprocess/offset_ptr.hpp index 5f523ce..aeb068c 100644 --- a/include/boost/interprocess/offset_ptr.hpp +++ b/include/boost/interprocess/offset_ptr.hpp @@ -22,13 +22,9 @@ #include #include #include +#include //alignment_of, aligned_storage #include -#include -#include -#include -#include -#include -#include +#include //!\file //!Describes a smart pointer that stores the offset between this pointer and @@ -39,9 +35,6 @@ namespace boost { #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) //Predeclarations -template -struct has_trivial_constructor; - template struct has_trivial_destructor; @@ -59,10 +52,10 @@ namespace ipcdetail { : m_offset(off) {} OffsetType m_offset; //Distance between this object and pointee address - typename ::boost::aligned_storage + typename ::boost::container::container_detail::aligned_storage < sizeof(OffsetType) , (OffsetAlignment == offset_type_alignment) ? - ::boost::alignment_of::value : OffsetAlignment + ::boost::container::container_detail::alignment_of::value : OffsetAlignment >::type alignment_helper; }; @@ -642,20 +635,23 @@ inline boost::interprocess::offset_ptr #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) -//!has_trivial_constructor<> == true_type specialization for optimizations +///has_trivial_destructor<> == true_type specialization for optimizations template -struct has_trivial_constructor< boost::interprocess::offset_ptr > +struct has_trivial_destructor< ::boost::interprocess::offset_ptr > { static const bool value = true; }; +namespace move_detail { + ///has_trivial_destructor<> == true_type specialization for optimizations template -struct has_trivial_destructor< boost::interprocess::offset_ptr > +struct is_trivially_destructible< ::boost::interprocess::offset_ptr > { static const bool value = true; }; +} //namespace move_detail { namespace interprocess { diff --git a/include/boost/interprocess/segment_manager.hpp b/include/boost/interprocess/segment_manager.hpp index c125f92..3c13746 100644 --- a/include/boost/interprocess/segment_manager.hpp +++ b/include/boost/interprocess/segment_manager.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include diff --git a/include/boost/interprocess/smart_ptr/detail/shared_count.hpp b/include/boost/interprocess/smart_ptr/detail/shared_count.hpp index a2eeac4..d20de9b 100644 --- a/include/boost/interprocess/smart_ptr/detail/shared_count.hpp +++ b/include/boost/interprocess/smart_ptr/detail/shared_count.hpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include //std::less diff --git a/include/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp b/include/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp index 3e01be5..5d66a6b 100644 --- a/include/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp +++ b/include/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp @@ -23,6 +23,7 @@ #include #include +#include #include #include #include diff --git a/include/boost/interprocess/smart_ptr/weak_ptr.hpp b/include/boost/interprocess/smart_ptr/weak_ptr.hpp index 1ffa7f8..0dc373d 100644 --- a/include/boost/interprocess/smart_ptr/weak_ptr.hpp +++ b/include/boost/interprocess/smart_ptr/weak_ptr.hpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/allocator_v1.hpp b/test/allocator_v1.hpp index 65a55ac..d68ef9f 100644 --- a/test/allocator_v1.hpp +++ b/test/allocator_v1.hpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include diff --git a/test/check_equal_containers.hpp b/test/check_equal_containers.hpp index 2ad82f1..80fe93f 100644 --- a/test/check_equal_containers.hpp +++ b/test/check_equal_containers.hpp @@ -12,7 +12,8 @@ #define BOOST_INTERPROCESS_TEST_CHECK_EQUAL_CONTAINERS_HPP #include -#include +// container/detail +#include #include namespace boost{ @@ -48,7 +49,8 @@ bool CheckEqualContainers(MyShmCont *shmcont, MyStdCont *stdcont) typename MyShmCont::iterator itshm(shmcont->begin()), itshmend(shmcont->end()); typename MyStdCont::iterator itstd(stdcont->begin()); - typename MyStdCont::size_type dist = (typename MyStdCont::size_type)std::distance(itshm, itshmend); + typename MyStdCont::size_type dist = + typename MyStdCont::size_type(boost::container::iterator_distance(itshm, itshmend)); if(dist != shmcont->size()){ return false; } diff --git a/test/emplace_test.hpp b/test/emplace_test.hpp index f1ce886..3557c6f 100644 --- a/test/emplace_test.hpp +++ b/test/emplace_test.hpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include //make_unsigned, alignment_of namespace boost{ namespace interprocess{ @@ -142,7 +142,7 @@ bool test_expected_container(const Container &ec, const std::pair EmplaceIntPair; -static boost::aligned_storage::type pair_storage; +static boost::container::container_detail::aligned_storage::type pair_storage; static EmplaceIntPair* initialize_emplace_int_pair() { diff --git a/test/enable_shared_from_this_test.cpp b/test/enable_shared_from_this_test.cpp index 2b90adc..342e0a7 100644 --- a/test/enable_shared_from_this_test.cpp +++ b/test/enable_shared_from_this_test.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include "get_process_id_name.hpp" diff --git a/test/expand_bwd_test_template.hpp b/test/expand_bwd_test_template.hpp index 4e8a55f..91d1146 100644 --- a/test/expand_bwd_test_template.hpp +++ b/test/expand_bwd_test_template.hpp @@ -12,11 +12,11 @@ #define BOOST_INTERPROCESS_TEST_ALLOCATION_TEST_TEMPLATE_HEADER #include -#include #include "expand_bwd_test_allocator.hpp" +#include #include //std::equal +#include #include -#include namespace boost { namespace interprocess { namespace test { @@ -109,7 +109,7 @@ template bool test_insert_with_expand_bwd() { typedef typename VectorWithExpandBwdAllocator::value_type value_type; - typedef typename boost::remove_volatile::type non_volatile_value_type; + typedef typename boost::interprocess::ipcdetail::remove_volatile::type non_volatile_value_type; typedef std::vector Vect; const int MemorySize = 1000; @@ -181,7 +181,7 @@ template bool test_assign_with_expand_bwd() { typedef typename VectorWithExpandBwdAllocator::value_type value_type; - typedef typename boost::remove_volatile::type non_volatile_value_type; + typedef typename boost::interprocess::ipcdetail::remove_volatile::type non_volatile_value_type; const int MemorySize = 200; const int Offset[] = { 50, 50, 50}; @@ -227,10 +227,10 @@ bool test_assign_with_expand_bwd() } } catch(...){ - delete [](const_cast::type*>(memory)); + delete [](const_cast::type*>(memory)); throw; } - delete [](const_cast::type*>(memory)); + delete [](const_cast::type*>(memory)); } return true; diff --git a/test/intrusive_ptr_test.cpp b/test/intrusive_ptr_test.cpp index beb2420..d5293a3 100644 --- a/test/intrusive_ptr_test.cpp +++ b/test/intrusive_ptr_test.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/map_test.hpp b/test/map_test.hpp index d116667..dd77670 100644 --- a/test/map_test.hpp +++ b/test/map_test.hpp @@ -14,12 +14,18 @@ #include #include "check_equal_containers.hpp" #include -#include -#include -#include "print_container.hpp" -#include + +// interprocess #include +// interprocess/detail +#include +// intrusive/detail +#include +#include +// std #include + +#include "print_container.hpp" #include "get_process_id_name.hpp" template diff --git a/test/memory_algorithm_test.cpp b/test/memory_algorithm_test.cpp index f893540..4e3c6e4 100644 --- a/test/memory_algorithm_test.cpp +++ b/test/memory_algorithm_test.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include //make_unsigned, alignment_of #include "memory_algorithm_test_template.hpp" #include #include @@ -69,7 +69,7 @@ int test_rbtree_best_fit() int main () { - const std::size_t void_ptr_align = ::boost::alignment_of >::value; + const std::size_t void_ptr_align = ::boost::container::container_detail::alignment_of >::value; if(test_simple_seq_fit()){ return 1; diff --git a/test/memory_algorithm_test_template.hpp b/test/memory_algorithm_test_template.hpp index 8eb0835..10e880e 100644 --- a/test/memory_algorithm_test_template.hpp +++ b/test/memory_algorithm_test_template.hpp @@ -12,12 +12,13 @@ #define BOOST_INTERPROCESS_TEST_MEMORY_ALGORITHM_TEST_TEMPLATE_HEADER #include + +#include + #include #include -#include -#include +#include //std::nothrow #include //std::memset -#include namespace boost { namespace interprocess { namespace test { @@ -32,7 +33,7 @@ bool test_allocation(Allocator &a) ; t != EndDeallocationType ; t = (deallocation_type)((int)t + 1)){ std::vector buffers; - typename Allocator::size_type free_memory = a.get_free_memory(); + typename Allocator::size_type free_memory = a.get_free_memory(); for(int i = 0; true; ++i){ void *ptr = a.allocate(i, std::nothrow); diff --git a/test/message_queue_test.cpp b/test/message_queue_test.cpp index 1277636..c4a9233 100644 --- a/test/message_queue_test.cpp +++ b/test/message_queue_test.cpp @@ -16,11 +16,12 @@ #include #include #include +// intrusive/detail +#include +#include #include #include -#include -#include #include #include #include diff --git a/test/named_allocation_test_template.hpp b/test/named_allocation_test_template.hpp index b3f1507..ca79634 100644 --- a/test/named_allocation_test_template.hpp +++ b/test/named_allocation_test_template.hpp @@ -12,18 +12,23 @@ #define BOOST_INTERPROCESS_NAMED_ALLOCATION_TEST_TEMPLATE_HEADER #include + +// interprocess #include #include -#include #include -#include -#include +#include +// container +#include +#include //char_traits +// std #include +#include #include -#include -#include #include -#include +#include + +// local #include "get_process_id_name.hpp" namespace boost { namespace interprocess { namespace test { @@ -128,7 +133,7 @@ bool test_named_iterators(ManagedMemory &m) const_named_iterator named_beg = m.named_begin(); const_named_iterator named_end = m.named_end(); - if((std::size_t)std::distance(named_beg, named_end) != (std::size_t)buffers.size()){ + if((std::size_t)boost::container::iterator_distance(named_beg, named_end) != (std::size_t)buffers.size()){ return 1; } @@ -488,4 +493,3 @@ bool test_named_allocation() #include #endif //BOOST_INTERPROCESS_NAMED_ALLOCATION_TEST_TEMPLATE_HEADER - diff --git a/test/named_construct_test.cpp b/test/named_construct_test.cpp index acdd9b7..834a993 100644 --- a/test/named_construct_test.cpp +++ b/test/named_construct_test.cpp @@ -10,7 +10,8 @@ #include #include #include -#include +// intrusive/detail +#include typedef std::pair simple_pair; diff --git a/test/shared_ptr_test.cpp b/test/shared_ptr_test.cpp index 3e9c61a..5bdfd93 100644 --- a/test/shared_ptr_test.cpp +++ b/test/shared_ptr_test.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include "get_process_id_name.hpp" diff --git a/test/string_test.cpp b/test/string_test.cpp index cfcf0c5..15399be 100644 --- a/test/string_test.cpp +++ b/test/string_test.cpp @@ -25,6 +25,7 @@ #include "expand_bwd_test_template.hpp" #include "allocator_v1.hpp" #include "get_process_id_name.hpp" +#include //std::nothrow using namespace boost::interprocess; diff --git a/test/user_buffer_test.cpp b/test/user_buffer_test.cpp index 9299d0b..8adfcc9 100644 --- a/test/user_buffer_test.cpp +++ b/test/user_buffer_test.cpp @@ -18,8 +18,8 @@ #include #include #include +#include #include -#include #include "print_container.hpp" /******************************************************************************/ @@ -53,9 +53,9 @@ bool CheckEqual(MyUserList *userlist, MyStdList *stdlist, MyHeapList *heaplist) int main () { //Create the user memory who will store all objects - const int size_aligner = sizeof(::boost::detail::max_align); + const int size_aligner = sizeof(::boost::container::container_detail::max_align_t); const int memsize = 65536/size_aligner*size_aligner; - static ::boost::detail::max_align static_buffer[memsize/size_aligner]; + static ::boost::container::container_detail::max_align_t static_buffer[memsize/size_aligner]; { //Now test move semantics