From 1b93c9a427e6d8673a95fc2d4d738f45438d3f23 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 5 Dec 2025 19:54:00 -0500 Subject: [PATCH] xo-ordinaltree: start work on gc-aware Key,Value in rbtree --- include/xo/alloc/Object.hpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/include/xo/alloc/Object.hpp b/include/xo/alloc/Object.hpp index 5f31356f..dce67c11 100644 --- a/include/xo/alloc/Object.hpp +++ b/include/xo/alloc/Object.hpp @@ -5,15 +5,16 @@ #pragma once -#include "xo/reflect/TaggedPtr.hpp" -#include "IAlloc.hpp" #include "xo/allocutil/IObject.hpp" +#include "xo/reflect/TaggedPtr.hpp" +#include "xo/allocutil/ObjectVisitor.hpp" #include "xo/allocutil/gc_ptr.hpp" #include #include namespace xo { namespace gc { + class IAlloc; class GC; class ObjectStatistics; }; @@ -147,6 +148,18 @@ namespace xo { reinterpret_cast(rhs.ptr())); } + namespace gc { + template + class ObjectVisitor> { + public: + void forward_children(gp & target, + IAlloc * gc) + { + Object::_forward_inplace(target, gc); + } + }; + } + std::ostream & operator<< (std::ostream & os, gp x);