diff --git a/doc/interprocess.qbk b/doc/interprocess.qbk index 4b8f5ae..5060ca7 100644 --- a/doc/interprocess.qbk +++ b/doc/interprocess.qbk @@ -1800,10 +1800,10 @@ To sum up: [section:upgradable_transitions Lock transitions for Upgradable Mutex] -A sharable mutex has no option to change the acquired lock for another lock +A sharable mutex has no option to change the acquired lock for another lock atomically. -On the other hand, for an upgradable mutex, a thread that has +On the other hand, for an upgradable mutex, a thread that has acquired a lock can try to acquire another lock type atomically. All lock transitions are not guaranteed to succeed. Even if a transition is guaranteed to succeed, some transitions will block the thread waiting until other threads release @@ -3919,7 +3919,7 @@ There are 2 types of `allocate_many` functions: [c++] - //!Allocates n_elements of elem_bytes bytes. + //!Allocates n_elements of elem_bytes bytes. //!Throws bad_alloc on failure. chain.size() is not increased on failure. void allocate_many(size_type elem_bytes, size_type n_elements, multiallocation_chain &chain); @@ -3927,7 +3927,7 @@ There are 2 types of `allocate_many` functions: //!Throws bad_alloc on failure. chain.size() is not increased on failure. void allocate_many(const size_type *element_lengths, size_type n_elements, size_type sizeof_element, multiallocation_chain &chain); - //!Allocates n_elements of elem_bytes bytes. + //!Allocates n_elements of elem_bytes bytes. //!Non-throwing version. chain.size() is not increased on failure. void allocate_many(std::nothrow_t, size_type elem_bytes, size_type n_elements, multiallocation_chain &chain); @@ -6739,7 +6739,7 @@ thank them: [section:release_notes Release Notes] [section:release_notes_boost_1_56_00 Boost 1.56 Release] -* Fixed bugs: +* Fixed bugs: * [@https://svn.boost.org/trac/boost/ticket/9221 Trac #9221 (['"message_queue deadlock on linux"])]. * [@https://svn.boost.org/trac/boost/ticket/9226 Trac #9226 (['"On some computers, Common Appdata is empty in registry, so boost interprocess cannot work"])]. * [@https://svn.boost.org/trac/boost/ticket/9284 Trac #9284 (['"WaitForSingleObject(mutex) must handle WAIT_ABANDONED"])]. diff --git a/include/boost/interprocess/detail/managed_memory_impl.hpp b/include/boost/interprocess/detail/managed_memory_impl.hpp index 106ab88..5dd4093 100644 --- a/include/boost/interprocess/detail/managed_memory_impl.hpp +++ b/include/boost/interprocess/detail/managed_memory_impl.hpp @@ -307,7 +307,7 @@ class basic_managed_memory_impl //Experimental. Don't use. - //!Allocates n_elements of elem_bytes bytes. + //!Allocates n_elements of elem_bytes bytes. //!Throws bad_alloc on failure. chain.size() is not increased on failure. void allocate_many(size_type elem_bytes, size_type n_elements, multiallocation_chain &chain) { mp_header->allocate_many(elem_bytes, n_elements, chain); } @@ -317,7 +317,7 @@ class basic_managed_memory_impl void allocate_many(const size_type *element_lengths, size_type n_elements, size_type sizeof_element, multiallocation_chain &chain) { mp_header->allocate_many(element_lengths, n_elements, sizeof_element, chain); } - //!Allocates n_elements of elem_bytes bytes. + //!Allocates n_elements of elem_bytes bytes. //!Non-throwing version. chain.size() is not increased on failure. void allocate_many(std::nothrow_t, size_type elem_bytes, size_type n_elements, multiallocation_chain &chain) { mp_header->allocate_many(std::nothrow_t(), elem_bytes, n_elements, chain); } diff --git a/include/boost/interprocess/detail/os_thread_functions.hpp b/include/boost/interprocess/detail/os_thread_functions.hpp index 7ee0046..d139732 100644 --- a/include/boost/interprocess/detail/os_thread_functions.hpp +++ b/include/boost/interprocess/detail/os_thread_functions.hpp @@ -153,7 +153,7 @@ inline OS_highres_count_t system_highres_count_subtract(const OS_highres_count_t { return l - r; } inline bool system_highres_count_less(const OS_highres_count_t &l, const OS_highres_count_t &r) -{ return l < r; } +{ return l < r; } inline bool system_highres_count_less_ul(const OS_highres_count_t &l, unsigned long r) { return l < static_cast(r); } @@ -305,8 +305,8 @@ inline unsigned long get_system_tick_in_highres_counts() mach_timebase_info(&info); //ns return static_cast - ( - static_cast(get_system_tick_ns()) + ( + static_cast(get_system_tick_ns()) / (static_cast(info.numer) / info.denom) ); #endif @@ -349,11 +349,11 @@ inline OS_highres_count_t system_highres_count_subtract(const OS_highres_count_t OS_highres_count_t res; if (l.tv_nsec < r.tv_nsec){ - res.tv_nsec = 1000000000 + l.tv_nsec - r.tv_nsec; + res.tv_nsec = 1000000000 + l.tv_nsec - r.tv_nsec; res.tv_sec = l.tv_sec - 1 - r.tv_sec; } else{ - res.tv_nsec = l.tv_nsec - r.tv_nsec; + res.tv_nsec = l.tv_nsec - r.tv_nsec; res.tv_sec = l.tv_sec - r.tv_sec; } @@ -364,7 +364,7 @@ inline bool system_highres_count_less(const OS_highres_count_t &l, const OS_high { return l.tv_sec < r.tv_sec || (l.tv_sec == r.tv_sec && l.tv_nsec < r.tv_nsec); } inline bool system_highres_count_less_ul(const OS_highres_count_t &l, unsigned long r) -{ return !l.tv_sec && (static_cast(l.tv_nsec) < r); } +{ return !l.tv_sec && (static_cast(l.tv_nsec) < r); } #else diff --git a/include/boost/interprocess/detail/utilities.hpp b/include/boost/interprocess/detail/utilities.hpp index 9caa8f9..e09f48c 100644 --- a/include/boost/interprocess/detail/utilities.hpp +++ b/include/boost/interprocess/detail/utilities.hpp @@ -148,9 +148,9 @@ template inline bool multiplication_overflows(SizeType a, SizeType b) { const SizeType sqrt_size_max = sqrt_size_type_max::value; - return //Fast runtime check + return //Fast runtime check ( (a | b) > sqrt_size_max && - //Slow division check + //Slow division check b && a > SizeType(-1)/b ); } diff --git a/include/boost/interprocess/detail/win32_api.hpp b/include/boost/interprocess/detail/win32_api.hpp index d287558..07a0262 100644 --- a/include/boost/interprocess/detail/win32_api.hpp +++ b/include/boost/interprocess/detail/win32_api.hpp @@ -98,7 +98,7 @@ typedef unsigned short *bstr; struct wchar_variant { - union + union { struct { @@ -106,7 +106,7 @@ struct wchar_variant unsigned short wReserved1; unsigned short wReserved2; unsigned short wReserved3; - union + union { bstr bstrVal; struct @@ -1547,7 +1547,7 @@ const char *function_address_holder::FunctionNames[function_address_holde }; template -unsigned int function_address_holder::FunctionModules[function_address_holder::NumFunction] = +unsigned int function_address_holder::FunctionModules[function_address_holder::NumFunction] = { NtDll_dll, NtDll_dll, @@ -1563,7 +1563,7 @@ unsigned int function_address_holder::FunctionModules[function_address_ho }; template -const char *function_address_holder::ModuleNames[function_address_holder::NumModule] = +const char *function_address_holder::ModuleNames[function_address_holder::NumModule] = { "ntdll.dll", "kernel32.dll" @@ -1667,7 +1667,7 @@ inline void buffer_to_wide_str(const void *buf, std::size_t length, wchar_t *str } } -inline bool get_boot_and_system_time_wstr(wchar_t *bootsystemstamp, std::size_t &s) +inline bool get_boot_and_system_time_wstr(wchar_t *bootsystemstamp, std::size_t &s) //will write BootAndSystemstampLength chars { if(s < (BootAndSystemstampLength*2)) @@ -1744,7 +1744,7 @@ class nt_query_mem_deleter } ntquery_mem_t *query_mem() const - { return static_cast(static_cast(m_buf)); } + { return static_cast(static_cast(m_buf)); } unsigned long object_name_information_size() const { @@ -2197,22 +2197,22 @@ inline bool get_last_bootup_time(std::string &stamp) void *hEventLog = OpenEventLogA(0, source_name); if (hEventLog){ eventlog_handle_closer hnd_closer(hEventLog); (void)hnd_closer; - // Allocate an initial block of memory used to read event records. The number + // Allocate an initial block of memory used to read event records. The number // of records read into the buffer will vary depending on the size of each event. // The size of each event will vary based on the size of the user-defined - // data included with each event, the number and length of insertion + // data included with each event, the number and length of insertion // strings, and other data appended to the end of the event record. dwBytesToRead = max_record_buffer_size; c_heap_deleter heap_deleter(dwBytesToRead); - // Read blocks of records until you reach the end of the log or an + // Read blocks of records until you reach the end of the log or an // error occurs. The records are read from newest to oldest. If the buffer // is not big enough to hold a complete event record, reallocate the buffer. if (heap_deleter.get() != 0){ while (0 == status){ - if (!ReadEventLogA(hEventLog, + if (!ReadEventLogA(hEventLog, eventlog_sequential_read | eventlog_backwards_read, - 0, + 0, heap_deleter.get(), dwBytesToRead, &dwBytesRead, @@ -2281,7 +2281,7 @@ inline bool get_semaphore_info(void *handle, long &count, long &limit) return !status; } -inline bool query_timer_resolution(unsigned long *lowres, unsigned long *highres, unsigned long *curres) +inline bool query_timer_resolution(unsigned long *lowres, unsigned long *highres, unsigned long *curres) { winapi::NtQueryTimerResolution_t pNtQueryTimerResolution = (winapi::NtQueryTimerResolution_t)dll_func::get(winapi::dll_func::NtQueryTimerResolution); diff --git a/include/boost/interprocess/ipc/message_queue.hpp b/include/boost/interprocess/ipc/message_queue.hpp index 2a26a45..100d7b0 100644 --- a/include/boost/interprocess/ipc/message_queue.hpp +++ b/include/boost/interprocess/ipc/message_queue.hpp @@ -250,7 +250,7 @@ class priority_functor //! if two messages have the same priority. So the next message to be //! used in a "receive" is pointed by index [(cur_first_msg + cur_num_msg-1)%max_num_msg] //! and the first free message ready to be used in a "send" operation is -//! [cur_first_msg] if circular buffer is extended from front, +//! [cur_first_msg] if circular buffer is extended from front, //! [(cur_first_msg + cur_num_msg)%max_num_msg] otherwise. //! //! This transforms the index in a circular buffer with an embedded free @@ -356,7 +356,7 @@ class mq_hdr_t iterator begin(this->inserted_ptr_begin()), end(this->inserted_ptr_end()); if(end < begin){ iterator idx_end = &mp_index[m_max_num_msg]; - iterator ret = std::lower_bound(begin, idx_end, value, func); + iterator ret = std::lower_bound(begin, idx_end, value, func); if(idx_end == ret){ iterator idx_beg = &mp_index[0]; ret = std::lower_bound(idx_beg, end, value, func); diff --git a/include/boost/interprocess/mapped_region.hpp b/include/boost/interprocess/mapped_region.hpp index bc3bdb4..4513bd6 100644 --- a/include/boost/interprocess/mapped_region.hpp +++ b/include/boost/interprocess/mapped_region.hpp @@ -186,7 +186,7 @@ class mapped_region //!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, @@ -520,7 +520,7 @@ inline bool mapped_region::shrink_by(std::size_t bytes, bool from_back) } 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) diff --git a/include/boost/interprocess/mem_algo/detail/multi_simple_seq_fit.hpp b/include/boost/interprocess/mem_algo/detail/multi_simple_seq_fit.hpp index 4644929..dd11bdb 100644 --- a/include/boost/interprocess/mem_algo/detail/multi_simple_seq_fit.hpp +++ b/include/boost/interprocess/mem_algo/detail/multi_simple_seq_fit.hpp @@ -33,12 +33,12 @@ namespace interprocess { /*!This class implements the simple sequential fit algorithm with a simply linked list of free buffers.*/ template -class multi_simple_seq_fit +class multi_simple_seq_fit : public ipcdetail::simple_seq_fit_impl { typedef ipcdetail::simple_seq_fit_impl base_t; public: - /*!Constructor. "size" is the total size of the managed memory segment, + /*!Constructor. "size" is the total size of the managed memory segment, "extra_hdr_bytes" indicates the extra bytes beginning in the sizeof(multi_simple_seq_fit) offset that the allocator should not use at all.*/ multi_simple_seq_fit (size_type size, size_type extra_hdr_bytes) diff --git a/include/boost/interprocess/mem_algo/detail/multi_simple_seq_fit_impl.hpp b/include/boost/interprocess/mem_algo/detail/multi_simple_seq_fit_impl.hpp index 4713cfe..c84d4e6 100644 --- a/include/boost/interprocess/mem_algo/detail/multi_simple_seq_fit_impl.hpp +++ b/include/boost/interprocess/mem_algo/detail/multi_simple_seq_fit_impl.hpp @@ -84,10 +84,10 @@ class simple_seq_fit_impl { /*!Offset pointer to the next block.*/ block_ctrl_ptr m_next; - /*!This block's memory size (including block_ctrl + /*!This block's memory size (including block_ctrl header) in BasicSize units*/ size_type m_size; - + size_type get_user_bytes() const { return this->m_size*Alignment - BlockCtrlBytes; } @@ -124,7 +124,7 @@ class simple_seq_fit_impl } m_header; public: - /*!Constructor. "size" is the total size of the managed memory segment, + /*!Constructor. "size" is the total size of the managed memory segment, "extra_hdr_bytes" indicates the extra bytes beginning in the sizeof(simple_seq_fit_impl) offset that the allocator should not use at all.*/ simple_seq_fit_impl (size_type size, size_type extra_hdr_bytes); @@ -159,7 +159,7 @@ class simple_seq_fit_impl std::pair allocation_command (boost::interprocess::allocation_type command, size_type limit_size, - size_type preferred_size,size_type &received_size, + size_type preferred_size,size_type &received_size, void *reuse_ptr = 0, size_type backwards_multiple = 1); /*!Returns the size of the buffer previously allocated pointed by ptr*/ @@ -170,8 +170,8 @@ class simple_seq_fit_impl void* allocate_aligned (size_type nbytes, size_type alignment); /*!Allocates bytes, if there is no more memory, it executes functor - f(size_type) to allocate a new segment to manage. The functor returns - std::pair indicating the base address and size of + f(size_type) to allocate a new segment to manage. The functor returns + std::pair indicating the base address and size of the new segment. If the new segment can't be allocated, allocate it will return 0.*/ void* multi_allocate(size_type nbytes); @@ -259,7 +259,7 @@ inline simple_seq_fit_impl::~simple_seq_fit_impl() template inline void simple_seq_fit_impl::grow(size_type extra_size) -{ +{ //Old highest address block's end offset size_type old_end = m_header.m_size/Alignment*Alignment; @@ -283,7 +283,7 @@ inline void simple_seq_fit_impl::grow(size_type extra_ template inline void simple_seq_fit_impl::priv_add_segment(void *addr, size_type size) -{ +{ //Check size BOOST_ASSERT(!(size < MinBlockSize)); if(size < MinBlockSize) @@ -293,7 +293,7 @@ inline void simple_seq_fit_impl::priv_add_segment(void new_block->m_size = size/Alignment; new_block->m_next = 0; //Simulate this block was previously allocated - m_header.m_allocated += new_block->m_size*Alignment; + m_header.m_allocated += new_block->m_size*Alignment; //Return block and insert it in the free block list this->priv_deallocate(reinterpret_cast(new_block) + BlockCtrlBytes); } @@ -334,7 +334,7 @@ inline void simple_seq_fit_impl::clear_free_memory() //Iterate through all free portions do{ - //Just clear user the memory part reserved for the user + //Just clear user the memory part reserved for the user std::memset( reinterpret_cast(block) + BlockCtrlBytes , 0 , block->m_size*Alignment - BlockCtrlBytes); @@ -381,7 +381,7 @@ inline bool simple_seq_fit_impl:: template inline void* simple_seq_fit_impl:: allocate(size_type nbytes) -{ +{ //----------------------- boost::interprocess::scoped_lock guard(m_header); //----------------------- @@ -392,7 +392,7 @@ inline void* simple_seq_fit_impl:: template inline void* simple_seq_fit_impl:: allocate_aligned(size_type nbytes, size_type alignment) -{ +{ //----------------------- boost::interprocess::scoped_lock guard(m_header); //----------------------- @@ -402,7 +402,7 @@ inline void* simple_seq_fit_impl:: template inline std::pair simple_seq_fit_impl:: allocation_command (boost::interprocess::allocation_type command, size_type min_size, - size_type preferred_size,size_type &received_size, + size_type preferred_size,size_type &received_size, void *reuse_ptr, size_type backwards_multiple) { //----------------------- @@ -451,11 +451,11 @@ inline void* simple_seq_fit_impl:: } //Now obtain the polymorphic functor that creates //new segments and try to allocate again. - boost::interprocess::multi_segment_services *p_services = + boost::interprocess::multi_segment_services *p_services = static_cast (void_pointer::find_group_data(group)); BOOST_ASSERT(p_services); - std::pair ret = + std::pair ret = p_services->create_new_segment(MinBlockSize > nbytes ? MinBlockSize : nbytes); if(ret.first){ priv_add_segment(ret.first, ret.second); @@ -498,11 +498,11 @@ void* simple_seq_fit_impl:: return 0; } - size_type needs_backwards = + size_type needs_backwards = ipcdetail::get_rounded_size(preferred_size - extra_forward, Alignment); - + if(!only_preferred_backwards){ - needs_backwards = + needs_backwards = max_value(ipcdetail::get_rounded_size(min_size - extra_forward, Alignment) ,min_value(prev->get_user_bytes(), needs_backwards)); } @@ -513,15 +513,15 @@ void* simple_seq_fit_impl:: if(!priv_expand(reuse_ptr, received_size, received_size, received_size)){ BOOST_ASSERT(0); } - + //We need a minimum size to split the previous one if((prev->get_user_bytes() - needs_backwards) > 2*BlockCtrlBytes){ block_ctrl *new_block = reinterpret_cast (reinterpret_cast(reuse) - needs_backwards - BlockCtrlBytes); new_block->m_next = 0; - new_block->m_size = + new_block->m_size = BlockCtrlSize + (needs_backwards + extra_forward)/Alignment; - prev->m_size = + prev->m_size = (prev->get_total_bytes() - needs_backwards)/Alignment - BlockCtrlSize; received_size = needs_backwards + extra_forward; m_header.m_allocated += needs_backwards + BlockCtrlBytes; @@ -553,7 +553,7 @@ std::pair simple_seq_fit_impl:: ,void *reuse_ptr) { if(command & boost::interprocess::shrink_in_place){ - bool success = + bool success = this->priv_shrink(reuse_ptr, limit_size, preferred_size, received_size); return std::pair ((success ? reuse_ptr : 0), true); } @@ -643,7 +643,7 @@ inline typename simple_seq_fit_impl::block_ctrl * } template -inline +inline std::pair::block_ctrl * ,typename simple_seq_fit_impl::block_ctrl *> simple_seq_fit_impl:: @@ -724,7 +724,7 @@ inline bool simple_seq_fit_impl:: //We can fill expand. Merge both blocks, block->m_next = next_block->m_next; block->m_size = merged_size; - + //Find the previous free block of next_block block_ctrl *prev = &m_header.m_root; while(ipcdetail::to_raw_pointer(prev->m_next) != next_block){ @@ -733,7 +733,7 @@ inline bool simple_seq_fit_impl:: //Now insert merged block in the free list //This allows reusing allocation logic in this function - m_header.m_allocated -= old_block_size*Alignment; + m_header.m_allocated -= old_block_size*Alignment; prev->m_next = block; //Now use check and allocate to do the allocation logic @@ -747,7 +747,7 @@ inline bool simple_seq_fit_impl:: BOOST_ASSERT(0); return false; } - return true; + return true; } template @@ -805,13 +805,13 @@ inline bool simple_seq_fit_impl:: //Now deallocate the new block to insert it in the free list this->priv_deallocate(reinterpret_cast(block)+BlockCtrlBytes); - return true; + return true; } template inline void* simple_seq_fit_impl:: priv_allocate_aligned(size_type nbytes, size_type alignment) -{ +{ //Ensure power of 2 if ((alignment & (alignment - size_type(1u))) != 0){ //Alignment is not power of two @@ -823,8 +823,8 @@ inline void* simple_seq_fit_impl:: if(alignment <= Alignment){ return priv_allocate(boost::interprocess::allocate_new, nbytes, nbytes, ignore).first; } - - size_type request = + + size_type request = nbytes + alignment + MinBlockSize*Alignment - BlockCtrlBytes; void *buffer = priv_allocate(boost::interprocess::allocate_new, request, request, ignore).first; if(!buffer) @@ -835,7 +835,7 @@ inline void* simple_seq_fit_impl:: char *aligned_portion = reinterpret_cast (reinterpret_cast(static_cast(buffer) + alignment - 1) & -alignment); - char *pos = ((aligned_portion - reinterpret_cast(buffer)) >= (MinBlockSize*Alignment)) ? + char *pos = ((aligned_portion - reinterpret_cast(buffer)) >= (MinBlockSize*Alignment)) ? aligned_portion : (aligned_portion + alignment); block_ctrl *first = reinterpret_cast @@ -867,7 +867,7 @@ void* simple_seq_fit_impl::priv_check_and_allocate bool found = false; if (block->m_size > upper_nunits){ - //This block is bigger than needed, split it in + //This block is bigger than needed, split it in //two blocks, the first's size will be (block->m_size-units) //the second's size (units) size_type total_size = block->m_size; @@ -918,7 +918,7 @@ void simple_seq_fit_impl::priv_deallocate(void* addr) //Let's get free block list. List is always sorted //by memory address to allow block merging. - //Pointer next always points to the first + //Pointer next always points to the first //(lower address) block block_ctrl_ptr prev = &m_header.m_root; block_ctrl_ptr pos = m_header.m_root.m_next; @@ -934,9 +934,9 @@ void simple_seq_fit_impl::priv_deallocate(void* addr) size_type total_size = Alignment*block->m_size; BOOST_ASSERT(m_header.m_allocated >= total_size); - + //Update used memory count - m_header.m_allocated -= total_size; + m_header.m_allocated -= total_size; //Let's find the previous and the next block of the block to deallocate //This ordering comparison must be done with original pointers @@ -949,7 +949,7 @@ void simple_seq_fit_impl::priv_deallocate(void* addr) //Try to combine with upper block if ((reinterpret_cast(ipcdetail::to_raw_pointer(block)) - + Alignment*block->m_size) == + + Alignment*block->m_size) == reinterpret_cast(ipcdetail::to_raw_pointer(pos))){ block->m_size += pos->m_size; @@ -961,7 +961,7 @@ void simple_seq_fit_impl::priv_deallocate(void* addr) //Try to combine with lower block if ((reinterpret_cast(ipcdetail::to_raw_pointer(prev)) - + Alignment*prev->m_size) == + + Alignment*prev->m_size) == reinterpret_cast(ipcdetail::to_raw_pointer(block))){ prev->m_size += block->m_size; prev->m_next = block->m_next; diff --git a/include/boost/interprocess/offset_ptr.hpp b/include/boost/interprocess/offset_ptr.hpp index 633aaa1..bed7ffe 100644 --- a/include/boost/interprocess/offset_ptr.hpp +++ b/include/boost/interprocess/offset_ptr.hpp @@ -284,7 +284,7 @@ class offset_ptr template offset_ptr( const offset_ptr &ptr #ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED - , typename ipcdetail::enable_if_c< ipcdetail::is_convertible::value + , typename ipcdetail::enable_if_c< ipcdetail::is_convertible::value && ipcdetail::offset_ptr_maintains_address::value >::type * = 0 #endif @@ -404,7 +404,7 @@ class offset_ptr #ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED template - typename ipcdetail::enable_if_c::value + typename ipcdetail::enable_if_c::value && !ipcdetail::offset_ptr_maintains_address::value , offset_ptr&>::type operator= (const offset_ptr &ptr) diff --git a/include/boost/interprocess/segment_manager.hpp b/include/boost/interprocess/segment_manager.hpp index 9878811..ca3d8ba 100644 --- a/include/boost/interprocess/segment_manager.hpp +++ b/include/boost/interprocess/segment_manager.hpp @@ -123,7 +123,7 @@ class segment_manager_base /// @cond //Experimental. Dont' use. - //!Allocates n_elements of elem_bytes bytes. + //!Allocates n_elements of elem_bytes bytes. //!Throws bad_alloc on failure. chain.size() is not increased on failure. void allocate_many(size_type elem_bytes, size_type n_elements, multiallocation_chain &chain) { @@ -145,7 +145,7 @@ class segment_manager_base } } - //!Allocates n_elements of elem_bytes bytes. + //!Allocates n_elements of elem_bytes bytes. //!Non-throwing version. chain.size() is not increased on failure. void allocate_many(std::nothrow_t, size_type elem_bytes, size_type n_elements, multiallocation_chain &chain) { MemoryAlgorithm::allocate_many(elem_bytes, n_elements, chain); } diff --git a/include/boost/interprocess/smart_ptr/detail/bad_weak_ptr.hpp b/include/boost/interprocess/smart_ptr/detail/bad_weak_ptr.hpp index db3bcb1..77ceda0 100644 --- a/include/boost/interprocess/smart_ptr/detail/bad_weak_ptr.hpp +++ b/include/boost/interprocess/smart_ptr/detail/bad_weak_ptr.hpp @@ -36,7 +36,7 @@ class bad_weak_ptr { return "boost::interprocess::bad_weak_ptr"; } }; -} // namespace interprocess +} // namespace interprocess } // namespace boost #include diff --git a/include/boost/interprocess/sync/detail/locks.hpp b/include/boost/interprocess/sync/detail/locks.hpp index de30d41..ddca850 100644 --- a/include/boost/interprocess/sync/detail/locks.hpp +++ b/include/boost/interprocess/sync/detail/locks.hpp @@ -25,7 +25,7 @@ class internal_mutex_lock public: typedef typename Lock::mutex_type::internal_mutex_type mutex_type; - + internal_mutex_lock(Lock &l) : l_(l) diff --git a/include/boost/interprocess/sync/interprocess_condition.hpp b/include/boost/interprocess/sync/interprocess_condition.hpp index 1581b0f..b1b05aa 100644 --- a/include/boost/interprocess/sync/interprocess_condition.hpp +++ b/include/boost/interprocess/sync/interprocess_condition.hpp @@ -59,7 +59,7 @@ class named_condition; //! //!Unlike std::condition_variable in C++11, it is NOT safe to invoke the destructor if all //!threads have been only notified. It is required that they have exited their respective wait -//!functions. +//!functions. class interprocess_condition { /// @cond @@ -94,7 +94,7 @@ class interprocess_condition //!this->notify_one() or this->notify_all(), and then reacquires the lock. template void wait(L& lock) - { + { ipcdetail::internal_mutex_lock internal_lock(lock); m_condition.wait(internal_lock); } diff --git a/include/boost/interprocess/sync/interprocess_condition_any.hpp b/include/boost/interprocess/sync/interprocess_condition_any.hpp index 3ca3320..26347aa 100644 --- a/include/boost/interprocess/sync/interprocess_condition_any.hpp +++ b/include/boost/interprocess/sync/interprocess_condition_any.hpp @@ -48,7 +48,7 @@ namespace interprocess { //! //!Unlike std::condition_variable_any in C++11, it is NOT safe to invoke the destructor if all //!threads have been only notified. It is required that they have exited their respective wait -//!functions. +//!functions. class interprocess_condition_any { /// @cond @@ -61,7 +61,7 @@ class interprocess_condition_any public: typedef interprocess_condition condvar_type; typedef interprocess_mutex mutex_type; - + condvar_type &get_condvar() { return m_cond; } mutex_type &get_mutex() { return m_mut; } diff --git a/include/boost/interprocess/sync/interprocess_upgradable_mutex.hpp b/include/boost/interprocess/sync/interprocess_upgradable_mutex.hpp index 2719212..4f18882 100644 --- a/include/boost/interprocess/sync/interprocess_upgradable_mutex.hpp +++ b/include/boost/interprocess/sync/interprocess_upgradable_mutex.hpp @@ -498,7 +498,7 @@ inline bool interprocess_upgradable_mutex::timed_lock_sharable //or there are too many sharable locks while (this->m_ctrl.exclusive_in || this->m_ctrl.num_upr_shar == constants::max_readers){ - if(!this->m_first_gate.timed_wait(lck, abs_time)){ + if(!this->m_first_gate.timed_wait(lck, abs_time)){ if(this->m_ctrl.exclusive_in || this->m_ctrl.num_upr_shar == constants::max_readers){ return false; diff --git a/include/boost/interprocess/sync/named_condition.hpp b/include/boost/interprocess/sync/named_condition.hpp index 0bf009a..93b6e5b 100644 --- a/include/boost/interprocess/sync/named_condition.hpp +++ b/include/boost/interprocess/sync/named_condition.hpp @@ -177,7 +177,7 @@ inline bool named_condition::timed_wait template inline bool named_condition::timed_wait (L& lock, const boost::posix_time::ptime &abs_time, Pr pred) -{ +{ ipcdetail::internal_mutex_lock internal_lock(lock); return m_cond.timed_wait(internal_lock, abs_time, pred); } diff --git a/include/boost/interprocess/sync/shm/named_condition.hpp b/include/boost/interprocess/sync/shm/named_condition.hpp index 1184173..8809f71 100644 --- a/include/boost/interprocess/sync/shm/named_condition.hpp +++ b/include/boost/interprocess/sync/shm/named_condition.hpp @@ -131,7 +131,7 @@ class shm_named_condition public: typedef interprocess_mutex mutex_type; typedef interprocess_condition condvar_type; - + condvar_type& get_condvar() { return m_cond; } mutex_type& get_mutex() { return m_mtx; } diff --git a/include/boost/interprocess/sync/shm/named_condition_any.hpp b/include/boost/interprocess/sync/shm/named_condition_any.hpp index cf92823..63013a8 100644 --- a/include/boost/interprocess/sync/shm/named_condition_any.hpp +++ b/include/boost/interprocess/sync/shm/named_condition_any.hpp @@ -157,7 +157,7 @@ class shm_named_condition_any public: typedef interprocess_mutex mutex_type; typedef interprocess_condition condvar_type; - + condvar_type& get_condvar() { return m_cond; } mutex_type& get_mutex() { return m_mtx; } diff --git a/include/boost/interprocess/sync/windows/winapi_mutex_wrapper.hpp b/include/boost/interprocess/sync/windows/winapi_mutex_wrapper.hpp index 1b41f1b..5a4469b 100644 --- a/include/boost/interprocess/sync/windows/winapi_mutex_wrapper.hpp +++ b/include/boost/interprocess/sync/windows/winapi_mutex_wrapper.hpp @@ -107,7 +107,7 @@ class winapi_mutex_wrapper else{ return false; } - } + } void close() { diff --git a/include/boost/interprocess/xsi_key.hpp b/include/boost/interprocess/xsi_key.hpp index ffd4c49..e772ce8 100644 --- a/include/boost/interprocess/xsi_key.hpp +++ b/include/boost/interprocess/xsi_key.hpp @@ -55,7 +55,7 @@ class xsi_key //!If the shared memory previously exists, throws an error. xsi_key(const char *path, boost::uint8_t id) { - key_t key; + key_t key; if(path){ key = ::ftok(path, id); if(((key_t)-1) == key){ diff --git a/index.html b/index.html index 83dc343..8e8e16c 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -Automatic redirection failed, please go to +Automatic redirection failed, please go to ../../doc/html/interprocess.html diff --git a/proj/to-do.txt b/proj/to-do.txt index 658f4e0..d36fbbd 100644 --- a/proj/to-do.txt +++ b/proj/to-do.txt @@ -164,7 +164,7 @@ LOCK } } } - + UNLOCK if (fixing_mode){ diff --git a/test/check_equal_containers.hpp b/test/check_equal_containers.hpp index 573657e..97df4d5 100644 --- a/test/check_equal_containers.hpp +++ b/test/check_equal_containers.hpp @@ -24,7 +24,7 @@ namespace test{ template< class T1, class T2> bool CheckEqual( const T1 &t1, const T2 &t2 , typename boost::container::container_detail::enable_if_c - ::value && + ::value && !boost::container::container_detail::is_pair::value >::type* = 0) { return t1 == t2; } @@ -32,7 +32,7 @@ bool CheckEqual( const T1 &t1, const T2 &t2 template< class Pair1, class Pair2> bool CheckEqual( const Pair1 &pair1, const Pair2 &pair2 , typename boost::container::container_detail::enable_if_c - ::value && + ::value && boost::container::container_detail::is_pair::value >::type* = 0) { diff --git a/test/message_queue_test.cpp b/test/message_queue_test.cpp index 248ec2e..c1dd0b3 100644 --- a/test/message_queue_test.cpp +++ b/test/message_queue_test.cpp @@ -281,7 +281,7 @@ static boost::interprocess::message_queue *global_queue = 0; static const int MULTI_NUM_MSG_PER_SENDER = 10000; //Message queue message capacity static const int MULTI_QUEUE_SIZE = (MULTI_NUM_MSG_PER_SENDER - 1)/MULTI_NUM_MSG_PER_SENDER + 1; -//We'll launch MULTI_THREAD_COUNT senders and MULTI_THREAD_COUNT receivers +//We'll launch MULTI_THREAD_COUNT senders and MULTI_THREAD_COUNT receivers static const int MULTI_THREAD_COUNT = 10; static void multisend() diff --git a/test/movable_int.hpp b/test/movable_int.hpp index 3f26787..2f6d854 100644 --- a/test/movable_int.hpp +++ b/test/movable_int.hpp @@ -115,7 +115,7 @@ class movable_and_copyable_int movable_and_copyable_int(const movable_and_copyable_int& mmi) : m_int(mmi.m_int) {} - + movable_and_copyable_int(BOOST_RV_REF(movable_and_copyable_int) mmi) : m_int(mmi.m_int) { mmi.m_int = 0; } @@ -189,7 +189,7 @@ class copyable_int copyable_int(const copyable_int& mmi) : m_int(mmi.m_int) {} - + copyable_int & operator= (int i) { this->m_int = i; return *this; } diff --git a/test/mutex_test_template.hpp b/test/mutex_test_template.hpp index eb96e86..f298fb8 100644 --- a/test/mutex_test_template.hpp +++ b/test/mutex_test_template.hpp @@ -250,7 +250,7 @@ void test_mutex_lock() boost::interprocess::ipcdetail::thread_launch(tm2, thread_adapter(&lock_and_sleep, &d2, mtx)); //Wait completion - + boost::interprocess::ipcdetail::thread_join(tm1); boost::interprocess::ipcdetail::thread_sleep((1000*1*BaseSeconds)); boost::interprocess::ipcdetail::thread_join(tm2); diff --git a/test/offset_ptr_test.cpp b/test/offset_ptr_test.cpp index 2d9a87e..ee9e21b 100644 --- a/test/offset_ptr_test.cpp +++ b/test/offset_ptr_test.cpp @@ -328,10 +328,10 @@ int main() using namespace boost::interprocess; typedef allocator alloc_t; - std::size_t n = 0x1 << 26; + std::size_t n = 0x1 << 26; std::size_t file_size = n * sizeof(double) + 1000000; - { + { shared_memory_object::remove("MyMappedFile"); managed_shared_memory segment(open_or_create, "MyMappedFile", file_size); shared_memory_object::remove("MyMappedFile");