From bd9a2161196fcc6fdf5b3e816b824a47120dbfa4 Mon Sep 17 00:00:00 2001 From: khizmax Date: Thu, 4 Jun 2015 22:01:38 +0300 Subject: [PATCH] Fixed DHP GC initialization order Disable GC internal statistics by default --- cds/gc/details/dhp.h | 6 +++--- cds/gc/details/hp.h | 2 +- src/dhp_gc.cpp | 1 + src/hp_gc.cpp | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cds/gc/details/dhp.h b/cds/gc/details/dhp.h index 3a882e9c..ecff8506 100644 --- a/cds/gc/details/dhp.h +++ b/cds/gc/details/dhp.h @@ -727,13 +727,13 @@ namespace cds { namespace gc { private: static GarbageCollector * m_pManager ; ///< GC global instance + atomics::atomic m_nLiberateThreshold; ///< Max size of retired pointer buffer to call \p scan() + const size_t m_nInitialThreadGuardCount; ///< Initial count of guards allocated for ThreadGC + details::guard_allocator<> m_GuardPool ; ///< Guard pool details::retired_ptr_pool<> m_RetiredAllocator ; ///< Pool of free retired pointers details::retired_ptr_buffer m_RetiredBuffer ; ///< Retired pointer buffer for liberating - atomics::atomic m_nLiberateThreshold; ///< Max size of retired pointer buffer to call \p scan() - const size_t m_nInitialThreadGuardCount; ///< Initial count of guards allocated for ThreadGC - internal_stat m_stat ; ///< Internal statistics bool m_bStatEnabled ; ///< Internal Statistics enabled diff --git a/cds/gc/details/hp.h b/cds/gc/details/hp.h index 6820e255..c7065ce7 100644 --- a/cds/gc/details/hp.h +++ b/cds/gc/details/hp.h @@ -271,7 +271,7 @@ namespace cds { assert( m_idOwner.load( atomics::memory_order_relaxed ) == OS::c_NullThreadId ); assert( m_bFree.load(atomics::memory_order_relaxed) ); } - //@endcond + //@endcond }; atomics::atomic m_pListHead ; ///< Head of GC list diff --git a/src/dhp_gc.cpp b/src/dhp_gc.cpp index cd965982..4b8ec0d5 100644 --- a/src/dhp_gc.cpp +++ b/src/dhp_gc.cpp @@ -156,6 +156,7 @@ namespace cds { namespace gc { namespace dhp { GarbageCollector::GarbageCollector( size_t nLiberateThreshold, size_t nInitialThreadGuardCount ) : m_nLiberateThreshold( nLiberateThreshold ? nLiberateThreshold : 1024 ) , m_nInitialThreadGuardCount( nInitialThreadGuardCount ? nInitialThreadGuardCount : 8 ) + , m_bStatEnabled( false ) //, m_nInLiberate(0) { } diff --git a/src/hp_gc.cpp b/src/hp_gc.cpp index ae97cb3e..63270481 100644 --- a/src/hp_gc.cpp +++ b/src/hp_gc.cpp @@ -49,7 +49,7 @@ namespace cds { namespace gc { scan_type nScanType ) : m_pListHead( nullptr ) - ,m_bStatEnabled( true ) + ,m_bStatEnabled( false ) ,m_nHazardPointerCount( nHazardPtrCount == 0 ? c_nHazardPointerPerThread : nHazardPtrCount ) ,m_nMaxThreadCount( nMaxThreadCount == 0 ? c_nMaxThreadCount : nMaxThreadCount ) ,m_nMaxRetiredPtrCount( nMaxRetiredPtrCount > c_nMaxRetireNodeCount ? nMaxRetiredPtrCount : c_nMaxRetireNodeCount ) -- 2.34.1