From 9a494d268b44fdea37259088b8bcf1ef173ac5ea Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 4 Apr 2026 15:00:53 -0400 Subject: [PATCH] refactor: rename GCObject.shallow_copy -> shallow_move resolve conflict since relying on move constructor in std_copy_for --- include/xo/stringtable2/DString.hpp | 2 +- include/xo/stringtable2/DUniqueString.hpp | 2 +- include/xo/stringtable2/string/IGCObject_DString.hpp | 4 ++-- .../xo/stringtable2/uniquestring/IGCObject_DUniqueString.hpp | 4 ++-- src/stringtable2/DString.cpp | 2 +- src/stringtable2/DUniqueString.cpp | 2 +- src/stringtable2/IGCObject_DString.cpp | 4 ++-- src/stringtable2/IGCObject_DUniqueString.cpp | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/xo/stringtable2/DString.hpp b/include/xo/stringtable2/DString.hpp index bb57e3d..bfcd30f 100644 --- a/include/xo/stringtable2/DString.hpp +++ b/include/xo/stringtable2/DString.hpp @@ -245,7 +245,7 @@ namespace xo { size_type shallow_size() const noexcept; /** clone string, using memory from allocator @p mm **/ - DString * shallow_copy(obj mm) const noexcept; + DString * shallow_move(obj mm) const noexcept; size_type forward_children(obj gc) noexcept; /** fixup child pointers (trivial for DString, no children) diff --git a/include/xo/stringtable2/DUniqueString.hpp b/include/xo/stringtable2/DUniqueString.hpp index 9a4357e..d5b7562 100644 --- a/include/xo/stringtable2/DUniqueString.hpp +++ b/include/xo/stringtable2/DUniqueString.hpp @@ -91,7 +91,7 @@ namespace xo { std::size_t shallow_size() const noexcept; /** clone unique string, using memory from allocator @p mm. **/ - DUniqueString * shallow_copy(obj mm) const noexcept; + DUniqueString * shallow_move(obj mm) const noexcept; /** fixup child pointers (trivial for DUniqueString, no gc-owned children **/ std::size_t forward_children(obj gc) noexcept; diff --git a/include/xo/stringtable2/string/IGCObject_DString.hpp b/include/xo/stringtable2/string/IGCObject_DString.hpp index c04d9a0..6dc2ad1 100644 --- a/include/xo/stringtable2/string/IGCObject_DString.hpp +++ b/include/xo/stringtable2/string/IGCObject_DString.hpp @@ -54,8 +54,8 @@ namespace xo { static size_type shallow_size(const DString & self) noexcept; // non-const methods - /** copy instance using allocator **/ - static Opaque shallow_copy(DString & self, obj mm) noexcept; + /** move instance using allocator **/ + static Opaque shallow_move(DString & self, obj mm) noexcept; /** during GC: forward immdiate children **/ static size_type forward_children(DString & self, obj gc) noexcept; ///@} diff --git a/include/xo/stringtable2/uniquestring/IGCObject_DUniqueString.hpp b/include/xo/stringtable2/uniquestring/IGCObject_DUniqueString.hpp index 4701e50..1d6b8db 100644 --- a/include/xo/stringtable2/uniquestring/IGCObject_DUniqueString.hpp +++ b/include/xo/stringtable2/uniquestring/IGCObject_DUniqueString.hpp @@ -54,8 +54,8 @@ namespace xo { static size_type shallow_size(const DUniqueString & self) noexcept; // non-const methods - /** copy instance using allocator **/ - static Opaque shallow_copy(DUniqueString & self, obj mm) noexcept; + /** move instance using allocator **/ + static Opaque shallow_move(DUniqueString & self, obj mm) noexcept; /** during GC: forward immdiate children **/ static size_type forward_children(DUniqueString & self, obj gc) noexcept; ///@} diff --git a/src/stringtable2/DString.cpp b/src/stringtable2/DString.cpp index 230fa4a..f04db7f 100644 --- a/src/stringtable2/DString.cpp +++ b/src/stringtable2/DString.cpp @@ -156,7 +156,7 @@ namespace xo { } DString * - DString::shallow_copy(obj mm) const noexcept + DString::shallow_move(obj mm) const noexcept { DString * copy = (DString *)mm.alloc_copy((std::byte *)this); diff --git a/src/stringtable2/DUniqueString.cpp b/src/stringtable2/DUniqueString.cpp index 98a7b33..dcf7cc5 100644 --- a/src/stringtable2/DUniqueString.cpp +++ b/src/stringtable2/DUniqueString.cpp @@ -88,7 +88,7 @@ namespace xo { } DUniqueString * - DUniqueString::shallow_copy(obj mm) const noexcept + DUniqueString::shallow_move(obj mm) const noexcept { // well-posed, but not expected to be used. assert(false); diff --git a/src/stringtable2/IGCObject_DString.cpp b/src/stringtable2/IGCObject_DString.cpp index 0cc3518..c3f6503 100644 --- a/src/stringtable2/IGCObject_DString.cpp +++ b/src/stringtable2/IGCObject_DString.cpp @@ -22,9 +22,9 @@ namespace xo { } auto - IGCObject_DString::shallow_copy(DString & self, obj mm) noexcept -> Opaque + IGCObject_DString::shallow_move(DString & self, obj mm) noexcept -> Opaque { - return self.shallow_copy(mm); + return self.shallow_move(mm); } auto IGCObject_DString::forward_children(DString & self, obj gc) noexcept -> size_type diff --git a/src/stringtable2/IGCObject_DUniqueString.cpp b/src/stringtable2/IGCObject_DUniqueString.cpp index ba3e24e..034b966 100644 --- a/src/stringtable2/IGCObject_DUniqueString.cpp +++ b/src/stringtable2/IGCObject_DUniqueString.cpp @@ -22,9 +22,9 @@ namespace xo { } auto - IGCObject_DUniqueString::shallow_copy(DUniqueString & self, obj mm) noexcept -> Opaque + IGCObject_DUniqueString::shallow_move(DUniqueString & self, obj mm) noexcept -> Opaque { - return self.shallow_copy(mm); + return self.shallow_move(mm); } auto IGCObject_DUniqueString::forward_children(DUniqueString & self, obj gc) noexcept -> size_type