From c16deab464974e72f6a845e760ff7e4a11698440 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 28 Mar 2026 09:43:43 -0400 Subject: [PATCH] xo-reader2: expand utest to run gc [WIP] --- src/gc/DX1Collector.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/gc/DX1Collector.cpp b/src/gc/DX1Collector.cpp index 5119d2a..c7bd964 100644 --- a/src/gc/DX1Collector.cpp +++ b/src/gc/DX1Collector.cpp @@ -732,7 +732,8 @@ namespace xo { } void - DX1Collector::_forward_children_until_fixpoint(Generation upto, GCMoveCheckpoint gray_lo_v) + DX1Collector::_forward_children_until_fixpoint(Generation upto, + GCMoveCheckpoint gray_lo_v) { scope log(XO_DEBUG(config_.debug_flag_)); @@ -832,7 +833,7 @@ namespace xo { assert(iface->_has_null_vptr() == false); - auto gc = this->ref(); //obj gc(this); + auto gc = this->ref(); iface->forward_children(src, gc); @@ -887,7 +888,7 @@ namespace xo { { scope log(XO_DEBUG(config_.debug_flag_), xtag("lhs_data", lhs_data), - xtag("*lhs_data", *lhs_data)); + xtag("*lhs_data", lhs_data ? *lhs_data : nullptr)); /* coordinates with DX1Collector::_deep_move() */ @@ -909,7 +910,10 @@ namespace xo { void * object_data = (std::byte *)*lhs_data; - if (!this->contains(role::from_space(), object_data)) { + if (!object_data) { + /* trivial to forward nullptr */ + return; + } else if (!this->contains(role::from_space(), object_data)) { /* *lhs_data either: * 1. already in to-space * 2. not in GC-allocated space at all @@ -919,7 +923,10 @@ namespace xo { * Since not allocated from GC, they don't have * an alloc-header. */ - log && log("disposition: not in from-space"); + log && log("disposition: not in from-space. Don't forward, but check children"); + + obj gco(lhs_iface, object_data); + gco.forward_children(this->ref()); return; }