refactor: rename shallow_copy -> shallow_move + streamline
Use RCollector.std_copy_for where appropriate
This commit is contained in:
parent
3f2e58db53
commit
b4a7a85bfb
11 changed files with 18 additions and 24 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue