refactor: rename shallow_copy -> shallow_move + streamline

Use RCollector.std_copy_for where appropriate
This commit is contained in:
Roland Conybeare 2026-04-04 16:33:35 -04:00
commit 8bb460f402
165 changed files with 279 additions and 352 deletions

View file

@ -134,7 +134,7 @@ namespace xo {
/** @defgroup scm-primitive-gcobject-facet **/
///@{
std::size_t shallow_size() const noexcept;
Primitive * shallow_move(obj<AAllocator> mm) const noexcept;
Primitive * shallow_move(obj<ACollector> gc) noexcept;
std::size_t forward_children(obj<ACollector> gc) noexcept;
///@}
@ -198,14 +198,8 @@ namespace xo {
template <typename Fn>
Primitive<Fn> *
Primitive<Fn>::shallow_move(obj<AAllocator> mm) const noexcept {
void * mem = mm.alloc_copy((std::byte *)this);
if (mem) {
return new (mem) Primitive(*this);
}
return nullptr;
Primitive<Fn>::shallow_move(obj<ACollector> gc) noexcept {
return gc.std_copy_for(this);
}
template <typename Fn>

View file

@ -55,7 +55,7 @@ namespace xo {
// non-const methods
/** move instance using allocator **/
static Opaque shallow_move(DPrimitive_gco_0 & self, obj<AAllocator> mm) noexcept;
static Opaque shallow_move(DPrimitive_gco_0 & self, obj<ACollector> gc) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DPrimitive_gco_0 & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -55,7 +55,7 @@ namespace xo {
// non-const methods
/** move instance using allocator **/
static Opaque shallow_move(DPrimitive_gco_1_gco & self, obj<AAllocator> mm) noexcept;
static Opaque shallow_move(DPrimitive_gco_1_gco & self, obj<ACollector> gc) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DPrimitive_gco_1_gco & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -55,7 +55,7 @@ namespace xo {
// non-const methods
/** move instance using allocator **/
static Opaque shallow_move(DPrimitive_gco_2_dict_string & self, obj<AAllocator> mm) noexcept;
static Opaque shallow_move(DPrimitive_gco_2_dict_string & self, obj<ACollector> gc) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DPrimitive_gco_2_dict_string & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -55,7 +55,7 @@ namespace xo {
// non-const methods
/** move instance using allocator **/
static Opaque shallow_move(DPrimitive_gco_2_gco_gco & self, obj<AAllocator> mm) noexcept;
static Opaque shallow_move(DPrimitive_gco_2_gco_gco & self, obj<ACollector> gc) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DPrimitive_gco_2_gco_gco & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -55,7 +55,7 @@ namespace xo {
// non-const methods
/** move instance using allocator **/
static Opaque shallow_move(DPrimitive_gco_3_dict_string_gco & self, obj<AAllocator> mm) noexcept;
static Opaque shallow_move(DPrimitive_gco_3_dict_string_gco & self, obj<ACollector> gc) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DPrimitive_gco_3_dict_string_gco & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -22,9 +22,9 @@ namespace xo {
}
auto
IGCObject_DPrimitive_gco_0::shallow_move(DPrimitive_gco_0 & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DPrimitive_gco_0::shallow_move(DPrimitive_gco_0 & self, obj<ACollector> gc) noexcept -> Opaque
{
return self.shallow_move(mm);
return self.shallow_move(gc);
}
auto
IGCObject_DPrimitive_gco_0::forward_children(DPrimitive_gco_0 & self, obj<ACollector> gc) noexcept -> size_type

View file

@ -22,9 +22,9 @@ namespace xo {
}
auto
IGCObject_DPrimitive_gco_1_gco::shallow_move(DPrimitive_gco_1_gco & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DPrimitive_gco_1_gco::shallow_move(DPrimitive_gco_1_gco & self, obj<ACollector> gc) noexcept -> Opaque
{
return self.shallow_move(mm);
return self.shallow_move(gc);
}
auto
IGCObject_DPrimitive_gco_1_gco::forward_children(DPrimitive_gco_1_gco & self, obj<ACollector> gc) noexcept -> size_type

View file

@ -22,9 +22,9 @@ namespace xo {
}
auto
IGCObject_DPrimitive_gco_2_dict_string::shallow_move(DPrimitive_gco_2_dict_string & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DPrimitive_gco_2_dict_string::shallow_move(DPrimitive_gco_2_dict_string & self, obj<ACollector> gc) noexcept -> Opaque
{
return self.shallow_move(mm);
return self.shallow_move(gc);
}
auto
IGCObject_DPrimitive_gco_2_dict_string::forward_children(DPrimitive_gco_2_dict_string & self, obj<ACollector> gc) noexcept -> size_type

View file

@ -22,9 +22,9 @@ namespace xo {
}
auto
IGCObject_DPrimitive_gco_2_gco_gco::shallow_move(DPrimitive_gco_2_gco_gco & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DPrimitive_gco_2_gco_gco::shallow_move(DPrimitive_gco_2_gco_gco & self, obj<ACollector> gc) noexcept -> Opaque
{
return self.shallow_move(mm);
return self.shallow_move(gc);
}
auto
IGCObject_DPrimitive_gco_2_gco_gco::forward_children(DPrimitive_gco_2_gco_gco & self, obj<ACollector> gc) noexcept -> size_type

View file

@ -22,9 +22,9 @@ namespace xo {
}
auto
IGCObject_DPrimitive_gco_3_dict_string_gco::shallow_move(DPrimitive_gco_3_dict_string_gco & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DPrimitive_gco_3_dict_string_gco::shallow_move(DPrimitive_gco_3_dict_string_gco & self, obj<ACollector> gc) noexcept -> Opaque
{
return self.shallow_move(mm);
return self.shallow_move(gc);
}
auto
IGCObject_DPrimitive_gco_3_dict_string_gco::forward_children(DPrimitive_gco_3_dict_string_gco & self, obj<ACollector> gc) noexcept -> size_type