xo-gc stack: refactor: introduce GCObjectVisitor facet

Plan using to properly level GCObjectStore and MutationLogStore
below Collector.

[WIP] not used yet
This commit is contained in:
Roland Conybeare 2026-04-05 18:07:14 -04:00
commit 19107fa485
7 changed files with 143 additions and 7 deletions

View file

@ -279,14 +279,10 @@ namespace xo {
**/
void forward_inplace(AGCObject * lhs_iface, void ** lhs_data);
#ifdef OBSOLETE
/** true iff {alloc_hdr, object_data} should move for
* currently-running collection.
*
* Require: runstate_.is_running()
/** Supports the GCObjectVisitor facet.
* Synonym for forward_inplace
**/
bool check_move_policy(header_type alloc_hdr, void * object_data) const noexcept;
#endif
void visit_child(AGCObject * lhs_iface, void ** lhs_data);
// ----- allocation -----

View file

@ -0,0 +1,58 @@
/** @file IGCObjectVisitor_DX1Collector.hpp
*
* Generated automagically from ingredients:
* 1. code generator:
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IGCObjectVisitor_DX1Collector.json5]
* 2. jinja2 template for abstract facet .hpp file:
* [iface_facet_repr.hpp.j2]
* 3. idl for facet methods
* [idl/IGCObjectVisitor_DX1Collector.json5]
**/
#pragma once
#include "GCObjectVisitor.hpp"
#include "DX1Collector.hpp"
namespace xo { namespace mm { class IGCObjectVisitor_DX1Collector; } }
namespace xo {
namespace facet {
template <>
struct FacetImplementation<xo::mm::AGCObjectVisitor,
xo::mm::DX1Collector>
{
using ImplType = xo::mm::IGCObjectVisitor_Xfer
<xo::mm::DX1Collector,
xo::mm::IGCObjectVisitor_DX1Collector>;
};
}
}
namespace xo {
namespace mm {
/** @class IGCObjectVisitor_DX1Collector
**/
class IGCObjectVisitor_DX1Collector {
public:
/** @defgroup mm-gcobjectvisitor-dx1collector-type-traits **/
///@{
using Copaque = xo::mm::AGCObjectVisitor::Copaque;
using Opaque = xo::mm::AGCObjectVisitor::Opaque;
///@}
/** @defgroup mm-gcobjectvisitor-dx1collector-methods **/
///@{
// const methods
// non-const methods
/** visit child of a gc-aware object. May update child in-place! **/
static void visit_child(DX1Collector & self, AGCObject * iface, void ** pp_data) noexcept;
///@}
};
} /*namespace mm*/
} /*namespace xo*/
/* end */