Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76127 - in trunk/boost/interprocess: . detail
From: igaztanaga_at_[hidden]
Date: 2011-12-24 05:05:09


Author: igaztanaga
Date: 2011-12-24 05:05:06 EST (Sat, 24 Dec 2011)
New Revision: 76127
URL: http://svn.boost.org/trac/boost/changeset/76127

Log:
Bug #5738
Text files modified:
   trunk/boost/interprocess/detail/os_file_functions.hpp | 2 ++
   trunk/boost/interprocess/mapped_region.hpp | 13 ++++++++++++-
   2 files changed, 14 insertions(+), 1 deletions(-)

Modified: trunk/boost/interprocess/detail/os_file_functions.hpp
==============================================================================
--- trunk/boost/interprocess/detail/os_file_functions.hpp (original)
+++ trunk/boost/interprocess/detail/os_file_functions.hpp 2011-12-24 05:05:06 EST (Sat, 24 Dec 2011)
@@ -129,6 +129,8 @@
       return false;
 
    const offset_t max_filesize = (std::numeric_limits<offset_t>::max)();
+ //Avoid unused variable warnings in 32 bit systems
+ (void)max_filesize;
    if( sizeof(std::size_t) >= sizeof(offset_t) && size > std::size_t(max_filesize) ){
       winapi::set_last_error(winapi::error_file_too_large);
       return false;

Modified: trunk/boost/interprocess/mapped_region.hpp
==============================================================================
--- trunk/boost/interprocess/mapped_region.hpp (original)
+++ trunk/boost/interprocess/mapped_region.hpp 2011-12-24 05:05:06 EST (Sat, 24 Dec 2011)
@@ -75,7 +75,8 @@
                 ,std::size_t size = 0
                 ,const void *address = 0);
 
- //!Default constructor. Size and offset will be 0.
+ //!Default constructor. Address will be invalid_address().
+ //!Size and offset will be 0.
    //!Does not throw
    mapped_region();
 
@@ -122,6 +123,10 @@
    //!Never throws.
    mode_t get_mode() const;
 
+ //!Returns the value that represents an invalid mapping address
+ //!Never throws.
+ static void* invalid_address();
+
    //!Flushes to the disk a byte range within the mapped memory.
    //!Never throws
    bool flush(std::size_t mapping_offset = 0, std::size_t numbytes = 0);
@@ -370,6 +375,9 @@
    #endif
 }
 
+inline void* mapped_region::invalid_address()
+{ return 0; }
+
 inline void mapped_region::dont_close_on_destruction()
 {}
 
@@ -559,6 +567,9 @@
    }
 }
 
+inline void* mapped_region::invalid_address()
+{ return MAP_FAILED; }
+
 inline void mapped_region::dont_close_on_destruction()
 { m_base = MAP_FAILED; }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk