atomics::atomic<size_t> m_nItemCount; ///< buffer's item count
public:
- CDS_CONSTEXPR retired_ptr_buffer() CDS_NOEXCEPT
+ retired_ptr_buffer() CDS_NOEXCEPT
: m_pHead( nullptr )
, m_nItemCount(0)
{}
ThreadGC& m_gc ; ///< ThreadGC object of current thread
public:
/// Allocates a guard from \p gc GC. \p gc must be ThreadGC object of current thread
- Guard( ThreadGC& gc ) CDS_NOEXCEPT;
+ Guard( ThreadGC& gc );
/// Returns guard allocated back to pool of free guards
- ~Guard() CDS_NOEXCEPT; // inline after GarbageCollector
+ ~Guard(); // inline after GarbageCollector
/// Returns DHP GC object
ThreadGC& getGC() CDS_NOEXCEPT
public:
/// Allocates array of guards from \p gc which must be the ThreadGC object of current thread
- GuardArray( ThreadGC& gc ) CDS_NOEXCEPT; // inline below
+ GuardArray( ThreadGC& gc ); // inline below
/// The object is not default-constructible
GuardArray() = delete;
GuardArray( GuardArray const& ) = delete;
/// Returns guards allocated back to pool
- ~GuardArray() CDS_NOEXCEPT; // inline below
+ ~GuardArray(); // inline below
/// Returns the capacity of array
CDS_CONSTEXPR size_t capacity() const CDS_NOEXCEPT
Really, the result of <tt> f( toGuard.load() ) </tt> is assigned to the hazard pointer.
*/
template <typename T, class Func>
- T protect( atomics::atomic<T> const& toGuard, Func f ) CDS_NOEXCEPT_( f( toGuard.load( atomics::memory_order_relaxed )))
+ T protect( atomics::atomic<T> const& toGuard, Func f ) CDS_NOEXCEPT_( noexcept( Func( atomics::atomic<T>().load(atomics::memory_order_relaxed))))
{
T pCur = toGuard.load(atomics::memory_order_relaxed);
T pRet;
Actually, the result of <tt> f( toGuard.load() ) </tt> is assigned to the hazard pointer.
*/
template <typename T, class Func>
- T protect( size_t nIndex, atomics::atomic<T> const& toGuard, Func f ) CDS_NOEXCEPT_( f( toGuard.load( atomics::memory_order_relaxed )))
+ T protect( size_t nIndex, atomics::atomic<T> const& toGuard, Func f ) CDS_NOEXCEPT_( noexcept( Func( atomics::atomic<T>().load(atomics::memory_order_relaxed))))
{
T pRet;
do {
/// Checks if count of hazard pointer is no less than \p nCountNeeded
/**
The function always returns \p true since the guard count is unlimited for
- DHP garbage collector.
+ \p gc::DHP garbage collector.
*/
- static CDS_CONSTEXPR bool check_available_guards( size_t nCountNeeded, bool /*bRaiseException*/ = true )
+ static CDS_CONSTEXPR bool check_available_guards(
+#ifdef CDS_DOXYGEN_INVOKED
+ size_t nCountNeeded,
+#else
+ size_t,
+#endif
+ bool /*bRaiseException*/ = true )
{
- CDS_UNUSED( nCountNeeded );
return true;
}
Really, the result of <tt> f( toGuard.load() ) </tt> is assigned to the hazard pointer.
*/
template <typename T, class Func>
- T protect( atomics::atomic<T> const& toGuard, Func f ) CDS_NOEXCEPT_( f( toGuard.load( atomics::memory_order_relaxed ) ) )
+ T protect( atomics::atomic<T> const& toGuard, Func f ) CDS_NOEXCEPT_( noexcept( Func( atomics::atomic<T>().load(atomics::memory_order_relaxed))))
{
T pCur = toGuard.load(atomics::memory_order_relaxed);
T pRet;
Really, the result of <tt> f( toGuard.load() ) </tt> is assigned to the hazard pointer.
*/
template <typename T, class Func>
- T protect( size_t nIndex, atomics::atomic<T> const& toGuard, Func f ) CDS_NOEXCEPT_( f( toGuard.load( atomics::memory_order_acquire )))
+ T protect( size_t nIndex, atomics::atomic<T> const& toGuard, Func f ) CDS_NOEXCEPT_( noexcept( Func( atomics::atomic<T>().load(atomics::memory_order_relaxed))))
{
T pRet;
do {
cds::threading::Manager::detachThread();
}
- inline HP::Guard::Guard() CDS_CONSTEXPR
+ inline HP::Guard::Guard() CDS_NOEXCEPT
: Guard::base_class( cds::threading::getGC<HP>() )
{}
template <size_t COUNT>
- inline HP::GuardArray<COUNT>::GuardArray() CDS_CONSTEXPR
+ inline HP::GuardArray<COUNT>::GuardArray() CDS_NOEXCEPT
: GuardArray::base_class( cds::threading::getGC<HP>() )
{}
CppUnitMini::TestCfg& cfg = CppUnitMini::TestCase::m_Cfg.get( "General" );
std::string strHZPScanStrategy = cfg.get( "HZP_scan_strategy", std::string("classic") );
if ( strHZPScanStrategy == "inplace" )
- hzpGC.setScanType( cds::gc::hp::inplace );
+ hzpGC.setScanType( cds::gc::HP::scan_type::inplace );
else if ( strHZPScanStrategy == "classic" )
- hzpGC.setScanType( cds::gc::hp::classic );
+ hzpGC.setScanType( cds::gc::HP::scan_type::classic );
else {
std::cout << "Error value of HZP_scan_strategy in General section of test config\n";
}
switch (hzpGC.getScanType()) {
- case cds::gc::hp::inplace:
+ case cds::gc::HP::scan_type::inplace:
std::cout << "Use in-place scan strategy for Hazard Pointer memory reclamation algorithm\n";
break;
- case cds::gc::hp::classic:
+ case cds::gc::HP::scan_type::classic:
std::cout << "Use classic scan strategy for Hazard Pointer memory reclamation algorithm\n";
break;
default: