diff --git a/include/xo/type/DArrayType.hpp b/include/xo/type/DArrayType.hpp index a8efe32..2d12f19 100644 --- a/include/xo/type/DArrayType.hpp +++ b/include/xo/type/DArrayType.hpp @@ -42,7 +42,7 @@ namespace xo { /** @defgroup xo-scm-arraytype-gcobject-facet **/ ///@{ std::size_t shallow_size() const noexcept; - DArrayType * shallow_copy(obj mm) const noexcept; + DArrayType * shallow_copy(obj mm) noexcept; std::size_t forward_children(obj gc) noexcept; ///@} diff --git a/include/xo/type/DAtomicType.hpp b/include/xo/type/DAtomicType.hpp index 6cd11ba..406ed46 100644 --- a/include/xo/type/DAtomicType.hpp +++ b/include/xo/type/DAtomicType.hpp @@ -43,7 +43,7 @@ namespace xo { /** @defgroup xo-scm-atomictype-gcobject-facet **/ ///@{ std::size_t shallow_size() const noexcept; - DAtomicType * shallow_copy(obj mm) const noexcept; + DAtomicType * shallow_copy(obj mm) noexcept; std::size_t forward_children(obj gc) noexcept; ///@} diff --git a/include/xo/type/DFunctionType.hpp b/include/xo/type/DFunctionType.hpp index 51568bf..c3d409d 100644 --- a/include/xo/type/DFunctionType.hpp +++ b/include/xo/type/DFunctionType.hpp @@ -64,7 +64,7 @@ namespace xo { /** @defgroup xo-scm-arraytype-gcobject-facet **/ ///@{ std::size_t shallow_size() const noexcept; - DFunctionType * shallow_copy(obj mm) const noexcept; + DFunctionType * shallow_copy(obj mm) noexcept; std::size_t forward_children(obj gc) noexcept; ///@} diff --git a/include/xo/type/DListType.hpp b/include/xo/type/DListType.hpp index e19e48b..8b5e057 100644 --- a/include/xo/type/DListType.hpp +++ b/include/xo/type/DListType.hpp @@ -50,7 +50,7 @@ namespace xo { /** @defgroup xo-scm-listtype-gcobject-facet **/ ///@{ std::size_t shallow_size() const noexcept; - DListType * shallow_copy(obj mm) const noexcept; + DListType * shallow_copy(obj mm) noexcept; std::size_t forward_children(obj gc) noexcept; ///@} diff --git a/include/xo/type/array/IGCObject_DArrayType.hpp b/include/xo/type/array/IGCObject_DArrayType.hpp index bb71960..a436a08 100644 --- a/include/xo/type/array/IGCObject_DArrayType.hpp +++ b/include/xo/type/array/IGCObject_DArrayType.hpp @@ -50,10 +50,10 @@ namespace xo { // const methods /** memory consumption for this instance **/ static size_type shallow_size(const DArrayType & self) noexcept; - /** copy instance using allocator **/ - static Opaque shallow_copy(const DArrayType & self, obj mm) noexcept; // non-const methods + /** copy instance using allocator **/ + static Opaque shallow_copy(DArrayType & self, obj mm) noexcept; /** during GC: forward immdiate children **/ static size_type forward_children(DArrayType & self, obj gc) noexcept; ///@} diff --git a/include/xo/type/atomic/IGCObject_DAtomicType.hpp b/include/xo/type/atomic/IGCObject_DAtomicType.hpp index c1fff45..4a5a570 100644 --- a/include/xo/type/atomic/IGCObject_DAtomicType.hpp +++ b/include/xo/type/atomic/IGCObject_DAtomicType.hpp @@ -50,10 +50,10 @@ namespace xo { // const methods /** memory consumption for this instance **/ static size_type shallow_size(const DAtomicType & self) noexcept; - /** copy instance using allocator **/ - static Opaque shallow_copy(const DAtomicType & self, obj mm) noexcept; // non-const methods + /** copy instance using allocator **/ + static Opaque shallow_copy(DAtomicType & self, obj mm) noexcept; /** during GC: forward immdiate children **/ static size_type forward_children(DAtomicType & self, obj gc) noexcept; ///@} diff --git a/include/xo/type/function/IGCObject_DFunctionType.hpp b/include/xo/type/function/IGCObject_DFunctionType.hpp index 431c19e..bc63285 100644 --- a/include/xo/type/function/IGCObject_DFunctionType.hpp +++ b/include/xo/type/function/IGCObject_DFunctionType.hpp @@ -50,10 +50,10 @@ namespace xo { // const methods /** memory consumption for this instance **/ static size_type shallow_size(const DFunctionType & self) noexcept; - /** copy instance using allocator **/ - static Opaque shallow_copy(const DFunctionType & self, obj mm) noexcept; // non-const methods + /** copy instance using allocator **/ + static Opaque shallow_copy(DFunctionType & self, obj mm) noexcept; /** during GC: forward immdiate children **/ static size_type forward_children(DFunctionType & self, obj gc) noexcept; ///@} diff --git a/include/xo/type/list/IGCObject_DListType.hpp b/include/xo/type/list/IGCObject_DListType.hpp index 6393d35..cd017ec 100644 --- a/include/xo/type/list/IGCObject_DListType.hpp +++ b/include/xo/type/list/IGCObject_DListType.hpp @@ -50,10 +50,10 @@ namespace xo { // const methods /** memory consumption for this instance **/ static size_type shallow_size(const DListType & self) noexcept; - /** copy instance using allocator **/ - static Opaque shallow_copy(const DListType & self, obj mm) noexcept; // non-const methods + /** copy instance using allocator **/ + static Opaque shallow_copy(DListType & self, obj mm) noexcept; /** during GC: forward immdiate children **/ static size_type forward_children(DListType & self, obj gc) noexcept; ///@} diff --git a/include/xo/type/type/AType.hpp b/include/xo/type/type/AType.hpp index d0e8361..018c0f5 100644 --- a/include/xo/type/type/AType.hpp +++ b/include/xo/type/type/AType.hpp @@ -50,6 +50,11 @@ public: /** @defgroup scm-type-methods **/ ///@{ // const methods + /** An uninitialized AType instance will have zero vtable pointer (per {linux,osx} abi). + * Use case for this is narrow. We go to some lengths to avoid null vtable pointers. For example + * obj will have non-null vtable (via IFacet_Any) with all methods terminating. + **/ + bool _has_null_vptr() const noexcept { return *reinterpret_cast(this) == nullptr; } /** 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 **/ diff --git a/include/xo/type/typevar/DTypeVarRef.hpp b/include/xo/type/typevar/DTypeVarRef.hpp index 0f67ee1..d53caa0 100644 --- a/include/xo/type/typevar/DTypeVarRef.hpp +++ b/include/xo/type/typevar/DTypeVarRef.hpp @@ -54,7 +54,7 @@ namespace xo { /** @defgroup xo-scm-atomictype-gcobject-facet **/ ///@{ std::size_t shallow_size() const noexcept; - DTypeVarRef * shallow_copy(obj mm) const noexcept; + DTypeVarRef * shallow_copy(obj mm) noexcept; std::size_t forward_children(obj gc) noexcept; ///@} diff --git a/include/xo/type/typevar/IGCObject_DTypeVarRef.hpp b/include/xo/type/typevar/IGCObject_DTypeVarRef.hpp index 876caaa..56780e3 100644 --- a/include/xo/type/typevar/IGCObject_DTypeVarRef.hpp +++ b/include/xo/type/typevar/IGCObject_DTypeVarRef.hpp @@ -50,10 +50,10 @@ namespace xo { // const methods /** memory consumption for this instance **/ static size_type shallow_size(const DTypeVarRef & self) noexcept; - /** copy instance using allocator **/ - static Opaque shallow_copy(const DTypeVarRef & self, obj mm) noexcept; // non-const methods + /** copy instance using allocator **/ + static Opaque shallow_copy(DTypeVarRef & self, obj mm) noexcept; /** during GC: forward immdiate children **/ static size_type forward_children(DTypeVarRef & self, obj gc) noexcept; ///@} diff --git a/src/type/DArrayType.cpp b/src/type/DArrayType.cpp index 652186a..f13f234 100644 --- a/src/type/DArrayType.cpp +++ b/src/type/DArrayType.cpp @@ -83,7 +83,7 @@ namespace xo { } DArrayType * - DArrayType::shallow_copy(obj mm) const noexcept + DArrayType::shallow_copy(obj mm) noexcept { return mm.std_copy_for(this); } diff --git a/src/type/DAtomicType.cpp b/src/type/DAtomicType.cpp index bc2fe55..347e7f5 100644 --- a/src/type/DAtomicType.cpp +++ b/src/type/DAtomicType.cpp @@ -61,7 +61,7 @@ namespace xo { } DAtomicType * - DAtomicType::shallow_copy(obj mm) const noexcept + DAtomicType::shallow_copy(obj mm) noexcept { return mm.std_copy_for(this); } diff --git a/src/type/DFunctionType.cpp b/src/type/DFunctionType.cpp index 88de628..4cc83db 100644 --- a/src/type/DFunctionType.cpp +++ b/src/type/DFunctionType.cpp @@ -94,7 +94,7 @@ namespace xo { } DFunctionType * - DFunctionType::shallow_copy(obj mm) const noexcept + DFunctionType::shallow_copy(obj mm) noexcept { return mm.std_copy_for(this); } diff --git a/src/type/DListType.cpp b/src/type/DListType.cpp index 47c8ea1..b4e2cd4 100644 --- a/src/type/DListType.cpp +++ b/src/type/DListType.cpp @@ -88,7 +88,7 @@ namespace xo { } DListType * - DListType::shallow_copy(obj mm) const noexcept + DListType::shallow_copy(obj mm) noexcept { return mm.std_copy_for(this); } diff --git a/src/type/DTypeVarRef.cpp b/src/type/DTypeVarRef.cpp index 8da0ec0..ec021ab 100644 --- a/src/type/DTypeVarRef.cpp +++ b/src/type/DTypeVarRef.cpp @@ -82,7 +82,7 @@ namespace xo { } DTypeVarRef * - DTypeVarRef::shallow_copy(obj mm) const noexcept + DTypeVarRef::shallow_copy(obj mm) noexcept { return mm.std_copy_for(this); } diff --git a/src/type/IGCObject_DArrayType.cpp b/src/type/IGCObject_DArrayType.cpp index 936f8ee..43287c8 100644 --- a/src/type/IGCObject_DArrayType.cpp +++ b/src/type/IGCObject_DArrayType.cpp @@ -22,11 +22,10 @@ namespace xo { } auto - IGCObject_DArrayType::shallow_copy(const DArrayType & self, obj mm) noexcept -> Opaque + IGCObject_DArrayType::shallow_copy(DArrayType & self, obj mm) noexcept -> Opaque { return self.shallow_copy(mm); } - auto IGCObject_DArrayType::forward_children(DArrayType & self, obj gc) noexcept -> size_type { diff --git a/src/type/IGCObject_DAtomicType.cpp b/src/type/IGCObject_DAtomicType.cpp index 17f3a56..a569167 100644 --- a/src/type/IGCObject_DAtomicType.cpp +++ b/src/type/IGCObject_DAtomicType.cpp @@ -22,11 +22,10 @@ namespace xo { } auto - IGCObject_DAtomicType::shallow_copy(const DAtomicType & self, obj mm) noexcept -> Opaque + IGCObject_DAtomicType::shallow_copy(DAtomicType & self, obj mm) noexcept -> Opaque { return self.shallow_copy(mm); } - auto IGCObject_DAtomicType::forward_children(DAtomicType & self, obj gc) noexcept -> size_type { diff --git a/src/type/IGCObject_DFunctionType.cpp b/src/type/IGCObject_DFunctionType.cpp index 45141b3..9ba3ff3 100644 --- a/src/type/IGCObject_DFunctionType.cpp +++ b/src/type/IGCObject_DFunctionType.cpp @@ -22,11 +22,10 @@ namespace xo { } auto - IGCObject_DFunctionType::shallow_copy(const DFunctionType & self, obj mm) noexcept -> Opaque + IGCObject_DFunctionType::shallow_copy(DFunctionType & self, obj mm) noexcept -> Opaque { return self.shallow_copy(mm); } - auto IGCObject_DFunctionType::forward_children(DFunctionType & self, obj gc) noexcept -> size_type { diff --git a/src/type/IGCObject_DListType.cpp b/src/type/IGCObject_DListType.cpp index 761ae61..da899cd 100644 --- a/src/type/IGCObject_DListType.cpp +++ b/src/type/IGCObject_DListType.cpp @@ -22,11 +22,10 @@ namespace xo { } auto - IGCObject_DListType::shallow_copy(const DListType & self, obj mm) noexcept -> Opaque + IGCObject_DListType::shallow_copy(DListType & self, obj mm) noexcept -> Opaque { return self.shallow_copy(mm); } - auto IGCObject_DListType::forward_children(DListType & self, obj gc) noexcept -> size_type { diff --git a/src/type/IGCObject_DTypeVarRef.cpp b/src/type/IGCObject_DTypeVarRef.cpp index c0aeb3b..ade7994 100644 --- a/src/type/IGCObject_DTypeVarRef.cpp +++ b/src/type/IGCObject_DTypeVarRef.cpp @@ -22,11 +22,10 @@ namespace xo { } auto - IGCObject_DTypeVarRef::shallow_copy(const DTypeVarRef & self, obj mm) noexcept -> Opaque + IGCObject_DTypeVarRef::shallow_copy(DTypeVarRef & self, obj mm) noexcept -> Opaque { return self.shallow_copy(mm); } - auto IGCObject_DTypeVarRef::forward_children(DTypeVarRef & self, obj gc) noexcept -> size_type {