X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=blobdiff_plain;f=cds%2Fgc%2Fimpl%2Fhp_decl.h;h=2524ddb91e6087d5f6149da6af4a11001510d17a;hp=2beb88af61ba307007209e14f9f3eac7675677b2;hb=408a5149e52b7f2d2b49a745bd2c0123f3f97873;hpb=ef671b8b2db9357d83de1a0fae3044f1d2b9d6f7 diff --git a/cds/gc/impl/hp_decl.h b/cds/gc/impl/hp_decl.h index 2beb88af..2524ddb9 100644 --- a/cds/gc/impl/hp_decl.h +++ b/cds/gc/impl/hp_decl.h @@ -1,7 +1,7 @@ //$$CDS-header$$ -#ifndef __CDS_GC_HP_HP_DECL_H -#define __CDS_GC_HP_HP_DECL_H +#ifndef __CDS_GC_IMPL_HP_DECL_H +#define __CDS_GC_IMPL_HP_DECL_H #include // overflow_error #include @@ -360,6 +360,11 @@ namespace cds { namespace gc { }; public: + /// \p scan() type + enum class scan_type { + classic = hp::classic, ///< classic scan as described in Michael's papers + inplace = hp::inplace ///< inplace scan without allocation + }; /// Initializes hp::GarbageCollector singleton /** The constructor initializes GC singleton with passed parameters. @@ -378,14 +383,14 @@ namespace cds { namespace gc { size_t nHazardPtrCount = 0, ///< Hazard pointer count per thread size_t nMaxThreadCount = 0, ///< Max count of simultaneous working thread in your application size_t nMaxRetiredPtrCount = 0, ///< Capacity of the array of retired objects for the thread - hp::scan_type nScanType = hp::inplace ///< Scan type (see \ref hp::scan_type enum) + scan_type nScanType = scan_type::inplace ///< Scan type (see \p scan_type enum) ) { hp::GarbageCollector::Construct( nHazardPtrCount, nMaxThreadCount, nMaxRetiredPtrCount, - nScanType + static_cast(nScanType) ); } @@ -494,17 +499,17 @@ namespace cds { namespace gc { static void retire( T * p ) ; // inline in hp_impl.h /// Get current scan strategy - hp::scan_type getScanType() const + scan_type getScanType() const { - return hp::GarbageCollector::instance().getScanType(); + return static_cast( hp::GarbageCollector::instance().getScanType()); } /// Set current scan strategy void setScanType( - hp::scan_type nScanType ///< new scan strategy + scan_type nScanType ///< new scan strategy ) { - hp::GarbageCollector::instance().setScanType( nScanType ); + hp::GarbageCollector::instance().setScanType( static_cast(nScanType) ); } /// Checks if Hazard Pointer GC is constructed and may be used @@ -513,7 +518,6 @@ namespace cds { namespace gc { return hp::GarbageCollector::isUsed(); } - /// Forced GC cycle call for current thread /** Usually, this function should not be called directly. @@ -528,4 +532,4 @@ namespace cds { namespace gc { }; }} // namespace cds::gc -#endif // #ifndef __CDS_GC_HP_HP_DECL_H +#endif // #ifndef __CDS_GC_IMPL_HP_DECL_H