From: khizmax Date: Tue, 18 Nov 2014 09:39:06 +0000 (+0300) Subject: Merge branch 'check' into dev X-Git-Tag: v2.0.0~73 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=commitdiff_plain;h=61457ecabe339ff0f05bcb09b91ae3a2b0691f31;hp=68c4bb6ce67fc8fccf8d850868e1e95b91f334a4 Merge branch 'check' into dev --- diff --git a/cds/gc/details/hp.h b/cds/gc/details/hp.h index ab475a3a..fde65fdd 100644 --- a/cds/gc/details/hp.h +++ b/cds/gc/details/hp.h @@ -83,7 +83,7 @@ namespace cds { typedef retired_vector_impl::iterator iterator; /// Constructor - retired_vector( const cds::gc::hp::GarbageCollector& HzpMgr ) CDS_NOEXCEPT; // inline + retired_vector( const cds::gc::hp::GarbageCollector& HzpMgr ); // inline ~retired_vector() {} @@ -110,7 +110,7 @@ namespace cds { } /// Pushes retired pointer to the vector - void push( const retired_ptr& p ) + void push( retired_ptr const& p ) { assert( m_nSize < capacity() ); m_arr[ m_nSize ] = p; @@ -707,9 +707,9 @@ namespace cds { //@cond // Inlines namespace cds { - namespace gc{ namespace hp { namespace details { + namespace gc { namespace hp { namespace details { - inline retired_vector::retired_vector( const cds::gc::hp::GarbageCollector& HzpMgr ) CDS_NOEXCEPT + inline retired_vector::retired_vector( const cds::gc::hp::GarbageCollector& HzpMgr ) : m_arr( HzpMgr.getMaxRetiredPtrCount() ), m_nSize(0) {} @@ -719,8 +719,8 @@ namespace cds { m_arrRetired( HzpMgr ) {} - }}} // namespace gc::hp::details -} // namespace cds + }}} // namespace gc::hp::details +} // namespace cds //@endcond diff --git a/cds/gc/details/hp_alloc.h b/cds/gc/details/hp_alloc.h index 0d748cbc..ae0ac409 100644 --- a/cds/gc/details/hp_alloc.h +++ b/cds/gc/details/hp_alloc.h @@ -231,7 +231,7 @@ namespace cds { } /// Allocates hazard pointer - atomic_hazard_ptr& alloc() CDS_NOEXCEPT + atomic_hazard_ptr& alloc() { assert( m_nTop > 0 ); --m_nTop; @@ -252,7 +252,7 @@ namespace cds { Returns initialized object \p arr */ template - void alloc( hp_array& arr ) CDS_NOEXCEPT + void alloc( hp_array& arr ) { assert( m_nTop >= Count ); m_nTop -= Count; diff --git a/cds/gc/impl/dhp_decl.h b/cds/gc/impl/dhp_decl.h index e51554c7..a7fd2def 100644 --- a/cds/gc/impl/dhp_decl.h +++ b/cds/gc/impl/dhp_decl.h @@ -109,7 +109,7 @@ namespace cds { namespace gc { public: // Default ctor - Guard() CDS_NOEXCEPT; // inline in dhp_impl.h + Guard(); // inline in dhp_impl.h //@cond Guard( Guard const& ) = delete; @@ -126,7 +126,7 @@ namespace cds { namespace gc { to the HP slot repeatedly until the guard's value equals \p toGuard */ template - T protect( atomics::atomic const& toGuard ) CDS_NOEXCEPT + T protect( atomics::atomic const& toGuard ) { T pCur = toGuard.load(atomics::memory_order_relaxed); T pRet; @@ -174,13 +174,13 @@ namespace cds { namespace gc { or for already guarded pointer. */ template - T * assign( T * p ) CDS_NOEXCEPT + T * assign( T * p ) { return base_class::operator =(p); } //@cond - std::nullptr_t assign( std::nullptr_t ) CDS_NOEXCEPT + std::nullptr_t assign( std::nullptr_t ) { return base_class::operator =(nullptr); } @@ -193,32 +193,32 @@ namespace cds { namespace gc { or for already guarded pointer. */ template - T * assign( cds::details::marked_ptr p ) CDS_NOEXCEPT + T * assign( cds::details::marked_ptr p ) { return base_class::operator =( p.ptr() ); } /// Copy from \p src guard to \p this guard - void copy( Guard const& src ) CDS_NOEXCEPT + void copy( Guard const& src ) { assign( src.get_native() ); } /// Clears value of the guard - void clear() CDS_NOEXCEPT + void clear() { base_class::clear(); } /// Gets the value currently protected (relaxed read) template - T * get() const CDS_NOEXCEPT + T * get() const { return reinterpret_cast( get_native() ); } /// Gets native guarded pointer stored - guarded_pointer get_native() const CDS_NOEXCEPT + guarded_pointer get_native() const { return base_class::get_guard()->pPost.load(atomics::memory_order_relaxed); } @@ -248,7 +248,7 @@ namespace cds { namespace gc { public: // Default ctor - GuardArray() CDS_NOEXCEPT; // inline in dhp_impl.h + GuardArray(); // inline in dhp_impl.h //@cond GuardArray( GuardArray const& ) = delete; @@ -265,7 +265,7 @@ namespace cds { namespace gc { to the slot \p nIndex repeatedly until the guard's value equals \p toGuard */ template - T protect( size_t nIndex, atomics::atomic const& toGuard ) CDS_NOEXCEPT + T protect( size_t nIndex, atomics::atomic const& toGuard ) { T pRet; do { @@ -308,7 +308,7 @@ namespace cds { namespace gc { The function is just an assignment, no loop is performed. */ template - T * assign( size_t nIndex, T * p ) CDS_NOEXCEPT + T * assign( size_t nIndex, T * p ) { base_class::set(nIndex, p); return p; @@ -321,44 +321,44 @@ namespace cds { namespace gc { or for already guarded pointer. */ template - T * assign( size_t nIndex, cds::details::marked_ptr p ) CDS_NOEXCEPT + T * assign( size_t nIndex, cds::details::marked_ptr p ) { return assign( nIndex, p.ptr() ); } /// Copy guarded value from \p src guard to slot at index \p nIndex - void copy( size_t nIndex, Guard const& src ) CDS_NOEXCEPT + void copy( size_t nIndex, Guard const& src ) { assign( nIndex, src.get_native() ); } /// Copy guarded value from slot \p nSrcIndex to slot at index \p nDestIndex - void copy( size_t nDestIndex, size_t nSrcIndex ) CDS_NOEXCEPT + void copy( size_t nDestIndex, size_t nSrcIndex ) { assign( nDestIndex, get_native( nSrcIndex )); } /// Clear value of the slot \p nIndex - void clear( size_t nIndex ) CDS_NOEXCEPT + void clear( size_t nIndex ) { base_class::clear( nIndex ); } /// Get current value of slot \p nIndex template - T * get( size_t nIndex ) const CDS_NOEXCEPT + T * get( size_t nIndex ) const { return reinterpret_cast( get_native( nIndex ) ); } /// Get native guarded pointer stored - guarded_pointer get_native( size_t nIndex ) const CDS_NOEXCEPT + guarded_pointer get_native( size_t nIndex ) const { return base_class::operator[](nIndex).get_guard()->pPost.load(atomics::memory_order_relaxed); } /// Capacity of the guard array - static CDS_CONSTEXPR size_t capacity() CDS_NOEXCEPT + static CDS_CONSTEXPR size_t capacity() { return Count; } diff --git a/cds/gc/impl/dhp_impl.h b/cds/gc/impl/dhp_impl.h index 834330b8..f4535bd5 100644 --- a/cds/gc/impl/dhp_impl.h +++ b/cds/gc/impl/dhp_impl.h @@ -23,12 +23,12 @@ namespace cds { namespace gc { cds::threading::Manager::detachThread(); } - inline DHP::Guard::Guard() CDS_NOEXCEPT + inline DHP::Guard::Guard() : Guard::base_class( cds::threading::getGC() ) {} - template - inline DHP::GuardArray::GuardArray() CDS_NOEXCEPT + template + inline DHP::GuardArray::GuardArray() : GuardArray::base_class( cds::threading::getGC() ) {} diff --git a/cds/gc/impl/hp_decl.h b/cds/gc/impl/hp_decl.h index c139736a..28c3d5b9 100644 --- a/cds/gc/impl/hp_decl.h +++ b/cds/gc/impl/hp_decl.h @@ -110,7 +110,7 @@ namespace cds { namespace gc { public: /// Default ctor - Guard() CDS_NOEXCEPT; // inline in hp_impl.h + Guard(); // inline in hp_impl.h //@cond Guard( Guard const& ) = delete; @@ -127,7 +127,7 @@ namespace cds { namespace gc { to the HP slot repeatedly until the guard's value equals \p toGuard */ template - T protect( atomics::atomic const& toGuard ) CDS_NOEXCEPT + T protect( atomics::atomic const& toGuard ) { T pCur = toGuard.load(atomics::memory_order_relaxed); T pRet; @@ -174,20 +174,20 @@ namespace cds { namespace gc { Can be used for a pointer that cannot be changed concurrently */ template - T * assign( T * p ) CDS_NOEXCEPT + T * assign( T * p ) { return base_class::operator =(p); } //@cond - std::nullptr_t assign( std::nullptr_t ) CDS_NOEXCEPT + std::nullptr_t assign( std::nullptr_t ) { return base_class::operator =(nullptr); } //@endcond /// Copy from \p src guard to \p this guard - void copy( Guard const& src ) CDS_NOEXCEPT + void copy( Guard const& src ) { assign( src.get_native() ); } @@ -198,26 +198,26 @@ namespace cds { namespace gc { Can be used for a marked pointer that cannot be changed concurrently. */ template - T * assign( cds::details::marked_ptr p ) CDS_NOEXCEPT + T * assign( cds::details::marked_ptr p ) { return base_class::operator =( p.ptr() ); } /// Clear value of the guard - void clear() CDS_NOEXCEPT + void clear() { assign( nullptr ); } /// Get the value currently protected template - T * get() const CDS_NOEXCEPT + T * get() const { return reinterpret_cast( get_native() ); } /// Get native hazard pointer stored - guarded_pointer get_native() const CDS_NOEXCEPT + guarded_pointer get_native() const { return base_class::get(); } @@ -247,7 +247,7 @@ namespace cds { namespace gc { public: /// Default ctor - GuardArray() CDS_NOEXCEPT; // inline in hp_impl.h + GuardArray(); // inline in hp_impl.h //@cond GuardArray( GuardArray const& ) = delete; @@ -264,7 +264,7 @@ namespace cds { namespace gc { to the slot \p nIndex repeatedly until the guard's value equals \p toGuard */ template - T protect( size_t nIndex, atomics::atomic const& toGuard ) CDS_NOEXCEPT + T protect( size_t nIndex, atomics::atomic const& toGuard ) { T pRet; do { @@ -307,7 +307,7 @@ namespace cds { namespace gc { The function equals to a simple assignment, no loop is performed. */ template - T * assign( size_t nIndex, T * p ) CDS_NOEXCEPT + T * assign( size_t nIndex, T * p ) { base_class::set(nIndex, p); return p; @@ -319,44 +319,44 @@ namespace cds { namespace gc { Can be used for a marked pointer that cannot be changed concurrently. */ template - T * assign( size_t nIndex, cds::details::marked_ptr p ) CDS_NOEXCEPT + T * assign( size_t nIndex, cds::details::marked_ptr p ) { return assign( nIndex, p.ptr() ); } /// Copy guarded value from \p src guard to slot at index \p nIndex - void copy( size_t nIndex, Guard const& src ) CDS_NOEXCEPT + void copy( size_t nIndex, Guard const& src ) { assign( nIndex, src.get_native() ); } /// Copy guarded value from slot \p nSrcIndex to slot at index \p nDestIndex - void copy( size_t nDestIndex, size_t nSrcIndex ) CDS_NOEXCEPT + void copy( size_t nDestIndex, size_t nSrcIndex ) { assign( nDestIndex, get_native( nSrcIndex )); } /// Clear value of the slot \p nIndex - void clear( size_t nIndex ) CDS_NOEXCEPT + void clear( size_t nIndex ) { base_class::clear( nIndex ); } /// Get current value of slot \p nIndex template - T * get( size_t nIndex ) const CDS_NOEXCEPT + T * get( size_t nIndex ) const { return reinterpret_cast( get_native( nIndex ) ); } /// Get native hazard pointer stored - guarded_pointer get_native( size_t nIndex ) const CDS_NOEXCEPT + guarded_pointer get_native( size_t nIndex ) const { return base_class::operator[](nIndex).get(); } /// Capacity of the guard array - static CDS_CONSTEXPR size_t capacity() CDS_NOEXCEPT + static CDS_CONSTEXPR size_t capacity() { return Count; } @@ -447,7 +447,7 @@ namespace cds { namespace gc { Deleting the pointer is the function \p pFunc call. */ template - static void retire( T * p, void (* pFunc)(T *) ) ; // inline in hp_impl.h + static void retire( T * p, void (* pFunc)(T *) ); // inline in hp_impl.h /// Retire pointer \p p with functor of type \p Disposer /** @@ -499,7 +499,7 @@ namespace cds { namespace gc { \endcode */ template - static void retire( T * p ) ; // inline in hp_impl.h + static void retire( T * p ); // inline in hp_impl.h /// Get current scan strategy static scan_type getScanType() diff --git a/cds/gc/impl/hp_impl.h b/cds/gc/impl/hp_impl.h index 870b348f..2b631897 100644 --- a/cds/gc/impl/hp_impl.h +++ b/cds/gc/impl/hp_impl.h @@ -24,12 +24,12 @@ namespace cds { namespace gc { cds::threading::Manager::detachThread(); } - inline HP::Guard::Guard() CDS_NOEXCEPT + inline HP::Guard::Guard() : Guard::base_class( cds::threading::getGC() ) {} template - inline HP::GuardArray::GuardArray() CDS_NOEXCEPT + inline HP::GuardArray::GuardArray() : GuardArray::base_class( cds::threading::getGC() ) {}