refactor: use GCObjectVisitor api w/ gco_shallow_move
This commit is contained in:
parent
547f897c31
commit
e95353f1c8
169 changed files with 391 additions and 402 deletions
|
|
@ -64,11 +64,14 @@
|
|||
nonconst_methods: [
|
||||
// Opaque shallow_move(obj<ACollector>) noexcept
|
||||
{
|
||||
name: "shallow_move",
|
||||
doc: ["move instance using collector"],
|
||||
name: "gco_shallow_move",
|
||||
doc: [
|
||||
"move instance using object visitor.",
|
||||
"Arguably abusing the word 'visitor' here",
|
||||
],
|
||||
return_type: "Opaque",
|
||||
args:[
|
||||
{type: "obj<ACollector>", name: "gc"},
|
||||
{type: "obj<AGCObjectVisitor>", name: "gc"},
|
||||
],
|
||||
const: true,
|
||||
noexcept: true,
|
||||
|
|
|
|||
|
|
@ -88,9 +88,25 @@
|
|||
},
|
||||
],
|
||||
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.",
|
||||
" Defined in RGCObject.hpp to avoid #include cycle",
|
||||
"/** convenience: move typed pointer **/",
|
||||
"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>",
|
||||
"void visit_child(xo::facet::obj<AGCObject,DRepr> * p_obj);",
|
||||
|
|
|
|||
|
|
@ -67,8 +67,9 @@ public:
|
|||
virtual void _drop(Opaque d) const noexcept = 0;
|
||||
|
||||
// nonconst methods
|
||||
/** move instance using collector **/
|
||||
virtual Opaque shallow_move(Opaque data, obj<ACollector> gc) const noexcept = 0;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ namespace mm {
|
|||
// const 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;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@ namespace mm {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
Opaque shallow_move(Opaque data, obj<ACollector> gc) const noexcept override {
|
||||
return I::shallow_move(_dcast(data), gc);
|
||||
Opaque gco_shallow_move(Opaque data, obj<AGCObjectVisitor> gc) const noexcept override {
|
||||
return I::gco_shallow_move(_dcast(data), gc);
|
||||
}
|
||||
void visit_gco_children(Opaque data, obj<AGCObjectVisitor> fn) const noexcept override {
|
||||
return I::visit_gco_children(_dcast(data), fn);
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ public:
|
|||
// const methods
|
||||
|
||||
// non-const methods (still const in router!)
|
||||
Opaque shallow_move(obj<ACollector> gc) noexcept {
|
||||
return O::iface()->shallow_move(O::data(), gc);
|
||||
Opaque gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept {
|
||||
return O::iface()->gco_shallow_move(O::data(), gc);
|
||||
}
|
||||
void visit_gco_children(obj<AGCObjectVisitor> fn) noexcept {
|
||||
return O::iface()->visit_gco_children(O::data(), fn);
|
||||
|
|
|
|||
|
|
@ -46,9 +46,25 @@ public:
|
|||
///@{
|
||||
|
||||
// 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.
|
||||
Defined in RGCObject.hpp to avoid #include cycle
|
||||
/** convenience: move typed pointer **/
|
||||
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>
|
||||
void visit_child(xo::facet::obj<AGCObject,DRepr> * p_obj);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ IGCObject_Any::_valid
|
|||
// nonconst methods
|
||||
|
||||
auto
|
||||
IGCObject_Any::shallow_move(Opaque, obj<ACollector>) const noexcept -> Opaque
|
||||
IGCObject_Any::gco_shallow_move(Opaque, obj<AGCObjectVisitor>) const noexcept -> Opaque
|
||||
{
|
||||
_fatal();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace xo {
|
|||
**/
|
||||
class DApplyExpr {
|
||||
public:
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using TypeDescr = xo::reflect::TypeDescr;
|
||||
|
|
@ -84,8 +84,7 @@ namespace xo {
|
|||
/** @defgroup scm-applyexpr-gcobject-facet **/
|
||||
///@{
|
||||
|
||||
std::size_t shallow_size() const noexcept;
|
||||
DApplyExpr * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DApplyExpr * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include "Expression.hpp"
|
||||
#include "TypeRef.hpp"
|
||||
#include "exprtype.hpp"
|
||||
#include <xo/alloc2/Collector.hpp>
|
||||
//#include <xo/alloc2/Collector.hpp>
|
||||
#include <xo/alloc2/GCObject.hpp>
|
||||
#include <xo/alloc2/GCObjectVisitor.hpp>
|
||||
#include <xo/reflect/TaggedPtr.hpp>
|
||||
|
|
@ -22,7 +22,7 @@ namespace xo {
|
|||
public:
|
||||
using TaggedPtr = xo::reflect::TaggedPtr;
|
||||
using TypeDescr = xo::reflect::TypeDescr;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -64,8 +64,7 @@ namespace xo {
|
|||
/** @defgroup scm-constant-gcobject-facet **/
|
||||
///@{
|
||||
|
||||
size_t shallow_size() const noexcept;
|
||||
DConstant * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DConstant * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -74,8 +74,7 @@ namespace xo {
|
|||
/** @defgroup scm-defineexpr-gcobject-facet **/
|
||||
///@{
|
||||
|
||||
std::size_t shallow_size() const noexcept;
|
||||
DDefineExpr * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DDefineExpr * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ namespace xo {
|
|||
using value_type = Binding;
|
||||
using ArenaHashMapConfig = xo::map::ArenaHashMapConfig;
|
||||
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 AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -115,7 +115,7 @@ namespace xo {
|
|||
/** @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;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include "Expression.hpp"
|
||||
#include "TypeRef.hpp"
|
||||
#include "exprtype.hpp"
|
||||
#include <xo/alloc2/Collector.hpp>
|
||||
//#include <xo/alloc2/Collector.hpp>
|
||||
#include <xo/alloc2/GCObjectVisitor.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include <string>
|
||||
|
|
@ -21,7 +21,7 @@ namespace xo {
|
|||
**/
|
||||
class DIfElseExpr {
|
||||
public:
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using TypeDescr = xo::reflect::TypeDescr;
|
||||
|
|
@ -98,8 +98,7 @@ namespace xo {
|
|||
/** @defgroup scm-ifelseexpr-gcobject-facet **/
|
||||
///@{
|
||||
|
||||
std::size_t shallow_size() const noexcept;
|
||||
DIfElseExpr * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DIfElseExpr * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace xo {
|
|||
**/
|
||||
class DLambdaExpr {
|
||||
public:
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using TypeDescr = xo::reflect::TypeDescr;
|
||||
|
|
@ -87,7 +87,7 @@ namespace xo {
|
|||
///@{
|
||||
|
||||
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;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace xo {
|
|||
public:
|
||||
using DArray = xo::scm::DArray;
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -99,7 +99,7 @@ namespace xo {
|
|||
/** @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;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace xo {
|
|||
**/
|
||||
class DSequenceExpr {
|
||||
public:
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using TypeDescr = xo::reflect::TypeDescr;
|
||||
|
|
@ -74,8 +74,7 @@ namespace xo {
|
|||
/** @defgroup scm-sequenceexpr-gcobject-facet gcobject facet methods **/
|
||||
///@{
|
||||
|
||||
std::size_t shallow_size() const noexcept;
|
||||
DSequenceExpr * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DSequenceExpr * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace xo {
|
|||
class DTypename {
|
||||
public:
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -55,8 +55,7 @@ namespace xo {
|
|||
/** @defgroup scm-typename-gcobject-facet **/
|
||||
///@{
|
||||
|
||||
size_t shallow_size() const noexcept;
|
||||
DTypename * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DTypename * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace xo {
|
|||
class DVarRef {
|
||||
public:
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using TypeDescr = xo::reflect::TypeDescr;
|
||||
|
|
@ -56,8 +56,7 @@ namespace xo {
|
|||
/** @defgroup scm-variable-gcobject-facet **/
|
||||
///@{
|
||||
|
||||
size_t shallow_size() const noexcept;
|
||||
DVarRef * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DVarRef * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace xo {
|
|||
class DVariable {
|
||||
public:
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using TypeDescr = xo::reflect::TypeDescr;
|
||||
|
|
@ -64,8 +64,7 @@ namespace xo {
|
|||
/** @defgroup scm-variable-gcobject-facet **/
|
||||
///@{
|
||||
|
||||
size_t shallow_size() const noexcept;
|
||||
DVariable * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DVariable * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DDefineExpr & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DApplyExpr & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DConstant & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DIfElseExpr & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DLambdaExpr & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DSequenceExpr & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVarRef & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DGlobalSymtab & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DLocalSymtab & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -51,8 +51,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DTypename & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVariable & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -104,13 +104,8 @@ namespace xo {
|
|||
|
||||
// ----- gcobject facet -----
|
||||
|
||||
std::size_t
|
||||
DApplyExpr::shallow_size() const noexcept {
|
||||
return sizeof(DApplyExpr) + (n_args_ * sizeof(obj<AExpression>));
|
||||
}
|
||||
|
||||
DApplyExpr *
|
||||
DApplyExpr::shallow_move(obj<ACollector> gc) noexcept {
|
||||
DApplyExpr::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept {
|
||||
// note: not using ACollector.std_copy_for() here,
|
||||
// flexible array -> not move-constructible
|
||||
|
||||
|
|
|
|||
|
|
@ -71,14 +71,8 @@ namespace xo {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
std::size_t
|
||||
DConstant::shallow_size() const noexcept
|
||||
{
|
||||
return sizeof(DConstant);
|
||||
}
|
||||
|
||||
DConstant *
|
||||
DConstant::shallow_move(obj<ACollector> gc) noexcept
|
||||
DConstant::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
|
||||
{
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,14 +78,8 @@ namespace xo {
|
|||
|
||||
// ----- GCObject facet -----
|
||||
|
||||
std::size_t
|
||||
DDefineExpr::shallow_size() const noexcept
|
||||
{
|
||||
return sizeof(*this);
|
||||
}
|
||||
|
||||
DDefineExpr *
|
||||
DDefineExpr::shallow_move(obj<ACollector> gc) noexcept
|
||||
DDefineExpr::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
|
||||
{
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ namespace xo {
|
|||
// ----- gcobject facet -----
|
||||
|
||||
DGlobalSymtab *
|
||||
DGlobalSymtab::shallow_move(obj<ACollector> gc) noexcept
|
||||
DGlobalSymtab::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
|
||||
{
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,14 +82,8 @@ namespace xo {
|
|||
|
||||
// GCObject facet
|
||||
|
||||
std::size_t
|
||||
DIfElseExpr::shallow_size() const noexcept
|
||||
{
|
||||
return sizeof(DIfElseExpr);
|
||||
}
|
||||
|
||||
DIfElseExpr *
|
||||
DIfElseExpr::shallow_move(obj<ACollector> gc) noexcept
|
||||
DIfElseExpr::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
|
||||
{
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
DLambdaExpr *
|
||||
DLambdaExpr::shallow_move(obj<ACollector> gc) noexcept {
|
||||
DLambdaExpr::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept {
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ namespace xo {
|
|||
// ----- gcobject facet -----
|
||||
|
||||
DLocalSymtab *
|
||||
DLocalSymtab::shallow_move(obj<ACollector> gc) noexcept
|
||||
DLocalSymtab::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
|
||||
{
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,14 +113,8 @@ namespace xo {
|
|||
|
||||
// gc hooks for IGCObject_DSequenceExpr
|
||||
|
||||
std::size_t
|
||||
DSequenceExpr::shallow_size() const noexcept
|
||||
{
|
||||
return sizeof(DSequenceExpr);
|
||||
}
|
||||
|
||||
DSequenceExpr *
|
||||
DSequenceExpr::shallow_move(obj<ACollector> gc) noexcept
|
||||
DSequenceExpr::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
|
||||
{
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,14 +40,8 @@ namespace xo {
|
|||
: name_{name}, type_{type}
|
||||
{}
|
||||
|
||||
size_t
|
||||
DTypename::shallow_size() const noexcept
|
||||
{
|
||||
return sizeof(DTypename);
|
||||
}
|
||||
|
||||
DTypename *
|
||||
DTypename::shallow_move(obj<ACollector> gc) noexcept
|
||||
DTypename::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
|
||||
{
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,14 +58,8 @@ namespace xo {
|
|||
|
||||
// gcobject facet
|
||||
|
||||
std::size_t
|
||||
DVarRef::shallow_size() const noexcept
|
||||
{
|
||||
return sizeof(DVarRef);
|
||||
}
|
||||
|
||||
DVarRef *
|
||||
DVarRef::shallow_move(obj<ACollector> gc) noexcept
|
||||
DVarRef::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
|
||||
{
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,14 +38,8 @@ namespace xo {
|
|||
typeref_.resolve(td);
|
||||
}
|
||||
|
||||
size_t
|
||||
DVariable::shallow_size() const noexcept
|
||||
{
|
||||
return sizeof(DVariable);
|
||||
}
|
||||
|
||||
DVariable *
|
||||
DVariable::shallow_move(obj<ACollector> gc) noexcept
|
||||
DVariable::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
|
||||
{
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DApplyExpr::visit_gco_children(DApplyExpr & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DConstant::visit_gco_children(DConstant & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DDefineExpr::visit_gco_children(DDefineExpr & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DGlobalSymtab::visit_gco_children(DGlobalSymtab & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DIfElseExpr::visit_gco_children(DIfElseExpr & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DLambdaExpr::visit_gco_children(DLambdaExpr & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DLocalSymtab::visit_gco_children(DLocalSymtab & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DSequenceExpr::visit_gco_children(DSequenceExpr & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DTypename::visit_gco_children(DTypename & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DVarRef::visit_gco_children(DVarRef & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DVariable::visit_gco_children(DVariable & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -870,7 +870,7 @@ namespace xo {
|
|||
|
||||
//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("tseq", info.tseq()),
|
||||
|
|
|
|||
|
|
@ -24,9 +24,12 @@ namespace xo {
|
|||
|
||||
FacetRegistry::register_impl<AAllocator, DX1Collector>();
|
||||
FacetRegistry::register_impl<ACollector, DX1Collector>();
|
||||
FacetRegistry::register_impl<AGCObjectVisitor, DX1Collector>();
|
||||
|
||||
log && log(xtag("DX1Collector.tseq", typeseq::id<DX1Collector>()));
|
||||
|
||||
log && log(xtag("ACollector.tseq", typeseq::id<ACollector>()));
|
||||
log && log(xtag("AGCObjectVisitor.tseq", typeseq::id<AGCObjectVisitor>()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace xo {
|
|||
class DClosure {
|
||||
public:
|
||||
using ARuntimeContext = xo::scm::ARuntimeContext;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -58,7 +58,7 @@ namespace xo {
|
|||
/** @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;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace xo {
|
|||
class DLocalEnv {
|
||||
public:
|
||||
using DArray = xo::scm::DArray;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -55,7 +55,7 @@ namespace xo {
|
|||
/** @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;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace xo {
|
|||
|
||||
/** gcobject facet **/
|
||||
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;
|
||||
|
||||
/** pretty-printing support **/
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace xo {
|
|||
class DVsmApplyFrame {
|
||||
public:
|
||||
using AProcedure = xo::scm::AProcedure;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -38,7 +38,7 @@ namespace xo {
|
|||
|
||||
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;
|
||||
|
||||
/** pretty-printing support **/
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace xo {
|
|||
**/
|
||||
class DVsmDefContFrame {
|
||||
public:
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
|
|
@ -51,7 +51,7 @@ namespace xo {
|
|||
/** @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;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace xo {
|
|||
/** frame for executing an apply expression **/
|
||||
class DVsmEvalArgsFrame {
|
||||
public:
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -43,7 +43,7 @@ namespace xo {
|
|||
|
||||
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;
|
||||
|
||||
bool pretty(const ppindentinfo & ppii) const;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace xo {
|
|||
**/
|
||||
class DVsmIfElseContFrame {
|
||||
public:
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -51,7 +51,7 @@ namespace xo {
|
|||
/** @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;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace xo {
|
|||
**/
|
||||
class DVsmSeqContFrame {
|
||||
public:
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
|
|
@ -32,10 +32,10 @@ namespace xo {
|
|||
|
||||
/** create instance using memory from allocator @p mm **/
|
||||
static DVsmSeqContFrame * make(obj<AAllocator> mm,
|
||||
obj<AGCObject> parent,
|
||||
VsmInstr cont,
|
||||
DSequenceExpr * seq_expr,
|
||||
uint32_t i_seq);
|
||||
obj<AGCObject> parent,
|
||||
VsmInstr cont,
|
||||
DSequenceExpr * seq_expr,
|
||||
uint32_t i_seq);
|
||||
|
||||
///@}
|
||||
/** @defgroup scm-vsmevalsequenceframe-access-methods access methods **/
|
||||
|
|
@ -56,7 +56,7 @@ namespace xo {
|
|||
/** @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;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVsmDefContFrame & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DClosure & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVsmApplyClosureFrame & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVsmApplyFrame & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVsmEvalArgsFrame & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DLocalEnv & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVsmIfElseContFrame & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVsmSeqContFrame & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ namespace xo {
|
|||
public:
|
||||
// will be DArenaVector<obj<StackFrame>> probably
|
||||
using Stack = void *;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -154,7 +154,7 @@ namespace xo {
|
|||
/** shallow copy during gc cycle. Not implemented! Only intending to support
|
||||
* VSM as virtual root
|
||||
**/
|
||||
DVirtualSchematikaMachine * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DVirtualSchematikaMachine * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
/** forward gc-aware child pointers
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVirtualSchematikaMachine & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
DClosure *
|
||||
DClosure::shallow_move(obj<ACollector> gc) noexcept {
|
||||
DClosure::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept {
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
DLocalEnv *
|
||||
DLocalEnv::shallow_move(obj<ACollector> gc) noexcept {
|
||||
DLocalEnv::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept {
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -954,8 +954,11 @@ namespace xo {
|
|||
}
|
||||
|
||||
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;
|
||||
|
||||
/** TODO: should be able to use gc.std_move_for(this) now
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
DVsmApplyClosureFrame *
|
||||
DVsmApplyClosureFrame::shallow_move(obj<ACollector> gc) noexcept
|
||||
DVsmApplyClosureFrame::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
|
||||
{
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
DVsmApplyFrame *
|
||||
DVsmApplyFrame::shallow_move(obj<ACollector> gc) noexcept
|
||||
DVsmApplyFrame::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
|
||||
{
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace xo {
|
|||
// gcobject facet
|
||||
|
||||
DVsmDefContFrame *
|
||||
DVsmDefContFrame::shallow_move(obj<ACollector> gc) noexcept
|
||||
DVsmDefContFrame::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
|
||||
{
|
||||
return gc.std_move_for<DVsmDefContFrame>(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
DVsmEvalArgsFrame *
|
||||
DVsmEvalArgsFrame::shallow_move(obj<ACollector> gc) noexcept
|
||||
DVsmEvalArgsFrame::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
|
||||
{
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ namespace xo {
|
|||
// gcobject facet
|
||||
|
||||
DVsmIfElseContFrame *
|
||||
DVsmIfElseContFrame::shallow_move(obj<ACollector> gc) noexcept
|
||||
DVsmIfElseContFrame::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
|
||||
{
|
||||
return gc.std_move_for<DVsmIfElseContFrame>(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,9 +33,9 @@ namespace xo {
|
|||
// gcobject facet
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DClosure::visit_gco_children(DClosure & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DVsmApplyClosureFrame::visit_gco_children(DVsmApplyClosureFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DVsmApplyFrame::visit_gco_children(DVsmApplyFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DVsmDefContFrame::visit_gco_children(DVsmDefContFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DVsmEvalArgsFrame::visit_gco_children(DVsmEvalArgsFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DVsmIfElseContFrame::visit_gco_children(DVsmIfElseContFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DVsmSeqContFrame::visit_gco_children(DVsmSeqContFrame & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DLocalEnv::visit_gco_children(DLocalEnv & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
namespace xo {
|
||||
namespace scm {
|
||||
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
|
||||
IGCObject_DVirtualSchematikaMachine::visit_gco_children(DVirtualSchematikaMachine & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <xo/alloc2/GCObject.hpp>
|
||||
#include <xo/alloc2/Collector.hpp>
|
||||
//#include <xo/alloc2/Collector.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include <xo/facet/obj.hpp>
|
||||
#include <xo/indentlog/print/ppindentinfo.hpp>
|
||||
|
|
@ -33,7 +33,7 @@ namespace xo {
|
|||
/** xo allocator facet **/
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
/** garbage collector facet **/
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
/** gc-aware object facet **/
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
/** gc-centric object visitor **/
|
||||
|
|
@ -148,7 +148,7 @@ namespace xo {
|
|||
/** @defgroup darray-gcobject-methods **/
|
||||
///@{
|
||||
/** 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 **/
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <xo/alloc2/Collector.hpp>
|
||||
//#include <xo/alloc2/Collector.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include <xo/alloc2/GCObjectVisitor.hpp>
|
||||
#include <xo/indentlog/print/ppindentinfo.hpp>
|
||||
|
|
@ -16,7 +16,7 @@ namespace xo {
|
|||
namespace scm {
|
||||
struct DBoolean {
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
|
|
@ -39,7 +39,7 @@ namespace xo {
|
|||
|
||||
// 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;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ namespace xo {
|
|||
/** @defgroup ddictionary-gcobject-methods **/
|
||||
///@{
|
||||
/** 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 **/
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include <xo/alloc2/Collector.hpp>
|
||||
//#include <xo/alloc2/Collector.hpp>
|
||||
#include <xo/alloc2/GCObjectVisitor.hpp>
|
||||
#include <xo/facet/obj.hpp>
|
||||
#include <xo/indentlog/print/ppindentinfo.hpp>
|
||||
|
|
@ -15,7 +15,7 @@ namespace xo {
|
|||
namespace scm {
|
||||
struct DFloat {
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
using value_type = double;
|
||||
|
|
@ -36,7 +36,7 @@ namespace xo {
|
|||
bool pretty(const ppindentinfo & ppii) const;
|
||||
|
||||
// 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;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <xo/alloc2/Collector.hpp>
|
||||
//#include <xo/alloc2/Collector.hpp>
|
||||
#include <xo/alloc2/GCObjectVisitor.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include <xo/indentlog/print/ppindentinfo.hpp>
|
||||
|
|
@ -16,7 +16,7 @@ namespace xo {
|
|||
namespace scm {
|
||||
struct DInteger {
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
|
|
@ -41,7 +41,7 @@ namespace xo {
|
|||
|
||||
// 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;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <xo/alloc2/Collector.hpp>
|
||||
#include <xo/alloc2/GCObject.hpp>
|
||||
#include <xo/facet/obj.hpp>
|
||||
#include <xo/indentlog/print/ppindentinfo.hpp>
|
||||
|
|
@ -70,7 +71,7 @@ namespace xo {
|
|||
|
||||
/** @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;
|
||||
///@}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace xo {
|
|||
class DRuntimeError {
|
||||
public:
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
|
|
@ -50,7 +50,7 @@ namespace xo {
|
|||
/** @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;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -51,8 +51,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DArray & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -51,8 +51,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DBoolean & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
|
|
@ -51,8 +51,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DDictionary & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
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.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue