From 7f792bea9b09cf8ac05086e8e2d41ee8812e396f Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 14 Dec 2025 11:30:12 -0500 Subject: [PATCH] xo-alloc2: shallow_copy api + bugfixes [WIP] --- CMakeLists.txt | 1 + xo-alloc2/include/xo/alloc2/AGCObject.hpp | 6 +++++- xo-alloc2/include/xo/alloc2/IGCObject_Any.hpp | 7 ++++--- xo-alloc2/include/xo/alloc2/IGCObject_Xfer.hpp | 4 ++-- xo-alloc2/include/xo/alloc2/RAllocator.hpp | 1 + xo-facet/include/xo/facet/obj.hpp | 2 ++ 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index becae3d2..aeef1885 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,6 +93,7 @@ add_subdirectory(xo-callback) add_subdirectory(xo-alloc) add_subdirectory(xo-alloc2) # experiment w/ sep iface,data add_subdirectory(xo-object) +add_subdirectory(xo-object2) # experiment w/ facet object model add_subdirectory(xo-ordinaltree) # add_subdirectory(xo-webutil) diff --git a/xo-alloc2/include/xo/alloc2/AGCObject.hpp b/xo-alloc2/include/xo/alloc2/AGCObject.hpp index ef9e33aa..fc9c016d 100644 --- a/xo-alloc2/include/xo/alloc2/AGCObject.hpp +++ b/xo-alloc2/include/xo/alloc2/AGCObject.hpp @@ -5,8 +5,11 @@ #pragma once +#include "IAllocator_Any.hpp" +#include "RAllocator.hpp" #include "xo/facet/facet_implementation.hpp" #include "xo/facet/typeseq.hpp" +#include "xo/facet/obj.hpp" #include #include @@ -28,7 +31,8 @@ namespace xo { virtual int32_t _typeseq() const noexcept = 0; virtual size_type shallow_size(Copaque d) const noexcept = 0; - virtual Opaque * shallow_copy(Copaque d) const noexcept = 0; + virtual Opaque * shallow_copy(Copaque d, + obj mm) const noexcept = 0; virtual size_type forward_children(Opaque d) const noexcept = 0; }; diff --git a/xo-alloc2/include/xo/alloc2/IGCObject_Any.hpp b/xo-alloc2/include/xo/alloc2/IGCObject_Any.hpp index 114b17a4..039a1259 100644 --- a/xo-alloc2/include/xo/alloc2/IGCObject_Any.hpp +++ b/xo-alloc2/include/xo/alloc2/IGCObject_Any.hpp @@ -30,9 +30,10 @@ namespace xo { // from AGCObject int32_t _typeseq() const noexcept override { return s_typeseq; } - [[noreturn]] size_type shallow_size() const noexcept override { _fatal(); } - [[noreturn]] Opaque * shallow_copy() const noexcept override { _fatal(); } - [[noreturn]] size_type forward_children() const noexcept override { _fatal(); } + [[noreturn]] size_type shallow_size(Copaque) const noexcept override { _fatal(); } + [[noreturn]] Opaque * shallow_copy(Copaque, + obj) const noexcept override { _fatal(); } + [[noreturn]] size_type forward_children(Opaque) const noexcept override { _fatal(); } private: [[noreturn]] static void _fatal(); diff --git a/xo-alloc2/include/xo/alloc2/IGCObject_Xfer.hpp b/xo-alloc2/include/xo/alloc2/IGCObject_Xfer.hpp index 1756d389..75f78fd6 100644 --- a/xo-alloc2/include/xo/alloc2/IGCObject_Xfer.hpp +++ b/xo-alloc2/include/xo/alloc2/IGCObject_Xfer.hpp @@ -30,8 +30,8 @@ namespace xo { size_type shallow_size(Copaque d) const noexcept override { return I::shallow_copy(_dcast(d)); } - Opaque * shallow_copy(Copaque d) const noexcept override { - return I::shallow_size(_dcast(d)); + Opaque * shallow_copy(Copaque d, obj mm) const noexcept override { + return I::shallow_size(_dcast(d), mm); } // non-const methods diff --git a/xo-alloc2/include/xo/alloc2/RAllocator.hpp b/xo-alloc2/include/xo/alloc2/RAllocator.hpp index 8f1bc80a..012c7c2b 100644 --- a/xo-alloc2/include/xo/alloc2/RAllocator.hpp +++ b/xo-alloc2/include/xo/alloc2/RAllocator.hpp @@ -5,6 +5,7 @@ #pragma once +#include "AAllocator.hpp" #include "xo/facet/RRouter.hpp" #include diff --git a/xo-facet/include/xo/facet/obj.hpp b/xo-facet/include/xo/facet/obj.hpp index 82d4cdab..a90de8c6 100644 --- a/xo-facet/include/xo/facet/obj.hpp +++ b/xo-facet/include/xo/facet/obj.hpp @@ -95,6 +95,8 @@ namespace xo { return obj(data); } } /*namespace facet*/ + + using facet::obj; } /*namespace xo*/ /* end obj.hpp */