Ticket #3950: boost_interprocess.patch
File boost_interprocess.patch, 3.6 KB (added by , 12 years ago) |
---|
-
boost/interprocess/detail/move.hpp
34 34 35 35 /// @cond 36 36 37 #ifdef __GNUC__ 38 # define BOOST_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__)) 39 #else 40 # define BOOST_ATTRIBUTE_MAY_ALIAS 41 #endif 42 37 43 #define BOOST_MOVE_IN_BOOST_INTERPROCESS_NAMESPACE 38 44 39 45 #ifdef BOOST_MOVE_IN_BOOST_INTERPROCESS_NAMESPACE … … 97 103 ~rv(); 98 104 rv(rv const&); 99 105 void operator=(rv const&); 100 } ;106 } BOOST_ATTRIBUTE_MAY_ALIAS; 101 107 102 108 ////////////////////////////////////////////////////////////////////////////// 103 109 // -
boost/interprocess/mapped_region.hpp
81 81 82 82 //!Move constructor. *this will be constructed taking ownership of "other"'s 83 83 //!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) 85 95 86 96 //!Destroys the mapped region. 87 97 //!Does not throw … … 89 99 90 100 //!Move assignment. If *this owns a memory mapped region, it will be 91 101 //!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 } 93 108 94 109 //!Returns the size of the mapping. Note for windows users: If 95 110 //!windows_shared_memory is mapped using 0 as the size, it returns 0 … … 154 169 inline void swap(mapped_region &x, mapped_region &y) 155 170 { x.swap(y); } 156 171 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 164 172 inline mapped_region::~mapped_region() 165 173 { this->priv_close(); } 166 174 … … 183 191 , m_file_mapping_hnd(detail::invalid_file()) 184 192 {} 185 193 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 193 194 template<int dummy> 194 195 inline std::size_t mapped_region::page_size_holder<dummy>::get_page_size() 195 196 { … … 378 379 : m_base(MAP_FAILED), m_size(0), m_offset(0), m_extra_offset(0), m_mode(read_only), m_is_xsi(false) 379 380 {} 380 381 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 385 382 template<int dummy> 386 383 inline std::size_t mapped_region::page_size_holder<dummy>::get_page_size() 387 384 { return std::size_t(sysconf(_SC_PAGESIZE)); }