refactor: use GCObjectVisitor api w/ gco_shallow_move

This commit is contained in:
Roland Conybeare 2026-04-06 15:21:48 -04:00
commit e95353f1c8
169 changed files with 391 additions and 402 deletions

View file

@ -64,11 +64,14 @@
nonconst_methods: [ nonconst_methods: [
// Opaque shallow_move(obj<ACollector>) noexcept // Opaque shallow_move(obj<ACollector>) noexcept
{ {
name: "shallow_move", name: "gco_shallow_move",
doc: ["move instance using collector"], doc: [
"move instance using object visitor.",
"Arguably abusing the word 'visitor' here",
],
return_type: "Opaque", return_type: "Opaque",
args:[ args:[
{type: "obj<ACollector>", name: "gc"}, {type: "obj<AGCObjectVisitor>", name: "gc"},
], ],
const: true, const: true,
noexcept: true, noexcept: true,

View file

@ -88,9 +88,25 @@
}, },
], ],
router_facet_explicit_content: [ router_facet_explicit_content: [
"/** convenience: allocate copy for typed pointer **/",
"template <typename T>",
"void * alloc_copy_for(const T * src) noexcept {",
" return O::iface()->alloc_copy(O::data(), (std::byte *)const_cast<T *>(src));",
"}",
"", "",
"/** visit forward faceted object child pointer in place.", "/** convenience: move typed pointer **/",
" Defined in RGCObject.hpp to avoid #include cycle", "template <typename T>",
"T * std_move_for(T * src) noexcept {",
" void * mem = this->alloc_copy_for(src);",
" if (mem) {",
" return new (mem) T(std::move(*src));",
" }",
" return nullptr;",
"}",
"",
"/** visit a gcobject child pointer in place.",
" Defined in RCollector_aux.hpp to avoid #include cycle",
" (for historical reasons - coul d be in RGCObject_aux.hpp?)",
" **/", " **/",
"template <typename DRepr>", "template <typename DRepr>",
"void visit_child(xo::facet::obj<AGCObject,DRepr> * p_obj);", "void visit_child(xo::facet::obj<AGCObject,DRepr> * p_obj);",

View file

@ -67,8 +67,9 @@ public:
virtual void _drop(Opaque d) const noexcept = 0; virtual void _drop(Opaque d) const noexcept = 0;
// nonconst methods // nonconst methods
/** move instance using collector **/ /** move instance using object visitor.
virtual Opaque shallow_move(Opaque data, obj<ACollector> gc) const noexcept = 0; Arguably abusing the word 'visitor' here **/
virtual Opaque gco_shallow_move(Opaque data, obj<AGCObjectVisitor> gc) const noexcept = 0;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -64,7 +64,7 @@ namespace mm {
// const methods // const methods
// nonconst methods // nonconst methods
[[noreturn]] Opaque shallow_move(Opaque, obj<ACollector>) const noexcept override; [[noreturn]] Opaque gco_shallow_move(Opaque, obj<AGCObjectVisitor>) const noexcept override;
[[noreturn]] void visit_gco_children(Opaque, obj<AGCObjectVisitor>) const noexcept override; [[noreturn]] void visit_gco_children(Opaque, obj<AGCObjectVisitor>) const noexcept override;
///@} ///@}

View file

@ -53,8 +53,8 @@ namespace mm {
// const methods // const methods
// non-const methods // non-const methods
Opaque shallow_move(Opaque data, obj<ACollector> gc) const noexcept override { Opaque gco_shallow_move(Opaque data, obj<AGCObjectVisitor> gc) const noexcept override {
return I::shallow_move(_dcast(data), gc); return I::gco_shallow_move(_dcast(data), gc);
} }
void visit_gco_children(Opaque data, obj<AGCObjectVisitor> fn) const noexcept override { void visit_gco_children(Opaque data, obj<AGCObjectVisitor> fn) const noexcept override {
return I::visit_gco_children(_dcast(data), fn); return I::visit_gco_children(_dcast(data), fn);

View file

@ -58,8 +58,8 @@ public:
// const methods // const methods
// non-const methods (still const in router!) // non-const methods (still const in router!)
Opaque shallow_move(obj<ACollector> gc) noexcept { Opaque gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept {
return O::iface()->shallow_move(O::data(), gc); return O::iface()->gco_shallow_move(O::data(), gc);
} }
void visit_gco_children(obj<AGCObjectVisitor> fn) noexcept { void visit_gco_children(obj<AGCObjectVisitor> fn) noexcept {
return O::iface()->visit_gco_children(O::data(), fn); return O::iface()->visit_gco_children(O::data(), fn);

View file

@ -46,9 +46,25 @@ public:
///@{ ///@{
// explicit injected content // explicit injected content
/** convenience: allocate copy for typed pointer **/
template <typename T>
void * alloc_copy_for(const T * src) noexcept {
return O::iface()->alloc_copy(O::data(), (std::byte *)const_cast<T *>(src));
}
/** visit forward faceted object child pointer in place. /** convenience: move typed pointer **/
Defined in RGCObject.hpp to avoid #include cycle template <typename T>
T * std_move_for(T * src) noexcept {
void * mem = this->alloc_copy_for(src);
if (mem) {
return new (mem) T(std::move(*src));
}
return nullptr;
}
/** visit a gcobject child pointer in place.
Defined in RCollector_aux.hpp to avoid #include cycle
(for historical reasons - coul d be in RGCObject_aux.hpp?)
**/ **/
template <typename DRepr> template <typename DRepr>
void visit_child(xo::facet::obj<AGCObject,DRepr> * p_obj); void visit_child(xo::facet::obj<AGCObject,DRepr> * p_obj);

View file

@ -36,7 +36,7 @@ IGCObject_Any::_valid
// nonconst methods // nonconst methods
auto auto
IGCObject_Any::shallow_move(Opaque, obj<ACollector>) const noexcept -> Opaque IGCObject_Any::gco_shallow_move(Opaque, obj<AGCObjectVisitor>) const noexcept -> Opaque
{ {
_fatal(); _fatal();
} }

View file

@ -21,7 +21,7 @@ namespace xo {
**/ **/
class DApplyExpr { class DApplyExpr {
public: public:
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr; using TypeDescr = xo::reflect::TypeDescr;
@ -84,8 +84,7 @@ namespace xo {
/** @defgroup scm-applyexpr-gcobject-facet **/ /** @defgroup scm-applyexpr-gcobject-facet **/
///@{ ///@{
std::size_t shallow_size() const noexcept; DApplyExpr * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
DApplyExpr * shallow_move(obj<ACollector> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -8,7 +8,7 @@
#include "Expression.hpp" #include "Expression.hpp"
#include "TypeRef.hpp" #include "TypeRef.hpp"
#include "exprtype.hpp" #include "exprtype.hpp"
#include <xo/alloc2/Collector.hpp> //#include <xo/alloc2/Collector.hpp>
#include <xo/alloc2/GCObject.hpp> #include <xo/alloc2/GCObject.hpp>
#include <xo/alloc2/GCObjectVisitor.hpp> #include <xo/alloc2/GCObjectVisitor.hpp>
#include <xo/reflect/TaggedPtr.hpp> #include <xo/reflect/TaggedPtr.hpp>
@ -22,7 +22,7 @@ namespace xo {
public: public:
using TaggedPtr = xo::reflect::TaggedPtr; using TaggedPtr = xo::reflect::TaggedPtr;
using TypeDescr = xo::reflect::TypeDescr; using TypeDescr = xo::reflect::TypeDescr;
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
@ -64,8 +64,7 @@ namespace xo {
/** @defgroup scm-constant-gcobject-facet **/ /** @defgroup scm-constant-gcobject-facet **/
///@{ ///@{
size_t shallow_size() const noexcept; DConstant * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
DConstant * shallow_move(obj<ACollector> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -74,8 +74,7 @@ namespace xo {
/** @defgroup scm-defineexpr-gcobject-facet **/ /** @defgroup scm-defineexpr-gcobject-facet **/
///@{ ///@{
std::size_t shallow_size() const noexcept; DDefineExpr * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
DDefineExpr * shallow_move(obj<ACollector> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -30,7 +30,7 @@ namespace xo {
using value_type = Binding; using value_type = Binding;
using ArenaHashMapConfig = xo::map::ArenaHashMapConfig; using ArenaHashMapConfig = xo::map::ArenaHashMapConfig;
using repr_type = xo::map::DArenaHashMap<key_type, Binding::slot_type>; using repr_type = xo::map::DArenaHashMap<key_type, Binding::slot_type>;
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
@ -115,7 +115,7 @@ namespace xo {
/** @defgroup scm-globalsymtab-gcobject-facet gcobject facet **/ /** @defgroup scm-globalsymtab-gcobject-facet gcobject facet **/
///@{ ///@{
DGlobalSymtab * shallow_move(obj<ACollector> gc) noexcept; DGlobalSymtab * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -8,7 +8,7 @@
#include "Expression.hpp" #include "Expression.hpp"
#include "TypeRef.hpp" #include "TypeRef.hpp"
#include "exprtype.hpp" #include "exprtype.hpp"
#include <xo/alloc2/Collector.hpp> //#include <xo/alloc2/Collector.hpp>
#include <xo/alloc2/GCObjectVisitor.hpp> #include <xo/alloc2/GCObjectVisitor.hpp>
#include <xo/alloc2/Allocator.hpp> #include <xo/alloc2/Allocator.hpp>
#include <string> #include <string>
@ -21,7 +21,7 @@ namespace xo {
**/ **/
class DIfElseExpr { class DIfElseExpr {
public: public:
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr; using TypeDescr = xo::reflect::TypeDescr;
@ -98,8 +98,7 @@ namespace xo {
/** @defgroup scm-ifelseexpr-gcobject-facet **/ /** @defgroup scm-ifelseexpr-gcobject-facet **/
///@{ ///@{
std::size_t shallow_size() const noexcept; DIfElseExpr * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
DIfElseExpr * shallow_move(obj<ACollector> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -21,7 +21,7 @@ namespace xo {
**/ **/
class DLambdaExpr { class DLambdaExpr {
public: public:
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr; using TypeDescr = xo::reflect::TypeDescr;
@ -87,7 +87,7 @@ namespace xo {
///@{ ///@{
std::size_t shallow_size() const noexcept; std::size_t shallow_size() const noexcept;
DLambdaExpr * shallow_move(obj<ACollector> gc) noexcept; DLambdaExpr * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -20,7 +20,7 @@ namespace xo {
public: public:
using DArray = xo::scm::DArray; using DArray = xo::scm::DArray;
using ppindentinfo = xo::print::ppindentinfo; using ppindentinfo = xo::print::ppindentinfo;
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
@ -99,7 +99,7 @@ namespace xo {
/** @defgroup xo-localsymtab-gcobject-facet gcobject facet **/ /** @defgroup xo-localsymtab-gcobject-facet gcobject facet **/
///@{ ///@{
DLocalSymtab * shallow_move(obj<ACollector> gc) noexcept; DLocalSymtab * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -23,7 +23,7 @@ namespace xo {
**/ **/
class DSequenceExpr { class DSequenceExpr {
public: public:
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr; using TypeDescr = xo::reflect::TypeDescr;
@ -74,8 +74,7 @@ namespace xo {
/** @defgroup scm-sequenceexpr-gcobject-facet gcobject facet methods **/ /** @defgroup scm-sequenceexpr-gcobject-facet gcobject facet methods **/
///@{ ///@{
std::size_t shallow_size() const noexcept; DSequenceExpr * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
DSequenceExpr * shallow_move(obj<ACollector> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -24,7 +24,7 @@ namespace xo {
class DTypename { class DTypename {
public: public:
using ppindentinfo = xo::print::ppindentinfo; using ppindentinfo = xo::print::ppindentinfo;
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
@ -55,8 +55,7 @@ namespace xo {
/** @defgroup scm-typename-gcobject-facet **/ /** @defgroup scm-typename-gcobject-facet **/
///@{ ///@{
size_t shallow_size() const noexcept; DTypename * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
DTypename * shallow_move(obj<ACollector> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -21,7 +21,7 @@ namespace xo {
class DVarRef { class DVarRef {
public: public:
using ppindentinfo = xo::print::ppindentinfo; using ppindentinfo = xo::print::ppindentinfo;
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr; using TypeDescr = xo::reflect::TypeDescr;
@ -56,8 +56,7 @@ namespace xo {
/** @defgroup scm-variable-gcobject-facet **/ /** @defgroup scm-variable-gcobject-facet **/
///@{ ///@{
size_t shallow_size() const noexcept; DVarRef * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
DVarRef * shallow_move(obj<ACollector> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -22,7 +22,7 @@ namespace xo {
class DVariable { class DVariable {
public: public:
using ppindentinfo = xo::print::ppindentinfo; using ppindentinfo = xo::print::ppindentinfo;
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr; using TypeDescr = xo::reflect::TypeDescr;
@ -64,8 +64,7 @@ namespace xo {
/** @defgroup scm-variable-gcobject-facet **/ /** @defgroup scm-variable-gcobject-facet **/
///@{ ///@{
size_t shallow_size() const noexcept; DVariable * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
DVariable * shallow_move(obj<ACollector> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DDefineExpr & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DDefineExpr & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DApplyExpr & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DApplyExpr & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DConstant & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DConstant & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DIfElseExpr & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DIfElseExpr & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DLambdaExpr & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DLambdaExpr & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DSequenceExpr & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DSequenceExpr & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DVarRef & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DVarRef & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DGlobalSymtab & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DGlobalSymtab & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DLocalSymtab & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DLocalSymtab & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -51,8 +51,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DTypename & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DTypename & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DVariable & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DVariable & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -104,13 +104,8 @@ namespace xo {
// ----- gcobject facet ----- // ----- gcobject facet -----
std::size_t
DApplyExpr::shallow_size() const noexcept {
return sizeof(DApplyExpr) + (n_args_ * sizeof(obj<AExpression>));
}
DApplyExpr * DApplyExpr *
DApplyExpr::shallow_move(obj<ACollector> gc) noexcept { DApplyExpr::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept {
// note: not using ACollector.std_copy_for() here, // note: not using ACollector.std_copy_for() here,
// flexible array -> not move-constructible // flexible array -> not move-constructible

View file

@ -71,14 +71,8 @@ namespace xo {
return nullptr; return nullptr;
} }
std::size_t
DConstant::shallow_size() const noexcept
{
return sizeof(DConstant);
}
DConstant * DConstant *
DConstant::shallow_move(obj<ACollector> gc) noexcept DConstant::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
return gc.std_move_for(this); return gc.std_move_for(this);
} }

View file

@ -78,14 +78,8 @@ namespace xo {
// ----- GCObject facet ----- // ----- GCObject facet -----
std::size_t
DDefineExpr::shallow_size() const noexcept
{
return sizeof(*this);
}
DDefineExpr * DDefineExpr *
DDefineExpr::shallow_move(obj<ACollector> gc) noexcept DDefineExpr::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
return gc.std_move_for(this); return gc.std_move_for(this);
} }

View file

@ -263,7 +263,7 @@ namespace xo {
// ----- gcobject facet ----- // ----- gcobject facet -----
DGlobalSymtab * DGlobalSymtab *
DGlobalSymtab::shallow_move(obj<ACollector> gc) noexcept DGlobalSymtab::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
return gc.std_move_for(this); return gc.std_move_for(this);
} }

View file

@ -82,14 +82,8 @@ namespace xo {
// GCObject facet // GCObject facet
std::size_t
DIfElseExpr::shallow_size() const noexcept
{
return sizeof(DIfElseExpr);
}
DIfElseExpr * DIfElseExpr *
DIfElseExpr::shallow_move(obj<ACollector> gc) noexcept DIfElseExpr::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
return gc.std_move_for(this); return gc.std_move_for(this);
} }

View file

@ -141,7 +141,7 @@ namespace xo {
} }
DLambdaExpr * DLambdaExpr *
DLambdaExpr::shallow_move(obj<ACollector> gc) noexcept { DLambdaExpr::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept {
return gc.std_move_for(this); return gc.std_move_for(this);
} }

View file

@ -113,7 +113,7 @@ namespace xo {
// ----- gcobject facet ----- // ----- gcobject facet -----
DLocalSymtab * DLocalSymtab *
DLocalSymtab::shallow_move(obj<ACollector> gc) noexcept DLocalSymtab::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
return gc.std_move_for(this); return gc.std_move_for(this);
} }

View file

@ -113,14 +113,8 @@ namespace xo {
// gc hooks for IGCObject_DSequenceExpr // gc hooks for IGCObject_DSequenceExpr
std::size_t
DSequenceExpr::shallow_size() const noexcept
{
return sizeof(DSequenceExpr);
}
DSequenceExpr * DSequenceExpr *
DSequenceExpr::shallow_move(obj<ACollector> gc) noexcept DSequenceExpr::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
return gc.std_move_for(this); return gc.std_move_for(this);
} }

View file

@ -40,14 +40,8 @@ namespace xo {
: name_{name}, type_{type} : name_{name}, type_{type}
{} {}
size_t
DTypename::shallow_size() const noexcept
{
return sizeof(DTypename);
}
DTypename * DTypename *
DTypename::shallow_move(obj<ACollector> gc) noexcept DTypename::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
return gc.std_move_for(this); return gc.std_move_for(this);
} }

View file

@ -58,14 +58,8 @@ namespace xo {
// gcobject facet // gcobject facet
std::size_t
DVarRef::shallow_size() const noexcept
{
return sizeof(DVarRef);
}
DVarRef * DVarRef *
DVarRef::shallow_move(obj<ACollector> gc) noexcept DVarRef::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
return gc.std_move_for(this); return gc.std_move_for(this);
} }

View file

@ -38,14 +38,8 @@ namespace xo {
typeref_.resolve(td); typeref_.resolve(td);
} }
size_t
DVariable::shallow_size() const noexcept
{
return sizeof(DVariable);
}
DVariable * DVariable *
DVariable::shallow_move(obj<ACollector> gc) noexcept DVariable::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
return gc.std_move_for(this); return gc.std_move_for(this);
} }

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DApplyExpr::shallow_move(DApplyExpr & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DApplyExpr::gco_shallow_move(DApplyExpr & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DApplyExpr::visit_gco_children(DApplyExpr & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DApplyExpr::visit_gco_children(DApplyExpr & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DConstant::shallow_move(DConstant & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DConstant::gco_shallow_move(DConstant & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DConstant::visit_gco_children(DConstant & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DConstant::visit_gco_children(DConstant & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DDefineExpr::shallow_move(DDefineExpr & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DDefineExpr::gco_shallow_move(DDefineExpr & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DDefineExpr::visit_gco_children(DDefineExpr & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DDefineExpr::visit_gco_children(DDefineExpr & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DGlobalSymtab::shallow_move(DGlobalSymtab & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DGlobalSymtab::gco_shallow_move(DGlobalSymtab & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DGlobalSymtab::visit_gco_children(DGlobalSymtab & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DGlobalSymtab::visit_gco_children(DGlobalSymtab & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DIfElseExpr::shallow_move(DIfElseExpr & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DIfElseExpr::gco_shallow_move(DIfElseExpr & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DIfElseExpr::visit_gco_children(DIfElseExpr & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DIfElseExpr::visit_gco_children(DIfElseExpr & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DLambdaExpr::shallow_move(DLambdaExpr & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DLambdaExpr::gco_shallow_move(DLambdaExpr & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DLambdaExpr::visit_gco_children(DLambdaExpr & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DLambdaExpr::visit_gco_children(DLambdaExpr & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DLocalSymtab::shallow_move(DLocalSymtab & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DLocalSymtab::gco_shallow_move(DLocalSymtab & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DLocalSymtab::visit_gco_children(DLocalSymtab & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DLocalSymtab::visit_gco_children(DLocalSymtab & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DSequenceExpr::shallow_move(DSequenceExpr & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DSequenceExpr::gco_shallow_move(DSequenceExpr & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DSequenceExpr::visit_gco_children(DSequenceExpr & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DSequenceExpr::visit_gco_children(DSequenceExpr & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DTypename::shallow_move(DTypename & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DTypename::gco_shallow_move(DTypename & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DTypename::visit_gco_children(DTypename & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DTypename::visit_gco_children(DTypename & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DVarRef::shallow_move(DVarRef & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DVarRef::gco_shallow_move(DVarRef & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DVarRef::visit_gco_children(DVarRef & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DVarRef::visit_gco_children(DVarRef & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DVariable::shallow_move(DVariable & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DVariable::gco_shallow_move(DVariable & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DVariable::visit_gco_children(DVariable & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DVariable::visit_gco_children(DVariable & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -870,7 +870,7 @@ namespace xo {
//obj<AAllocator, DX1Collector> gc_gco(gc); //obj<AAllocator, DX1Collector> gc_gco(gc);
void * to_dest = iface->shallow_move(from_src, x1gc->ref<ACollector>()); void * to_dest = iface->gco_shallow_move(from_src, x1gc->ref<AGCObjectVisitor>());
log && log(xtag("from_src", from_src), xtag("to_dest", to_dest)); log && log(xtag("from_src", from_src), xtag("to_dest", to_dest));
log && log(xtag("tseq", info.tseq()), log && log(xtag("tseq", info.tseq()),

View file

@ -24,9 +24,12 @@ namespace xo {
FacetRegistry::register_impl<AAllocator, DX1Collector>(); FacetRegistry::register_impl<AAllocator, DX1Collector>();
FacetRegistry::register_impl<ACollector, DX1Collector>(); FacetRegistry::register_impl<ACollector, DX1Collector>();
FacetRegistry::register_impl<AGCObjectVisitor, DX1Collector>();
log && log(xtag("DX1Collector.tseq", typeseq::id<DX1Collector>())); log && log(xtag("DX1Collector.tseq", typeseq::id<DX1Collector>()));
log && log(xtag("ACollector.tseq", typeseq::id<ACollector>())); log && log(xtag("ACollector.tseq", typeseq::id<ACollector>()));
log && log(xtag("AGCObjectVisitor.tseq", typeseq::id<AGCObjectVisitor>()));
return true; return true;
} }

View file

@ -19,7 +19,7 @@ namespace xo {
class DClosure { class DClosure {
public: public:
using ARuntimeContext = xo::scm::ARuntimeContext; using ARuntimeContext = xo::scm::ARuntimeContext;
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
@ -58,7 +58,7 @@ namespace xo {
/** @defgroup scm-closure-gcobject-facet **/ /** @defgroup scm-closure-gcobject-facet **/
///@{ ///@{
DClosure * shallow_move(obj<ACollector> gc) noexcept; DClosure * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -16,7 +16,7 @@ namespace xo {
class DLocalEnv { class DLocalEnv {
public: public:
using DArray = xo::scm::DArray; using DArray = xo::scm::DArray;
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
@ -55,7 +55,7 @@ namespace xo {
/** @defgroup scm-localenv-gcobject-facet **/ /** @defgroup scm-localenv-gcobject-facet **/
///@{ ///@{
DLocalEnv * shallow_move(obj<ACollector> gc) noexcept; DLocalEnv * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -41,7 +41,7 @@ namespace xo {
/** gcobject facet **/ /** gcobject facet **/
std::size_t shallow_size() const noexcept; std::size_t shallow_size() const noexcept;
DVsmApplyClosureFrame * shallow_move(obj<ACollector> gc) noexcept; DVsmApplyClosureFrame * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
/** pretty-printing support **/ /** pretty-printing support **/

View file

@ -14,7 +14,7 @@ namespace xo {
class DVsmApplyFrame { class DVsmApplyFrame {
public: public:
using AProcedure = xo::scm::AProcedure; using AProcedure = xo::scm::AProcedure;
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
@ -38,7 +38,7 @@ namespace xo {
void assign_fn(obj<AGCObject> x) { this->fn_ = x; } void assign_fn(obj<AGCObject> x) { this->fn_ = x; }
DVsmApplyFrame * shallow_move(obj<ACollector> gc) noexcept; DVsmApplyFrame * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
/** pretty-printing support **/ /** pretty-printing support **/

View file

@ -15,7 +15,7 @@ namespace xo {
**/ **/
class DVsmDefContFrame { class DVsmDefContFrame {
public: public:
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
@ -51,7 +51,7 @@ namespace xo {
/** @defgroup scm-vsmdefcontframe-gcobject-facet gcobject facet **/ /** @defgroup scm-vsmdefcontframe-gcobject-facet gcobject facet **/
///@{ ///@{
DVsmDefContFrame * shallow_move(obj<ACollector> gc) noexcept; DVsmDefContFrame * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -14,7 +14,7 @@ namespace xo {
/** frame for executing an apply expression **/ /** frame for executing an apply expression **/
class DVsmEvalArgsFrame { class DVsmEvalArgsFrame {
public: public:
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
@ -43,7 +43,7 @@ namespace xo {
int32_t increment_arg() { return ++i_arg_; } int32_t increment_arg() { return ++i_arg_; }
DVsmEvalArgsFrame * shallow_move(obj<ACollector> gc) noexcept; DVsmEvalArgsFrame * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
bool pretty(const ppindentinfo & ppii) const; bool pretty(const ppindentinfo & ppii) const;

View file

@ -15,7 +15,7 @@ namespace xo {
**/ **/
class DVsmIfElseContFrame { class DVsmIfElseContFrame {
public: public:
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
@ -51,7 +51,7 @@ namespace xo {
/** @defgroup scm-vsmevalsequenceframe-gcobject-facet gcobject facet **/ /** @defgroup scm-vsmevalsequenceframe-gcobject-facet gcobject facet **/
///@{ ///@{
DVsmIfElseContFrame * shallow_move(obj<ACollector> gc) noexcept; DVsmIfElseContFrame * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -15,7 +15,7 @@ namespace xo {
**/ **/
class DVsmSeqContFrame { class DVsmSeqContFrame {
public: public:
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
@ -32,10 +32,10 @@ namespace xo {
/** create instance using memory from allocator @p mm **/ /** create instance using memory from allocator @p mm **/
static DVsmSeqContFrame * make(obj<AAllocator> mm, static DVsmSeqContFrame * make(obj<AAllocator> mm,
obj<AGCObject> parent, obj<AGCObject> parent,
VsmInstr cont, VsmInstr cont,
DSequenceExpr * seq_expr, DSequenceExpr * seq_expr,
uint32_t i_seq); uint32_t i_seq);
///@} ///@}
/** @defgroup scm-vsmevalsequenceframe-access-methods access methods **/ /** @defgroup scm-vsmevalsequenceframe-access-methods access methods **/
@ -56,7 +56,7 @@ namespace xo {
/** @defgroup scm-vsmevalsequenceframe-gcobject-facet gcobject facet **/ /** @defgroup scm-vsmevalsequenceframe-gcobject-facet gcobject facet **/
///@{ ///@{
DVsmSeqContFrame * shallow_move(obj<ACollector> gc) noexcept; DVsmSeqContFrame * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DVsmDefContFrame & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DVsmDefContFrame & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DClosure & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DClosure & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DVsmApplyClosureFrame & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DVsmApplyClosureFrame & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DVsmApplyFrame & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DVsmApplyFrame & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DVsmEvalArgsFrame & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DVsmEvalArgsFrame & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DLocalEnv & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DLocalEnv & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DVsmIfElseContFrame & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DVsmIfElseContFrame & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DVsmSeqContFrame & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DVsmSeqContFrame & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -71,7 +71,7 @@ namespace xo {
public: public:
// will be DArenaVector<obj<StackFrame>> probably // will be DArenaVector<obj<StackFrame>> probably
using Stack = void *; using Stack = void *;
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
@ -154,7 +154,7 @@ namespace xo {
/** shallow copy during gc cycle. Not implemented! Only intending to support /** shallow copy during gc cycle. Not implemented! Only intending to support
* VSM as virtual root * VSM as virtual root
**/ **/
DVirtualSchematikaMachine * shallow_move(obj<ACollector> gc) noexcept; DVirtualSchematikaMachine * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
/** forward gc-aware child pointers /** forward gc-aware child pointers
**/ **/

View file

@ -53,8 +53,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DVirtualSchematikaMachine & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DVirtualSchematikaMachine & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -65,7 +65,7 @@ namespace xo {
} }
DClosure * DClosure *
DClosure::shallow_move(obj<ACollector> gc) noexcept { DClosure::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept {
return gc.std_move_for(this); return gc.std_move_for(this);
} }

View file

@ -92,7 +92,7 @@ namespace xo {
} }
DLocalEnv * DLocalEnv *
DLocalEnv::shallow_move(obj<ACollector> gc) noexcept { DLocalEnv::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept {
return gc.std_move_for(this); return gc.std_move_for(this);
} }

View file

@ -954,8 +954,11 @@ namespace xo {
} }
DVirtualSchematikaMachine * DVirtualSchematikaMachine *
DVirtualSchematikaMachine::shallow_move(obj<ACollector> gc) noexcept DVirtualSchematikaMachine::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
// need move-ctor on abox<..>
//return gc.std_move_for(this);
(void)gc; (void)gc;
/** TODO: should be able to use gc.std_move_for(this) now /** TODO: should be able to use gc.std_move_for(this) now

View file

@ -33,7 +33,7 @@ namespace xo {
} }
DVsmApplyClosureFrame * DVsmApplyClosureFrame *
DVsmApplyClosureFrame::shallow_move(obj<ACollector> gc) noexcept DVsmApplyClosureFrame::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
return gc.std_move_for(this); return gc.std_move_for(this);
} }

View file

@ -41,7 +41,7 @@ namespace xo {
} }
DVsmApplyFrame * DVsmApplyFrame *
DVsmApplyFrame::shallow_move(obj<ACollector> gc) noexcept DVsmApplyFrame::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
return gc.std_move_for(this); return gc.std_move_for(this);
} }

View file

@ -32,7 +32,7 @@ namespace xo {
// gcobject facet // gcobject facet
DVsmDefContFrame * DVsmDefContFrame *
DVsmDefContFrame::shallow_move(obj<ACollector> gc) noexcept DVsmDefContFrame::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
return gc.std_move_for<DVsmDefContFrame>(this); return gc.std_move_for<DVsmDefContFrame>(this);
} }

View file

@ -42,7 +42,7 @@ namespace xo {
} }
DVsmEvalArgsFrame * DVsmEvalArgsFrame *
DVsmEvalArgsFrame::shallow_move(obj<ACollector> gc) noexcept DVsmEvalArgsFrame::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
return gc.std_move_for(this); return gc.std_move_for(this);
} }

View file

@ -30,7 +30,7 @@ namespace xo {
// gcobject facet // gcobject facet
DVsmIfElseContFrame * DVsmIfElseContFrame *
DVsmIfElseContFrame::shallow_move(obj<ACollector> gc) noexcept DVsmIfElseContFrame::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
return gc.std_move_for<DVsmIfElseContFrame>(this); return gc.std_move_for<DVsmIfElseContFrame>(this);
} }

View file

@ -33,9 +33,9 @@ namespace xo {
// gcobject facet // gcobject facet
DVsmSeqContFrame * DVsmSeqContFrame *
DVsmSeqContFrame::shallow_move(obj<ACollector> gc) noexcept DVsmSeqContFrame::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{ {
return gc.std_move_for<DVsmSeqContFrame>(this); return gc.std_move_for(this);
} }
void void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DClosure::shallow_move(DClosure & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DClosure::gco_shallow_move(DClosure & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DClosure::visit_gco_children(DClosure & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DClosure::visit_gco_children(DClosure & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DVsmApplyClosureFrame::shallow_move(DVsmApplyClosureFrame & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DVsmApplyClosureFrame::gco_shallow_move(DVsmApplyClosureFrame & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DVsmApplyClosureFrame::visit_gco_children(DVsmApplyClosureFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DVsmApplyClosureFrame::visit_gco_children(DVsmApplyClosureFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DVsmApplyFrame::shallow_move(DVsmApplyFrame & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DVsmApplyFrame::gco_shallow_move(DVsmApplyFrame & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DVsmApplyFrame::visit_gco_children(DVsmApplyFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DVsmApplyFrame::visit_gco_children(DVsmApplyFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DVsmDefContFrame::shallow_move(DVsmDefContFrame & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DVsmDefContFrame::gco_shallow_move(DVsmDefContFrame & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DVsmDefContFrame::visit_gco_children(DVsmDefContFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DVsmDefContFrame::visit_gco_children(DVsmDefContFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DVsmEvalArgsFrame::shallow_move(DVsmEvalArgsFrame & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DVsmEvalArgsFrame::gco_shallow_move(DVsmEvalArgsFrame & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DVsmEvalArgsFrame::visit_gco_children(DVsmEvalArgsFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DVsmEvalArgsFrame::visit_gco_children(DVsmEvalArgsFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DVsmIfElseContFrame::shallow_move(DVsmIfElseContFrame & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DVsmIfElseContFrame::gco_shallow_move(DVsmIfElseContFrame & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DVsmIfElseContFrame::visit_gco_children(DVsmIfElseContFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DVsmIfElseContFrame::visit_gco_children(DVsmIfElseContFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DVsmSeqContFrame::shallow_move(DVsmSeqContFrame & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DVsmSeqContFrame::gco_shallow_move(DVsmSeqContFrame & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DVsmSeqContFrame::visit_gco_children(DVsmSeqContFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DVsmSeqContFrame::visit_gco_children(DVsmSeqContFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DLocalEnv::shallow_move(DLocalEnv & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DLocalEnv::gco_shallow_move(DLocalEnv & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DLocalEnv::visit_gco_children(DLocalEnv & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DLocalEnv::visit_gco_children(DLocalEnv & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -16,9 +16,9 @@
namespace xo { namespace xo {
namespace scm { namespace scm {
auto auto
IGCObject_DVirtualSchematikaMachine::shallow_move(DVirtualSchematikaMachine & self, obj<ACollector> gc) noexcept -> Opaque IGCObject_DVirtualSchematikaMachine::gco_shallow_move(DVirtualSchematikaMachine & self, obj<AGCObjectVisitor> gc) noexcept -> Opaque
{ {
return self.shallow_move(gc); return self.gco_shallow_move(gc);
} }
auto auto
IGCObject_DVirtualSchematikaMachine::visit_gco_children(DVirtualSchematikaMachine & self, obj<AGCObjectVisitor> fn) noexcept -> void IGCObject_DVirtualSchematikaMachine::visit_gco_children(DVirtualSchematikaMachine & self, obj<AGCObjectVisitor> fn) noexcept -> void

View file

@ -6,7 +6,7 @@
#pragma once #pragma once
#include <xo/alloc2/GCObject.hpp> #include <xo/alloc2/GCObject.hpp>
#include <xo/alloc2/Collector.hpp> //#include <xo/alloc2/Collector.hpp>
#include <xo/alloc2/Allocator.hpp> #include <xo/alloc2/Allocator.hpp>
#include <xo/facet/obj.hpp> #include <xo/facet/obj.hpp>
#include <xo/indentlog/print/ppindentinfo.hpp> #include <xo/indentlog/print/ppindentinfo.hpp>
@ -33,7 +33,7 @@ namespace xo {
/** xo allocator facet **/ /** xo allocator facet **/
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
/** garbage collector facet **/ /** garbage collector facet **/
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
/** gc-aware object facet **/ /** gc-aware object facet **/
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
/** gc-centric object visitor **/ /** gc-centric object visitor **/
@ -148,7 +148,7 @@ namespace xo {
/** @defgroup darray-gcobject-methods **/ /** @defgroup darray-gcobject-methods **/
///@{ ///@{
/** move to new address, mandated by @p gc **/ /** move to new address, mandated by @p gc **/
DArray * shallow_move(obj<ACollector> gc) noexcept; DArray * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
/** forward elements to @p gc to-space; replace originals with forarding pointers **/ /** forward elements to @p gc to-space; replace originals with forarding pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -5,7 +5,7 @@
#pragma once #pragma once
#include <xo/alloc2/Collector.hpp> //#include <xo/alloc2/Collector.hpp>
#include <xo/alloc2/Allocator.hpp> #include <xo/alloc2/Allocator.hpp>
#include <xo/alloc2/GCObjectVisitor.hpp> #include <xo/alloc2/GCObjectVisitor.hpp>
#include <xo/indentlog/print/ppindentinfo.hpp> #include <xo/indentlog/print/ppindentinfo.hpp>
@ -16,7 +16,7 @@ namespace xo {
namespace scm { namespace scm {
struct DBoolean { struct DBoolean {
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
using ppindentinfo = xo::print::ppindentinfo; using ppindentinfo = xo::print::ppindentinfo;
@ -39,7 +39,7 @@ namespace xo {
// GCObject facet // GCObject facet
DBoolean * shallow_move(obj<ACollector> gc) noexcept; DBoolean * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
private: private:

View file

@ -204,7 +204,7 @@ namespace xo {
/** @defgroup ddictionary-gcobject-methods **/ /** @defgroup ddictionary-gcobject-methods **/
///@{ ///@{
/** return shallow copy of this array, using memory from @p mm **/ /** return shallow copy of this array, using memory from @p mm **/
DDictionary * shallow_move(obj<ACollector> gc) noexcept; DDictionary * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
/** forward elements to @p gc to-space; replace originals with forwarding pointers **/ /** forward elements to @p gc to-space; replace originals with forwarding pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -6,7 +6,7 @@
#pragma once #pragma once
#include <xo/alloc2/Allocator.hpp> #include <xo/alloc2/Allocator.hpp>
#include <xo/alloc2/Collector.hpp> //#include <xo/alloc2/Collector.hpp>
#include <xo/alloc2/GCObjectVisitor.hpp> #include <xo/alloc2/GCObjectVisitor.hpp>
#include <xo/facet/obj.hpp> #include <xo/facet/obj.hpp>
#include <xo/indentlog/print/ppindentinfo.hpp> #include <xo/indentlog/print/ppindentinfo.hpp>
@ -15,7 +15,7 @@ namespace xo {
namespace scm { namespace scm {
struct DFloat { struct DFloat {
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using ppindentinfo = xo::print::ppindentinfo; using ppindentinfo = xo::print::ppindentinfo;
using value_type = double; using value_type = double;
@ -36,7 +36,7 @@ namespace xo {
bool pretty(const ppindentinfo & ppii) const; bool pretty(const ppindentinfo & ppii) const;
// GCObject facet // GCObject facet
DFloat * shallow_move(obj<ACollector> gc) noexcept; DFloat * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
private: private:

View file

@ -5,7 +5,7 @@
#pragma once #pragma once
#include <xo/alloc2/Collector.hpp> //#include <xo/alloc2/Collector.hpp>
#include <xo/alloc2/GCObjectVisitor.hpp> #include <xo/alloc2/GCObjectVisitor.hpp>
#include <xo/alloc2/Allocator.hpp> #include <xo/alloc2/Allocator.hpp>
#include <xo/indentlog/print/ppindentinfo.hpp> #include <xo/indentlog/print/ppindentinfo.hpp>
@ -16,7 +16,7 @@ namespace xo {
namespace scm { namespace scm {
struct DInteger { struct DInteger {
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
using ppindentinfo = xo::print::ppindentinfo; using ppindentinfo = xo::print::ppindentinfo;
@ -41,7 +41,7 @@ namespace xo {
// GCObject facet // GCObject facet
DInteger * shallow_move(obj<ACollector> gc) noexcept; DInteger * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
private: private:

View file

@ -5,6 +5,7 @@
#pragma once #pragma once
#include <xo/alloc2/Collector.hpp>
#include <xo/alloc2/GCObject.hpp> #include <xo/alloc2/GCObject.hpp>
#include <xo/facet/obj.hpp> #include <xo/facet/obj.hpp>
#include <xo/indentlog/print/ppindentinfo.hpp> #include <xo/indentlog/print/ppindentinfo.hpp>
@ -70,7 +71,7 @@ namespace xo {
/** @defgroup xo-scm-list-gcobject-facet gcobject facet **/ /** @defgroup xo-scm-list-gcobject-facet gcobject facet **/
///@{ ///@{
DList * shallow_move(obj<ACollector> gc) noexcept; DList * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -17,7 +17,7 @@ namespace xo {
class DRuntimeError { class DRuntimeError {
public: public:
using AGCObject = xo::mm::AGCObject; using AGCObject = xo::mm::AGCObject;
using ACollector = xo::mm::ACollector; //using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator; using AAllocator = xo::mm::AAllocator;
using ppindentinfo = xo::print::ppindentinfo; using ppindentinfo = xo::print::ppindentinfo;
@ -50,7 +50,7 @@ namespace xo {
/** @defgroup scm-runtimeerror-gcobject-facet gcobject facet **/ /** @defgroup scm-runtimeerror-gcobject-facet gcobject facet **/
///@{ ///@{
DRuntimeError * shallow_move(obj<ACollector> gc) noexcept; DRuntimeError * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept; void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@} ///@}

View file

@ -51,8 +51,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DArray & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DArray & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -51,8 +51,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DBoolean & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DBoolean & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

View file

@ -51,8 +51,9 @@ namespace xo {
// const methods // const methods
// non-const methods // non-const methods
/** move instance using collector **/ /** move instance using object visitor.
static Opaque shallow_move(DDictionary & self, obj<ACollector> gc) noexcept; Arguably abusing the word 'visitor' here **/
static Opaque gco_shallow_move(DDictionary & self, obj<AGCObjectVisitor> gc) noexcept;
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer. /** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/ when @p fn invokes garbage collector reentry point **/

Some files were not shown because too many files have changed in this diff Show more