xo-gc: bugfixes. xo-gc utests pass.

This commit is contained in:
Roland Conybeare 2026-04-25 15:50:08 -04:00
commit 866ab0503d
5 changed files with 209 additions and 122 deletions

View file

@ -10,6 +10,7 @@
namespace xo {
namespace mm {
class GCObjectStore; // see xo-gc/ GCObjectStore.hpp
class MutationLogStatistics; // see xo-gc/ MutationLogStatistics.hpp
/** @brief Track a cross-generational pointer
*
@ -38,9 +39,25 @@ namespace xo {
/** true iff child pointer matches value when this mlog entry created **/
bool is_active() const noexcept { return *p_data_ == snap_.data(); }
/** true iff child pointer has been altered since this mlog entry created **/
/** true iff child pointer has been altered since this mlog entry created
* WARNING: extra care needed around forwarding pointers
**/
bool is_superseded() const noexcept { return *p_data_ != snap_.data(); }
/** Update parent and snapshot if either has been forwarded.
* Do not try to correct *p_data_: it might now point outside
* gc-owned space, in which case need not be intelligible
**/
bool check_forward_inplace(GCObjectStore * gcos,
MutationLogStatistics * p_counters) noexcept;
/** update @ref parent_, @ref p_data_ iff parent has been forwarded
* @return true iff encountered forwarded parent
* Require: parent must be gc-owned, since we rely on AllocInfo existing
**/
bool check_forward_parent_inplace(GCObjectStore * gcos,
MutationLogStatistics * p_counters) noexcept;
/** Refresh snapshot when *p_data_ does not match snap_.data_
* Get updated facet information from destination alloc header.
* It's possible that *p_data_ no longer points to gc-owned space

View file

@ -135,6 +135,8 @@ namespace xo {
* with parent P in generation @p parent_gen:
* ensure child C is evacuated, and append @p from_entry to
* @p keep_mlog.
*
* Require: child is gc-owned
**/
MutationLogStatistics _preserve_child_of_live_parent(obj<AGCObjectVisitor> gc,
Generation upto,