refactor: make AGCObject.shallow_copy() non-const

prep for moving to ACollector interface
This commit is contained in:
Roland Conybeare 2026-04-04 14:38:14 -04:00
commit 7e575e6214
6 changed files with 8 additions and 10 deletions

View file

@ -71,7 +71,7 @@ namespace xo {
///@{
std::size_t shallow_size() const noexcept;
DGlobalEnv * shallow_copy(obj<AAllocator> mm) const noexcept;
DGlobalEnv * shallow_copy(obj<AAllocator> mm) noexcept;
std::size_t forward_children(obj<ACollector> gc) noexcept;
///@}

View file

@ -52,10 +52,10 @@ namespace xo {
// const methods
/** memory consumption for this instance **/
static size_type shallow_size(const DGlobalEnv & self) noexcept;
/** copy instance using allocator **/
static Opaque shallow_copy(const DGlobalEnv & self, obj<AAllocator> mm) noexcept;
// non-const methods
/** copy instance using allocator **/
static Opaque shallow_copy(DGlobalEnv & self, obj<AAllocator> mm) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DGlobalEnv & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -52,10 +52,10 @@ namespace xo {
// const methods
/** memory consumption for this instance **/
static size_type shallow_size(const DSchematikaParser & self) noexcept;
/** copy instance using allocator **/
static Opaque shallow_copy(const DSchematikaParser & self, obj<AAllocator> mm) noexcept;
// non-const methods
/** copy instance using allocator **/
static Opaque shallow_copy(DSchematikaParser & self, obj<AAllocator> mm) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DSchematikaParser & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -114,7 +114,7 @@ namespace xo {
}
DGlobalEnv *
DGlobalEnv::shallow_copy(obj<AAllocator> mm) const noexcept
DGlobalEnv::shallow_copy(obj<AAllocator> mm) noexcept
{
return mm.std_copy_for<DGlobalEnv>(this);
}

View file

@ -22,11 +22,10 @@ namespace xo {
}
auto
IGCObject_DGlobalEnv::shallow_copy(const DGlobalEnv & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DGlobalEnv::shallow_copy(DGlobalEnv & self, obj<AAllocator> mm) noexcept -> Opaque
{
return self.shallow_copy(mm);
}
auto
IGCObject_DGlobalEnv::forward_children(DGlobalEnv & self, obj<ACollector> gc) noexcept -> size_type
{

View file

@ -22,11 +22,10 @@ namespace xo {
}
auto
IGCObject_DSchematikaParser::shallow_copy(const DSchematikaParser & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DSchematikaParser::shallow_copy(DSchematikaParser & self, obj<AAllocator> mm) noexcept -> Opaque
{
return self.shallow_copy(mm);
}
auto
IGCObject_DSchematikaParser::forward_children(DSchematikaParser & self, obj<ACollector> gc) noexcept -> size_type
{