3 #ifndef __CDS_GC_IMPL_HP_IMPL_H
4 #define __CDS_GC_IMPL_HP_IMPL_H
6 #include <cds/threading/model.h>
7 #include <cds/details/static_functor.h>
10 namespace cds { namespace gc {
12 inline HP::thread_gc::thread_gc(
15 : m_bPersistent( bPersistent )
17 if ( !threading::Manager::isThreadAttached() )
18 threading::Manager::attachThread();
21 inline HP::thread_gc::~thread_gc()
24 cds::threading::Manager::detachThread();
27 inline /*static*/ cds::gc::hp::details::hp_guard& HP::thread_gc::alloc_guard()
29 return cds::threading::getGC<HP>().allocGuard();
32 inline /*static*/ void HP::thread_gc::free_guard( cds::gc::hp::details::hp_guard& g )
34 cds::threading::getGC<HP>().freeGuard( g );
37 inline HP::Guard::Guard()
38 : Guard::base_class( cds::threading::getGC<HP>() )
41 template <size_t COUNT>
42 inline HP::GuardArray<COUNT>::GuardArray()
43 : GuardArray::base_class( cds::threading::getGC<HP>() )
47 inline void HP::retire( T * p, void (* pFunc)(T *) )
49 cds::threading::getGC<HP>().retirePtr( p, pFunc );
52 template <class Disposer, typename T>
53 inline void HP::retire( T * p )
55 cds::threading::getGC<HP>().retirePtr( p, cds::details::static_functor<Disposer, T>::call );
58 inline void HP::scan()
60 cds::threading::getGC<HP>().scan();
63 }} // namespace cds::gc
66 #endif // #ifndef __CDS_GC_IMPL_HP_IMPL_H