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 b4a7a85bfb
11 changed files with 18 additions and 24 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;
///@}