diff --git a/include/xo/gc/DX1Collector.hpp b/include/xo/gc/DX1Collector.hpp index b0feefc..a582ed8 100644 --- a/include/xo/gc/DX1Collector.hpp +++ b/include/xo/gc/DX1Collector.hpp @@ -274,14 +274,6 @@ namespace xo { /** Execute gc immediately, for all generations < @p upto **/ void execute_gc(Generation upto) noexcept; - /** Supports GCObjectVisitor facet. - * During gc phase (@p reason is 'forward') - * 1. evacuate object at @p *lhs_data to to-space. - * 2. replace @p *lhs_data with forwarding pointer - * to new location. - **/ - void visit_child(VisitReason reason, AGCObject * lhs_iface, void ** lhs_data); - // ----- allocation ----- /** simple allocation. allocate @p z bytes of memory diff --git a/include/xo/gc/GCObjectStore.hpp b/include/xo/gc/GCObjectStore.hpp index 76b1597..5fdddeb 100644 --- a/include/xo/gc/GCObjectStore.hpp +++ b/include/xo/gc/GCObjectStore.hpp @@ -169,37 +169,6 @@ namespace xo { void * from_src, Generation upto); - /** Target for GCObjectVisitor facet - * During gc phase (@p reason is 'forward') - * 1. evacuate object at @p *lhs_data to to-space. - * 2. replace @p *lhs_data with forwarding pointer - * to new location. - **/ - void visit_child_aux(VisitReason reason, - AGCObject * lhs_iface, - void ** lhs_data, - Generation upto); - - /** Evacuate object at @p *lhs_data to to-space, during collection phase - * acting on generations g in [0 ,.., upto). - * Need @p gc to pass to invoke AGCObject methods shallow_copy() and - * forward_children() - * - * Replace original with forwarding pointer to new location - **/ - void forward_inplace_aux(obj gc, - AGCObject * lhs_iface, - void ** lhs_data, - Generation upto); - - /** categorize fop {@p lhs_iface, @p lhs_data} - * based on location of @p lhs_data. - * Update @ref p_verify_stats_ based on the result: - * increment exactly one of {n_from_, n_to_, n_ext_} - **/ - void verify_aux(AGCObject * lhs_iface, - void * lhs_data); - /** Cleanup at the end of a gc cycle. * Reset from-space * (current from-space is former to-space, @@ -252,6 +221,28 @@ namespace xo { AGCObject * iface, void * from_src); + /** Evacuate object at @p *lhs_data to to-space, during collection phase + * acting on generations g in [0 ,.., upto). + * Need @p gc to pass to invoke AGCObject methods shallow_copy() and + * forward_children() + * + * Replace original with forwarding pointer to new location + **/ + void _forward_inplace_aux(obj gc, + AGCObject * lhs_iface, + void ** lhs_data, + Generation upto); + + /** categorize fop {@p lhs_iface, @p lhs_data} + * based on location of @p lhs_data. + * Update @ref p_verify_stats_ based on the result: + * increment exactly one of {n_from_, n_to_, n_ext_} + **/ + void _verify_aux(AGCObject * lhs_iface, + void * lhs_data); + + friend class DGCObjectStoreVisitor; + private: /** configuration for gc-aware object store **/ GCObjectStoreConfig config_; diff --git a/src/gc/DGCObjectStoreVisitor.cpp b/src/gc/DGCObjectStoreVisitor.cpp index 9c2618d..713bf91 100644 --- a/src/gc/DGCObjectStoreVisitor.cpp +++ b/src/gc/DGCObjectStoreVisitor.cpp @@ -32,11 +32,11 @@ namespace xo { { switch (reason.code()) { case VisitReason::code::forward: - p_gco_store_->forward_inplace_aux + p_gco_store_->_forward_inplace_aux (this->ref(), lhs_iface, lhs_data, upto_); break; case VisitReason::code::verify: - p_gco_store_->verify_aux(lhs_iface, *lhs_data); + p_gco_store_->_verify_aux(lhs_iface, *lhs_data); break; default: assert(false); diff --git a/src/gc/DX1Collector.cpp b/src/gc/DX1Collector.cpp index d8f4021..6232bb3 100644 --- a/src/gc/DX1Collector.cpp +++ b/src/gc/DX1Collector.cpp @@ -587,19 +587,6 @@ namespace xo { } } - void - DX1Collector::visit_child(VisitReason reason, - AGCObject * lhs_iface, - void ** lhs_data) - { - // MAYBE: adapter distinct from DX1Collector that supports GCObjectVisitor facet, - // calls DX1Collector::_verify_aux() - - Generation upto = runstate_.gc_upto(); - - gco_store_.visit_child_aux(reason, lhs_iface, lhs_data, upto); - } - auto DX1Collector::alloc(typeseq t, size_type z) noexcept -> value_type { diff --git a/src/gc/GCObjectStore.cpp b/src/gc/GCObjectStore.cpp index 18188a4..971d053 100644 --- a/src/gc/GCObjectStore.cpp +++ b/src/gc/GCObjectStore.cpp @@ -477,38 +477,10 @@ namespace xo { } void - GCObjectStore::visit_child_aux(VisitReason reason, - AGCObject * lhs_iface, - void ** lhs_data, - Generation upto) - { - switch (reason.code()) { - case VisitReason::code::forward: - { - DGCObjectStoreVisitor gcos_visitor(this, upto); - auto gcos_visitor_obj - = obj(&gcos_visitor); - - // called during collection phase - this->forward_inplace_aux - (gcos_visitor_obj, lhs_iface, lhs_data, upto); - break; - } - case VisitReason::code::verify: - // called during verify_ok - this->verify_aux(lhs_iface, *lhs_data); - break; - default: - // should be unreachable - assert(false); - } - } - - void - GCObjectStore::forward_inplace_aux(obj gc, - AGCObject * lhs_iface, - void ** lhs_data, - Generation upto) + GCObjectStore::_forward_inplace_aux(obj gc, + AGCObject * lhs_iface, + void ** lhs_data, + Generation upto) { // upto == runstate_.gc_upto() @@ -693,7 +665,7 @@ namespace xo { } /*_forward_inplace_aux*/ void - GCObjectStore::verify_aux(AGCObject * iface, + GCObjectStore::_verify_aux(AGCObject * iface, void * data) { scope log(XO_DEBUG(config_.debug_flag_));