From cd143dce297979abe6f524647422540d989ec8bf Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 16 Feb 2026 17:46:51 -0500 Subject: [PATCH] xo-interpreter2 stack: OUTPUT_CPP_DIR cmake->idl/ --- CMakeLists.txt | 1 - idl/GCObject.json5 | 1 + include/xo/gc/GCObject.hpp | 3 +-- include/xo/gc/detail/AGCObject.hpp | 6 ++++-- include/xo/gc/detail/IGCObject_Any.hpp | 9 ++++++--- include/xo/gc/detail/IGCObject_Xfer.hpp | 9 ++++++--- include/xo/gc/detail/RGCObject.hpp | 9 +++++++-- src/gc/IGCObject_Any.cpp | 2 +- 8 files changed, 26 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c0bf841..59f13d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,6 @@ xo_add_genfacet( INPUT idl/GCObject.json5 OUTPUT_HPP_DIR include/xo/gc OUTPUT_IMPL_SUBDIR detail - OUTPUT_CPP_DIR src/gc ) # ---------------------------------------------------------------- diff --git a/idl/GCObject.json5 b/idl/GCObject.json5 index 30fc0d3..242bea1 100644 --- a/idl/GCObject.json5 +++ b/idl/GCObject.json5 @@ -1,5 +1,6 @@ { mode: "facet", + output_cpp_dir: "src/gc", includes: [ "", "", diff --git a/include/xo/gc/GCObject.hpp b/include/xo/gc/GCObject.hpp index 970d2c3..c40ffb3 100644 --- a/include/xo/gc/GCObject.hpp +++ b/include/xo/gc/GCObject.hpp @@ -2,7 +2,7 @@ * * Generated automagically from ingredients: * 1. code generator: - * [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet] + * [xo-facet/codegen/genfacet] * arguments: * --input [idl/GCObject.json5] * 2. jinja2 template for facet .hpp file: @@ -45,4 +45,3 @@ namespace xo { } /* end GCObject.hpp */ - diff --git a/include/xo/gc/detail/AGCObject.hpp b/include/xo/gc/detail/AGCObject.hpp index ab6b409..98f7e25 100644 --- a/include/xo/gc/detail/AGCObject.hpp +++ b/include/xo/gc/detail/AGCObject.hpp @@ -2,7 +2,7 @@ * * Generated automagically from ingredients: * 1. code generator: - * [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet] + * [xo-facet/codegen/genfacet] * arguments: * --input [idl/GCObject.json5] * 2. jinja2 template for abstract facet .hpp file: @@ -55,6 +55,8 @@ public: // const methods /** RTTI: unique id# for actual runtime data representation **/ virtual typeseq _typeseq() const noexcept = 0; + /** destroy instance @p d; calls c++ dtor only for actual runtime type; does not recover memory **/ + virtual void _drop(Opaque d) const noexcept = 0; /** memory consumption for this instance **/ virtual size_type shallow_size(Copaque data) const noexcept = 0; /** copy instance using allocator **/ @@ -82,4 +84,4 @@ using IGCObject_ImplType = xo::facet::FacetImplType; } /*namespace mm*/ } /*namespace xo*/ -/* AGCObject.hpp */ \ No newline at end of file +/* AGCObject.hpp */ diff --git a/include/xo/gc/detail/IGCObject_Any.hpp b/include/xo/gc/detail/IGCObject_Any.hpp index e1b274a..9ff7bb2 100644 --- a/include/xo/gc/detail/IGCObject_Any.hpp +++ b/include/xo/gc/detail/IGCObject_Any.hpp @@ -2,7 +2,7 @@ * * Generated automagically from ingredients: * 1. code generator: - * [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet] + * [xo-facet/codegen/genfacet] * arguments: * --input [idl/GCObject.json5] * 2. jinja2 template for abstract facet .hpp file: @@ -56,8 +56,11 @@ namespace mm { // from AGCObject - // const methods + // builtin methods typeseq _typeseq() const noexcept override { return s_typeseq; } + [[noreturn]] void _drop(Opaque) const noexcept override { _fatal(); } + + // const methods [[noreturn]] size_type shallow_size(Copaque) const noexcept override { _fatal(); } [[noreturn]] Opaque shallow_copy(Copaque, obj) const noexcept override { _fatal(); } @@ -87,4 +90,4 @@ namespace mm { } /*namespace mm */ } /*namespace xo */ -/* IGCObject_Any.hpp */ \ No newline at end of file +/* IGCObject_Any.hpp */ diff --git a/include/xo/gc/detail/IGCObject_Xfer.hpp b/include/xo/gc/detail/IGCObject_Xfer.hpp index d25eb81..7f094ab 100644 --- a/include/xo/gc/detail/IGCObject_Xfer.hpp +++ b/include/xo/gc/detail/IGCObject_Xfer.hpp @@ -2,7 +2,7 @@ * * Generated automagically from ingredients: * 1. code generator: - * [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet] + * [xo-facet/codegen/genfacet] * arguments: * --input [idl/GCObject.json5] * 2. jinja2 template for abstract facet .hpp file: @@ -44,8 +44,11 @@ namespace mm { // from AGCObject - // const methods + // builtin methods typeseq _typeseq() const noexcept override { return s_typeseq; } + void _drop(Opaque d) const noexcept override { _dcast(d).~DRepr(); } + + // const methods size_type shallow_size(Copaque data) const noexcept override { return I::shallow_size(_dcast(data)); } @@ -89,4 +92,4 @@ namespace mm { } /*namespace mm */ } /*namespace xo*/ -/* end IGCObject_Xfer.hpp */ \ No newline at end of file +/* end IGCObject_Xfer.hpp */ diff --git a/include/xo/gc/detail/RGCObject.hpp b/include/xo/gc/detail/RGCObject.hpp index ab4bcc5..d24994a 100644 --- a/include/xo/gc/detail/RGCObject.hpp +++ b/include/xo/gc/detail/RGCObject.hpp @@ -2,7 +2,7 @@ * * Generated automagically from ingredients: * 1. code generator: - * [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet] + * [xo-facet/codegen/genfacet] * arguments: * --input [idl/GCObject.json5] * 2. jinja2 template for abstract facet .hpp file: @@ -48,8 +48,13 @@ public: /** @defgroup mm-gcobject-router-methods **/ ///@{ - // const methods + // explicit injected content + + // builtin methods typeseq _typeseq() const noexcept { return O::iface()->_typeseq(); } + void _drop() const noexcept { O::iface()->_drop(O::data()); } + + // const methods size_type shallow_size() const noexcept { return O::iface()->shallow_size(O::data()); } diff --git a/src/gc/IGCObject_Any.cpp b/src/gc/IGCObject_Any.cpp index ff6d395..778760a 100644 --- a/src/gc/IGCObject_Any.cpp +++ b/src/gc/IGCObject_Any.cpp @@ -44,4 +44,4 @@ IGCObject_Any::forward_children(Opaque, obj) const noexcept -> siz } /*namespace mm*/ } /*namespace xo*/ -/* end IGCObject_Any.cpp */ \ No newline at end of file +/* end IGCObject_Any.cpp */