Fixed DHP GC initialization order
authorkhizmax <libcds.dev@gmail.com>
Thu, 4 Jun 2015 19:01:38 +0000 (22:01 +0300)
committerkhizmax <libcds.dev@gmail.com>
Thu, 4 Jun 2015 19:01:38 +0000 (22:01 +0300)
Disable GC internal statistics by default

cds/gc/details/dhp.h
cds/gc/details/hp.h
src/dhp_gc.cpp
src/hp_gc.cpp

index 3a882e9c3fb180da942ab0c19073be06ef0923ca..ecff850692c662de37f84fd34dc2c55c324cf9b6 100644 (file)
@@ -727,13 +727,13 @@ namespace cds { namespace gc {
         private:
             static GarbageCollector * m_pManager    ;   ///< GC global instance
 
+            atomics::atomic<size_t>  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<size_t>      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
 
index 6820e2552ac05985a87ec114a82e6627738aefba..c7065ce74ea4cb21c11def460d9fb19c6599fd4b 100644 (file)
@@ -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<hplist_node *>   m_pListHead  ;  ///< Head of GC list
index cd965982b46d42fefbf58ac4c00f61b7e6ecdd87..4b8ec0d530170f2583d5d6e47a971d0058dc7986 100644 (file)
@@ -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)
     {
     }
index ae97cb3ea31ab5ac414cc4bda499cc5e5c04f1c4..632704810c451e509e18339e8a7feb359887cf99 100644 (file)
@@ -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 )