diff DEPENDENCIES/generic/include/boost/interprocess/mapped_region.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
line wrap: on
line diff
--- a/DEPENDENCIES/generic/include/boost/interprocess/mapped_region.hpp	Fri Sep 04 12:01:02 2015 +0100
+++ b/DEPENDENCIES/generic/include/boost/interprocess/mapped_region.hpp	Mon Sep 07 11:12:49 2015 +0100
@@ -11,17 +11,27 @@
 #ifndef BOOST_INTERPROCESS_MAPPED_REGION_HPP
 #define BOOST_INTERPROCESS_MAPPED_REGION_HPP
 
+#ifndef BOOST_CONFIG_HPP
+#  include <boost/config.hpp>
+#endif
+#
+#if defined(BOOST_HAS_PRAGMA_ONCE)
+#  pragma once
+#endif
+
 #include <boost/interprocess/detail/config_begin.hpp>
 #include <boost/interprocess/detail/workaround.hpp>
 
 #include <boost/interprocess/interprocess_fwd.hpp>
 #include <boost/interprocess/exceptions.hpp>
-#include <boost/move/move.hpp>
+#include <boost/move/utility_core.hpp>
 #include <boost/interprocess/detail/utilities.hpp>
 #include <boost/interprocess/detail/os_file_functions.hpp>
 #include <string>
 #include <boost/cstdint.hpp>
 #include <boost/assert.hpp>
+#include <boost/move/adl_move_swap.hpp>
+
 //Some Unixes use caddr_t instead of void * in madvise
 //              SunOS                                 Tru64                               HP-UX                    AIX
 #if defined(sun) || defined(__sun) || defined(__osf__) || defined(__osf) || defined(_hpux) || defined(hpux) || defined(_AIX)
@@ -53,7 +63,7 @@
 #    error Unknown platform
 #  endif
 
-#endif   //#if (defined BOOST_INTERPROCESS_WINDOWS)
+#endif   //#if defined (BOOST_INTERPROCESS_WINDOWS)
 
 //!\file
 //!Describes mapped region class
@@ -61,7 +71,7 @@
 namespace boost {
 namespace interprocess {
 
-/// @cond
+#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
 
 //Solaris declares madvise only in some configurations but defines MADV_XXX, a bit confusing.
 //Predeclare it here to avoid any compilation error
@@ -72,7 +82,7 @@
 namespace ipcdetail{ class interprocess_tester; }
 namespace ipcdetail{ class raw_mapped_region_creator; }
 
-/// @endcond
+#endif   //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
 
 //!The mapped_region class represents a portion or region created from a
 //!memory_mappable object.
@@ -82,10 +92,10 @@
 //!the region specified by the user.
 class mapped_region
 {
-   /// @cond
+   #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
    //Non-copyable
    BOOST_MOVABLE_BUT_NOT_COPYABLE(mapped_region)
-   /// @endcond
+   #endif   //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
 
    public:
 
@@ -186,7 +196,7 @@
 
    //!This enum specifies region usage behaviors that an application can specify
    //!to the mapped region implementation.
-   enum advice_types{ 
+   enum advice_types{
       //!Specifies that the application has no advice to give on its behavior with respect to
       //!the region. It is the default characteristic if no advice is given for a range of memory.
       advice_normal,
@@ -217,7 +227,7 @@
    //!will restrict the address and the offset to map.
    static std::size_t get_page_size();
 
-   /// @cond
+   #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
    private:
    //!Closes a previously opened memory mapping. Never throws
    void priv_close();
@@ -254,10 +264,10 @@
    template<int Dummy>
    static void destroy_syncs_in_range(const void *addr, std::size_t size);
    #endif
-   /// @endcond
+   #endif   //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
 };
 
-///@cond
+#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
 
 inline void swap(mapped_region &x, mapped_region &y)
 {  x.swap(y);  }
@@ -374,7 +384,7 @@
 inline std::size_t mapped_region::page_size_holder<dummy>::get_page_size()
 {
    winapi::system_info info;
-   get_system_info(&info);
+   winapi::get_system_info(&info);
    return std::size_t(info.dwAllocationGranularity);
 }
 
@@ -520,7 +530,7 @@
    }
    else if(shrink_page_bytes){
       //In Windows, we can't decommit the storage or release the virtual address space,
-      //the best we can do is try to remove some memory from the process working set. 
+      //the best we can do is try to remove some memory from the process working set.
       //With a bit of luck we can free some physical memory.
       unsigned long old_protect_ignored;
       bool b_ret = winapi::virtual_unlock(shrink_page_start, shrink_page_bytes)
@@ -561,7 +571,7 @@
 inline void mapped_region::dont_close_on_destruction()
 {}
 
-#else    //#if (defined BOOST_INTERPROCESS_WINDOWS)
+#else    //#if defined (BOOST_INTERPROCESS_WINDOWS)
 
 inline mapped_region::mapped_region()
    :  m_base(0), m_size(0), m_page_offset(0), m_mode(read_only), m_is_xsi(false)
@@ -741,6 +751,9 @@
    const unsigned int mode_none = 0;
    const unsigned int mode_padv = 1;
    const unsigned int mode_madv = 2;
+   // Suppress "unused variable" warnings
+   (void)mode_padv;
+   (void)mode_madv;
    unsigned int mode = mode_none;
    //Choose advice either from POSIX (preferred) or native Unix
    switch(advice){
@@ -830,7 +843,7 @@
 inline void mapped_region::dont_close_on_destruction()
 {  m_base = 0;   }
 
-#endif   //##if (defined BOOST_INTERPROCESS_WINDOWS)
+#endif   //#if defined (BOOST_INTERPROCESS_WINDOWS)
 
 template<int dummy>
 const std::size_t mapped_region::page_size_holder<dummy>::PageSize
@@ -846,14 +859,14 @@
 
 inline void mapped_region::swap(mapped_region &other)
 {
-   ipcdetail::do_swap(this->m_base, other.m_base);
-   ipcdetail::do_swap(this->m_size, other.m_size);
-   ipcdetail::do_swap(this->m_page_offset, other.m_page_offset);
-   ipcdetail::do_swap(this->m_mode,  other.m_mode);
-   #if (defined BOOST_INTERPROCESS_WINDOWS)
-   ipcdetail::do_swap(this->m_file_or_mapping_hnd, other.m_file_or_mapping_hnd);
+   ::boost::adl_move_swap(this->m_base, other.m_base);
+   ::boost::adl_move_swap(this->m_size, other.m_size);
+   ::boost::adl_move_swap(this->m_page_offset, other.m_page_offset);
+   ::boost::adl_move_swap(this->m_mode,  other.m_mode);
+   #if defined (BOOST_INTERPROCESS_WINDOWS)
+   ::boost::adl_move_swap(this->m_file_or_mapping_hnd, other.m_file_or_mapping_hnd);
    #else
-   ipcdetail::do_swap(this->m_is_xsi, other.m_is_xsi);
+   ::boost::adl_move_swap(this->m_is_xsi, other.m_is_xsi);
    #endif
 }
 
@@ -867,7 +880,7 @@
    {  return 0;  }
 };
 
-/// @endcond
+#endif   //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
 
 }  //namespace interprocess {
 }  //namespace boost {