xo-gc: refactor: streamline GCObjectStore .forward_inplace_aux()

This commit is contained in:
Roland Conybeare 2026-04-03 17:05:33 -04:00
commit 95a23b0dcc
4 changed files with 13 additions and 27 deletions

View file

@ -279,13 +279,6 @@ namespace xo {
**/
void forward_inplace(AGCObject * lhs_iface, void ** lhs_data);
#ifdef OBSOLETE
/** evacuate object with type @p iface at address @p from_src
* to to-space. Return new to-space location.
**/
void * _shallow_move(const AGCObject * iface, void * from_src);
#endif
/** true iff {alloc_hdr, object_data} should move for
* currently-running collection.
*

View file

@ -173,6 +173,13 @@ namespace xo {
void * gco_data,
Generation upto) const noexcept;
public:
/** For each generation g in [0 ,.., upto)
* swap arenas assigned to {to-space, from-space}.
* Invoked once at the beginning of each gc cycle.
**/
void swap_roles(Generation upto) noexcept;
/** 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
@ -180,17 +187,11 @@ namespace xo {
*
* Replace original with forwarding pointer to new location
**/
void _forward_inplace_aux(DX1Collector * gc,
void forward_inplace_aux(DX1Collector * gc,
AGCObject * lhs_iface,
void ** lhs_data,
Generation upto);
/** For each generation g in [0 ,.., upto)
* swap arenas assigned to {to-space, from-space}.
* Invoked once at the beginning of each gc cycle.
**/
void swap_roles(Generation upto) noexcept;
/** Cleanup at the end of a gc cycle.
* Reset from-space
* (current from-space is former to-space,

View file

@ -623,7 +623,7 @@ namespace xo {
if (runstate_.is_running()) {
// called during collection phase
gco_store_._forward_inplace_aux(this, lhs_iface, lhs_data, upto);
gco_store_.forward_inplace_aux(this, lhs_iface, lhs_data, upto);
} else if (runstate_.is_verify()) {
// called during verify_ok
this->_verify_aux(lhs_iface, *lhs_data);
@ -662,14 +662,6 @@ namespace xo {
}
}
#ifdef OBSOLETE
void *
DX1Collector::_shallow_move(const AGCObject * iface, void * from_src)
{
return gco_store_._shallow_move(this, iface, from_src);
}
#endif
bool
DX1Collector::check_move_policy(header_type alloc_hdr,
void * object_data) const noexcept

View file

@ -454,10 +454,10 @@ namespace xo {
}
void
GCObjectStore::_forward_inplace_aux(DX1Collector * gc,
AGCObject * lhs_iface,
void ** lhs_data,
Generation upto)
GCObjectStore::forward_inplace_aux(DX1Collector * gc,
AGCObject * lhs_iface,
void ** lhs_data,
Generation upto)
{
// upto == runstate_.gc_upto()