diff options
Diffstat (limited to 'boost/interprocess/shared_memory_object.hpp')
-rw-r--r-- | boost/interprocess/shared_memory_object.hpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/boost/interprocess/shared_memory_object.hpp b/boost/interprocess/shared_memory_object.hpp index 7c8fcf61bd..f3bc7ba173 100644 --- a/boost/interprocess/shared_memory_object.hpp +++ b/boost/interprocess/shared_memory_object.hpp @@ -28,7 +28,7 @@ #if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS_ONLY) # include <sys/shm.h> //System V shared memory... #elif defined(BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS) -# include <fcntl.h> //O_CREAT, O_*... +# include <fcntl.h> //O_CREAT, O_*... # include <sys/mman.h> //shm_xxx # include <unistd.h> //ftruncate, close # include <sys/stat.h> //mode_t, S_IRWXG, S_IRWXO, S_IRWXU, @@ -71,26 +71,26 @@ class shared_memory_object shared_memory_object(open_or_create_t, const char *name, mode_t mode, const permissions &perm = permissions()) { this->priv_open_or_create(ipcdetail::DoOpenOrCreate, name, mode, perm); } - //!Tries to open a shared memory object with name "name", with the access mode "mode". + //!Tries to open a shared memory object with name "name", with the access mode "mode". //!If the file does not previously exist, it throws an error. shared_memory_object(open_only_t, const char *name, mode_t mode) { this->priv_open_or_create(ipcdetail::DoOpen, name, mode, permissions()); } - //!Moves the ownership of "moved"'s shared memory object to *this. - //!After the call, "moved" does not represent any shared memory object. + //!Moves the ownership of "moved"'s shared memory object to *this. + //!After the call, "moved" does not represent any shared memory object. //!Does not throw shared_memory_object(BOOST_RV_REF(shared_memory_object) moved) : m_handle(file_handle_t(ipcdetail::invalid_file())) { this->swap(moved); } //!Moves the ownership of "moved"'s shared memory to *this. - //!After the call, "moved" does not represent any shared memory. + //!After the call, "moved" does not represent any shared memory. //!Does not throw shared_memory_object &operator=(BOOST_RV_REF(shared_memory_object) moved) - { + { shared_memory_object tmp(boost::move(moved)); this->swap(tmp); - return *this; + return *this; } //!Swaps the shared_memory_objects. Does not throw @@ -99,7 +99,7 @@ class shared_memory_object //!Erases a shared memory object from the system. //!Returns false on error. Never throws static bool remove(const char *name); - + //!Sets the size of the shared memory mapping void truncate(offset_t length); @@ -142,11 +142,11 @@ class shared_memory_object /// @cond -inline shared_memory_object::shared_memory_object() +inline shared_memory_object::shared_memory_object() : m_handle(file_handle_t(ipcdetail::invalid_file())) {} -inline shared_memory_object::~shared_memory_object() +inline shared_memory_object::~shared_memory_object() { this->priv_close(); } @@ -157,10 +157,10 @@ inline bool shared_memory_object::get_size(offset_t &size) const { return ipcdetail::get_file_size((file_handle_t)m_handle, size); } inline void shared_memory_object::swap(shared_memory_object &other) -{ +{ std::swap(m_handle, other.m_handle); std::swap(m_mode, other.m_mode); - m_filename.swap(other.m_filename); + m_filename.swap(other.m_filename); } inline mapping_handle_t shared_memory_object::get_mapping_handle() const @@ -268,7 +268,7 @@ inline bool use_filesystem_based_posix() } //shared_memory_object_detail inline bool shared_memory_object::priv_open_or_create - (ipcdetail::create_enum_t type, + (ipcdetail::create_enum_t type, const char *filename, mode_t mode, const permissions &perm) { |