rename cds::gc::hzp namespace to cds::gc::hp
[libcds.git] / tests / cppunit / test_main.cpp
index 62718278ad4cdfdfa43504f46bf8aa21b26e259e..485f95c1e6f2155c84b6e045cf067652d391d861 100644 (file)
@@ -28,8 +28,7 @@
 
 #include <cds/init.h>
 #include <cds/gc/hp.h>
-#include <cds/gc/hrc.h>
-#include <cds/gc/ptb.h>
+#include <cds/gc/dhp.h>
 #include <cds/urcu/general_instant.h>
 #include <cds/urcu/general_buffered.h>
 #include <cds/urcu/general_threaded.h>
@@ -52,7 +51,7 @@
 #endif
 
 
-std::ostream& operator << (std::ostream& s, const cds::gc::hzp::GarbageCollector::InternalState& stat)
+std::ostream& operator << (std::ostream& s, const cds::gc::hp::GarbageCollector::InternalState& stat)
 {
     s << "\nHZP GC internal state:"
         << "\n\t\tHP record allocated=" << stat.nHPRecAllocated
@@ -74,33 +73,6 @@ std::ostream& operator << (std::ostream& s, const cds::gc::hzp::GarbageCollector
     return s;
 }
 
-std::ostream& operator << (std::ostream& s, const cds::gc::hrc::GarbageCollector::internal_state& stat)
-{
-    s << "\nHRC GC internal state:"
-        << "\n\t\tHRC record allocated=" << stat.nHRCRecAllocated
-        << "\n\t\tHRC records used=" << stat.nHRCRecUsed
-        << "\n\t\tTotal retired ptr count=" << stat.nTotalRetiredPtrCount
-        << "\n\t\tRetired ptr in free HRC records=" << stat.nRetiredPtrInFreeHRCRecs
-        << "\n\tEvents:"
-        << "\n\t\tHRCrec allocations=" << stat.evcAllocHRCRec
-        << "\n\t\tHRCrec retire events=" << stat.evcRetireHRCRec
-        << "\n\t\tnew HRCrec allocations from heap=" << stat.evcAllocNewHRCRec
-        << "\n\t\tHRCrec deletions=" << stat.evcDeleteHRCRec
-        << "\n\t\tScan calling=" << stat.evcScanCall
-        << "\n\t\tHelpScan calling=" << stat.evcHelpScanCalls
-        << "\n\t\tCleanUpAll calling=" << stat.evcCleanUpAllCalls
-        << "\n\t\tretired objects deleting=" << stat.evcDeletedNode
-        << "\n\t\tguarded nodes on Scan=" << stat.evcScanGuarded
-        << "\n\t\tclaimed node on Scan=" << stat.evcScanClaimGuarded
-#ifdef _DEBUG
-        << "\n\t\tnode constructed count=" << stat.evcNodeConstruct
-        << "\n\t\tnode destructed count=" << stat.evcNodeDestruct
-#endif
-        << std::endl;
-
-    return s;
-}
-
 namespace CppUnitMini
 {
   int TestCase::m_numErrors = 0;
@@ -146,13 +118,8 @@ namespace CppUnitMini
   {
       if ( m_bPrintGCState ) {
           {
-              cds::gc::hzp::GarbageCollector::InternalState stat;
-              std::cout << cds::gc::hzp::GarbageCollector::instance().getInternalState( stat ) << std::endl;
-          }
-
-          {
-              cds::gc::hrc::GarbageCollector::internal_state stat;
-              std::cout << cds::gc::hrc::GarbageCollector::instance().getInternalState( stat ) << std::endl;
+              cds::gc::hp::GarbageCollector::InternalState stat;
+              std::cout << cds::gc::hp::GarbageCollector::instance().getInternalState( stat ) << std::endl;
           }
       }
   }
@@ -364,7 +331,6 @@ int main(int argc, char** argv)
 
       // Safe reclamation schemes
       cds::gc::HP hzpGC( nHazardPtrCount );
-      cds::gc::HRC hrcGC( nHazardPtrCount );
       cds::gc::PTB ptbGC;
 
       // RCU varieties
@@ -397,18 +363,18 @@ int main(int argc, char** argv)
         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::hzp::inplace );
+            hzpGC.setScanType( cds::gc::hp::inplace );
         else if ( strHZPScanStrategy == "classic" )
-            hzpGC.setScanType( cds::gc::hzp::classic );
+            hzpGC.setScanType( cds::gc::hp::classic );
         else {
             std::cout << "Error value of HZP_scan_strategy in General section of test config\n";
         }
 
         switch (hzpGC.getScanType()) {
-        case cds::gc::hzp::inplace:
+        case cds::gc::hp::inplace:
             std::cout << "Use in-place scan strategy for Hazard Pointer memory reclamation algorithm\n";
             break;
-        case cds::gc::hzp::classic:
+        case cds::gc::hp::classic:
             std::cout << "Use classic scan strategy for Hazard Pointer memory reclamation algorithm\n";
             break;
         default:
@@ -422,8 +388,8 @@ int main(int argc, char** argv)
       }
 
       if ( CppUnitMini::TestCase::m_bPrintGCState ) {
-        cds::gc::hzp::GarbageCollector::InternalState stat;
-        cds::gc::hzp::GarbageCollector::instance().getInternalState( stat );
+        cds::gc::hp::GarbageCollector::InternalState stat;
+        cds::gc::hp::GarbageCollector::instance().getInternalState( stat );
 
         std::cout << "HP constants:"
             << "\n\tHP count per thread=" << stat.nHPCount