From a6d23ddb832e1b8c6384231d16b1cdfa54d088e5 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 7 Apr 2026 21:16:55 -0400 Subject: [PATCH] xo-gc: retire Collector.forward_inplace + mock x-gc utest W/ MockCollector supporting AGCObjectVisitor facet --- idl/Collector.json5 | 39 ++++++++++++------------ include/xo/alloc2/gc/ACollector.hpp | 6 ---- include/xo/alloc2/gc/ICollector_Any.hpp | 1 - include/xo/alloc2/gc/ICollector_Xfer.hpp | 3 -- include/xo/alloc2/gc/RCollector.hpp | 3 -- src/alloc2/facet/ICollector_Any.cpp | 6 ---- 6 files changed, 20 insertions(+), 38 deletions(-) diff --git a/idl/Collector.json5 b/idl/Collector.json5 index 99904f8..3912ecd 100644 --- a/idl/Collector.json5 +++ b/idl/Collector.json5 @@ -283,25 +283,26 @@ noexcept: false, attributes: [], }, - // void forward_inplace(AGCObject * lhs_iface, void ** lhs_data); - { - name: "forward_inplace", - doc: [ - "evacuate @p *lhs, that refers to state with interface @p lhs_iface,", - "to collector @p d's to-space. Replace *lhs_data with forwarding pointer", - "", - "Require: gc in progress", - "", - ], - return_type: "void", - args: [ - {type: "AGCObject *", name: "lhs_iface"}, - {type: "void **", name: "lhs_data"}, - ], - const: false, - noexcept: false, - attributes: [], - }, + // obsolete. use GCObjectVisitor.visit_child() +// // void forward_inplace(AGCObject * lhs_iface, void ** lhs_data); +// { +// name: "forward_inplace", +// doc: [ +// "evacuate @p *lhs, that refers to state with interface @p lhs_iface,", +// "to collector @p d's to-space. Replace *lhs_data with forwarding pointer", +// "", +// "Require: gc in progress", +// "", +// ], +// return_type: "void", +// args: [ +// {type: "AGCObject *", name: "lhs_iface"}, +// {type: "void **", name: "lhs_data"}, +// ], +// const: false, +// noexcept: false, +// attributes: [], +// }, ], router_facet_explicit_content: [ "/** convenience template for gc object copy **/", diff --git a/include/xo/alloc2/gc/ACollector.hpp b/include/xo/alloc2/gc/ACollector.hpp index 8d23384..2765c6b 100644 --- a/include/xo/alloc2/gc/ACollector.hpp +++ b/include/xo/alloc2/gc/ACollector.hpp @@ -123,12 +123,6 @@ Require: gc not in progress **/ Source must be owned by this collector. Increments object age **/ virtual void * alloc_copy(Opaque data, std::byte * src) = 0; - /** evacuate @p *lhs, that refers to state with interface @p lhs_iface, -to collector @p d's to-space. Replace *lhs_data with forwarding pointer - -Require: gc in progress - **/ - virtual void forward_inplace(Opaque data, AGCObject * lhs_iface, void ** lhs_data) = 0; ///@} }; /*ACollector*/ diff --git a/include/xo/alloc2/gc/ICollector_Any.hpp b/include/xo/alloc2/gc/ICollector_Any.hpp index 0a14751..f4ab6bb 100644 --- a/include/xo/alloc2/gc/ICollector_Any.hpp +++ b/include/xo/alloc2/gc/ICollector_Any.hpp @@ -76,7 +76,6 @@ namespace mm { [[noreturn]] void request_gc(Opaque, Generation) override; [[noreturn]] void assign_member(Opaque, void *, obj *, obj &) override; [[noreturn]] void * alloc_copy(Opaque, std::byte *) override; - [[noreturn]] void forward_inplace(Opaque, AGCObject *, void **) override; ///@} diff --git a/include/xo/alloc2/gc/ICollector_Xfer.hpp b/include/xo/alloc2/gc/ICollector_Xfer.hpp index 1a36823..50802f9 100644 --- a/include/xo/alloc2/gc/ICollector_Xfer.hpp +++ b/include/xo/alloc2/gc/ICollector_Xfer.hpp @@ -93,9 +93,6 @@ namespace mm { void * alloc_copy(Opaque data, std::byte * src) override { return I::alloc_copy(_dcast(data), src); } - void forward_inplace(Opaque data, AGCObject * lhs_iface, void ** lhs_data) override { - return I::forward_inplace(_dcast(data), lhs_iface, lhs_data); - } ///@} diff --git a/include/xo/alloc2/gc/RCollector.hpp b/include/xo/alloc2/gc/RCollector.hpp index ac66a26..b7c54d4 100644 --- a/include/xo/alloc2/gc/RCollector.hpp +++ b/include/xo/alloc2/gc/RCollector.hpp @@ -142,9 +142,6 @@ public: void * alloc_copy(std::byte * src) { return O::iface()->alloc_copy(O::data(), src); } - void forward_inplace(AGCObject * lhs_iface, void ** lhs_data) { - return O::iface()->forward_inplace(O::data(), lhs_iface, lhs_data); - } ///@} /** @defgroup mm-collector-member-vars **/ diff --git a/src/alloc2/facet/ICollector_Any.cpp b/src/alloc2/facet/ICollector_Any.cpp index 269d95b..2743bfb 100644 --- a/src/alloc2/facet/ICollector_Any.cpp +++ b/src/alloc2/facet/ICollector_Any.cpp @@ -71,12 +71,6 @@ ICollector_Any::alloc_copy(Opaque, std::byte *) -> void * _fatal(); } -auto -ICollector_Any::forward_inplace(Opaque, AGCObject *, void **) -> void -{ - _fatal(); -} - } /*namespace mm*/ } /*namespace xo*/