Ticket #3950: boost_interprocess.patch

File boost_interprocess.patch, 3.6 KB (added by Lénaïc Huard <lhuard@…>, 12 years ago)
  • boost/interprocess/detail/move.hpp

     
    3434
    3535/// @cond
    3636
     37#ifdef __GNUC__
     38#   define BOOST_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__))
     39#else
     40#   define BOOST_ATTRIBUTE_MAY_ALIAS
     41#endif
     42
    3743#define BOOST_MOVE_IN_BOOST_INTERPROCESS_NAMESPACE
    3844
    3945#ifdef BOOST_MOVE_IN_BOOST_INTERPROCESS_NAMESPACE
     
    97103   ~rv();
    98104   rv(rv const&);
    99105   void operator=(rv const&);
    100 };
     106} BOOST_ATTRIBUTE_MAY_ALIAS;
    101107
    102108//////////////////////////////////////////////////////////////////////////////
    103109//
  • boost/interprocess/mapped_region.hpp

     
    8181
    8282   //!Move constructor. *this will be constructed taking ownership of "other"'s
    8383   //!region and "other" will be left in default constructor state.
    84    mapped_region(BOOST_INTERPROCESS_RV_REF(mapped_region) other);
     84   mapped_region(BOOST_INTERPROCESS_RV_REF(mapped_region) other)
     85#if (defined BOOST_INTERPROCESS_WINDOWS)
     86      :  m_base(0), m_size(0), m_offset(0)
     87      ,  m_extra_offset(0)
     88      ,  m_mode(read_only)
     89      ,  m_file_mapping_hnd(detail::invalid_file())
     90   {  this->swap(other);   }
     91#else    //#if (defined BOOST_INTERPROCESS_WINDOWS)
     92      :  m_base(MAP_FAILED), m_size(0), m_offset(0),  m_extra_offset(0), m_mode(read_only), m_is_xsi(false)
     93   {  this->swap(other);   }
     94#endif   //#if (defined BOOST_INTERPROCESS_WINDOWS)
    8595
    8696   //!Destroys the mapped region.
    8797   //!Does not throw
     
    8999
    90100   //!Move assignment. If *this owns a memory mapped region, it will be
    91101   //!destroyed and it will take ownership of "other"'s memory mapped region.
    92    mapped_region &operator=(BOOST_INTERPROCESS_RV_REF(mapped_region) other);
     102   mapped_region &operator=(BOOST_INTERPROCESS_RV_REF(mapped_region) other)
     103   {
     104      mapped_region tmp(boost::interprocess::move(other));
     105      this->swap(tmp);
     106      return *this;
     107   }
    93108
    94109   //!Returns the size of the mapping. Note for windows users: If
    95110   //!windows_shared_memory is mapped using 0 as the size, it returns 0
     
    154169inline void swap(mapped_region &x, mapped_region &y)
    155170{  x.swap(y);  }
    156171
    157 inline mapped_region &mapped_region::operator=(BOOST_INTERPROCESS_RV_REF(mapped_region) moved)
    158 {
    159    mapped_region tmp(boost::interprocess::move(moved));
    160    this->swap(tmp);
    161    return *this;
    162 }
    163 
    164172inline mapped_region::~mapped_region()
    165173{  this->priv_close(); }
    166174
     
    183191   ,  m_file_mapping_hnd(detail::invalid_file())
    184192{}
    185193
    186 inline mapped_region::mapped_region(BOOST_INTERPROCESS_RV_REF(mapped_region) other)
    187    :  m_base(0), m_size(0), m_offset(0)
    188    ,  m_extra_offset(0)
    189    ,  m_mode(read_only)
    190    ,  m_file_mapping_hnd(detail::invalid_file())
    191 {  this->swap(other);   }
    192 
    193194template<int dummy>
    194195inline std::size_t mapped_region::page_size_holder<dummy>::get_page_size()
    195196{
     
    378379   :  m_base(MAP_FAILED), m_size(0), m_offset(0),  m_extra_offset(0), m_mode(read_only), m_is_xsi(false)
    379380{}
    380381
    381 inline mapped_region::mapped_region(BOOST_INTERPROCESS_RV_REF(mapped_region) other)
    382    :  m_base(MAP_FAILED), m_size(0), m_offset(0),  m_extra_offset(0), m_mode(read_only), m_is_xsi(false)
    383 {  this->swap(other);   }
    384 
    385382template<int dummy>
    386383inline std::size_t mapped_region::page_size_holder<dummy>::get_page_size()
    387384{  return std::size_t(sysconf(_SC_PAGESIZE)); }