#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>
#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
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;
{
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;
}
}
}
// Safe reclamation schemes
cds::gc::HP hzpGC( nHazardPtrCount );
- cds::gc::HRC hrcGC( nHazardPtrCount );
cds::gc::PTB ptbGC;
// RCU varieties
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:
}
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