xo-gc: streamlining/simplifying

This commit is contained in:
Roland Conybeare 2026-04-03 17:29:18 -04:00
commit eba7219593
7 changed files with 30 additions and 44 deletions

View file

@ -382,9 +382,7 @@ namespace xo {
/** if > 0: need gc for all generations < gc_pending_upto_ **/
Generation gc_pending_upto_;
/** using arena to get extensible list of root objects.
* For each root store one address (type obj<AGCObject>*)
*
/**
* An Object x that supports AGCObject, but doesn't live in gc-space,
* will get special treatment if it appears in root_set_:
* collector will traverse x to forward pointers to gc-owned
@ -410,7 +408,7 @@ namespace xo {
GCObjectStore gco_store_;
/** counters collected during @ref verify_ok call **/
VerifyStats verify_stats_;
X1VerifyStats verify_stats_;
};
} /*namespace mm*/
} /*namespace xo*/

View file

@ -131,22 +131,6 @@ namespace xo {
obj<AGCObject> from_src,
Generation upto);
/** move interior subgraph at @p from_src to to-space.
* no-op if not in gc-space.
**/
void * _deep_move_interior(DX1Collector * gc,
void * from_src,
Generation upto);
/** Common driver for _deep_move_root(), _deep_move_interior().
* Move object subgraph @p from_src on behalf of @p gc collection cycle,
* covering generations in [0 ,.., upto).
**/
void * _deep_move_gc_owned(DX1Collector * gc,
void * from_src,
Generation upto);
private:
public:
/** For each generation g in [0 ,.., upto)
* swap arenas assigned to {to-space, from-space}.
@ -154,6 +138,15 @@ namespace xo {
**/
void swap_roles(Generation upto) noexcept;
/** move interior subgraph at @p from_src to to-space.
* no-op if not in gc-space.
*
* NOTE: load-bearing for MutationLogStore
**/
void * deep_move_interior(DX1Collector * gc,
void * from_src,
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
@ -192,6 +185,14 @@ namespace xo {
void * gco_data,
Generation upto) const noexcept;
/** Common driver for _deep_move_root(), _deep_move_interior().
* Move object subgraph @p from_src on behalf of @p gc collection cycle,
* covering generations in [0 ,.., upto).
**/
void * _deep_move_gc_owned(DX1Collector * gc,
void * from_src,
Generation upto);
/** traverse objects allocated after @p ckp, to make sure their children
* are forwarded. Repeat until traverse doesn't find any unforwarded children.
*

View file

@ -16,7 +16,7 @@
namespace xo {
namespace mm {
class DX1Collector;
class VerifyStats;
class X1VerifyStats;
/** @brief container for X1 collector mutation logs
**/
@ -45,7 +45,7 @@ namespace xo {
* Update counters in @p *p_verify_stats.
**/
void verify_ok(GCObjectStore * gc,
VerifyStats * p_verify_stats) noexcept;
X1VerifyStats * p_verify_stats) noexcept;
/** Append a single mutation to log for generation @p dest_g
* Mutation modifies @p parent at address @p addr,

View file

@ -13,13 +13,13 @@ namespace xo {
/** @brief info collected during a @ref DX1Collector::verify_ok call
* (or @ref MutationLogState::verify_ok call)
**/
class VerifyStats {
class X1VerifyStats {
public:
bool is_ok() const noexcept {
return (n_from_ == 0) && (n_fwd_ == 0) && (n_no_iface_ == 0);
}
void clear() { *this = VerifyStats(); }
void clear() { *this = X1VerifyStats(); }
/** number of gc roots examined **/
std::uint32_t n_gc_root_ = 0;