refactor: make AGCObject.shallow_copy() non-const
prep for moving to ACollector interface
This commit is contained in:
parent
53223b38ff
commit
d2aa0d0c55
30 changed files with 49 additions and 50 deletions
|
|
@ -73,7 +73,7 @@ namespace xo {
|
|||
///@{
|
||||
|
||||
std::size_t shallow_size() const noexcept;
|
||||
DDefineExpr * shallow_copy(obj<AAllocator> mm) const noexcept;
|
||||
DDefineExpr * shallow_copy(obj<AAllocator> mm) noexcept;
|
||||
std::size_t forward_children(obj<ACollector> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ namespace xo {
|
|||
///@{
|
||||
|
||||
std::size_t shallow_size() const noexcept;
|
||||
DLocalSymtab * shallow_copy(obj<AAllocator> mm) const noexcept;
|
||||
DLocalSymtab * shallow_copy(obj<AAllocator> mm) noexcept;
|
||||
std::size_t forward_children(obj<ACollector> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ namespace xo {
|
|||
///@{
|
||||
|
||||
size_t shallow_size() const noexcept;
|
||||
DTypename * shallow_copy(obj<AAllocator> mm) const noexcept;
|
||||
DTypename * shallow_copy(obj<AAllocator> mm) noexcept;
|
||||
size_t forward_children(obj<ACollector> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -52,10 +52,10 @@ namespace xo {
|
|||
// const methods
|
||||
/** memory consumption for this instance **/
|
||||
static size_type shallow_size(const DDefineExpr & self) noexcept;
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(const DDefineExpr & self, obj<AAllocator> mm) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(DDefineExpr & self, obj<AAllocator> mm) noexcept;
|
||||
/** during GC: forward immdiate children **/
|
||||
static size_type forward_children(DDefineExpr & self, obj<ACollector> gc) noexcept;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ public:
|
|||
/** @defgroup scm-expression-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** An uninitialized AExpression instance will have zero vtable pointer (per {linux,osx} abi).
|
||||
* Use case for this is narrow. We go to some lengths to avoid null vtable pointers. For example
|
||||
* obj<AFacet> will have non-null vtable (via IFacet_Any) with all methods terminating.
|
||||
**/
|
||||
bool _has_null_vptr() const noexcept { return *reinterpret_cast<const void * const *>(this) == nullptr; }
|
||||
/** RTTI: unique id# for actual runtime data representation **/
|
||||
virtual typeseq _typeseq() const noexcept = 0;
|
||||
/** destroy instance @p d; calls c++ dtor only for actual runtime type; does not recover memory **/
|
||||
|
|
|
|||
|
|
@ -52,10 +52,10 @@ namespace xo {
|
|||
// const methods
|
||||
/** memory consumption for this instance **/
|
||||
static size_type shallow_size(const DApplyExpr & self) noexcept;
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(const DApplyExpr & self, obj<AAllocator> mm) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(DApplyExpr & self, obj<AAllocator> mm) noexcept;
|
||||
/** during GC: forward immdiate children **/
|
||||
static size_type forward_children(DApplyExpr & self, obj<ACollector> gc) noexcept;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -52,10 +52,10 @@ namespace xo {
|
|||
// const methods
|
||||
/** memory consumption for this instance **/
|
||||
static size_type shallow_size(const DConstant & self) noexcept;
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(const DConstant & self, obj<AAllocator> mm) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(DConstant & self, obj<AAllocator> mm) noexcept;
|
||||
/** during GC: forward immdiate children **/
|
||||
static size_type forward_children(DConstant & self, obj<ACollector> gc) noexcept;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -52,10 +52,10 @@ namespace xo {
|
|||
// const methods
|
||||
/** memory consumption for this instance **/
|
||||
static size_type shallow_size(const DIfElseExpr & self) noexcept;
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(const DIfElseExpr & self, obj<AAllocator> mm) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(DIfElseExpr & self, obj<AAllocator> mm) noexcept;
|
||||
/** during GC: forward immdiate children **/
|
||||
static size_type forward_children(DIfElseExpr & self, obj<ACollector> gc) noexcept;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -52,10 +52,10 @@ namespace xo {
|
|||
// const methods
|
||||
/** memory consumption for this instance **/
|
||||
static size_type shallow_size(const DLambdaExpr & self) noexcept;
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(const DLambdaExpr & self, obj<AAllocator> mm) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(DLambdaExpr & self, obj<AAllocator> mm) noexcept;
|
||||
/** during GC: forward immdiate children **/
|
||||
static size_type forward_children(DLambdaExpr & self, obj<ACollector> gc) noexcept;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -52,10 +52,10 @@ namespace xo {
|
|||
// const methods
|
||||
/** memory consumption for this instance **/
|
||||
static size_type shallow_size(const DSequenceExpr & self) noexcept;
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(const DSequenceExpr & self, obj<AAllocator> mm) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(DSequenceExpr & self, obj<AAllocator> mm) noexcept;
|
||||
/** during GC: forward immdiate children **/
|
||||
static size_type forward_children(DSequenceExpr & self, obj<ACollector> gc) noexcept;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -52,10 +52,10 @@ namespace xo {
|
|||
// const methods
|
||||
/** memory consumption for this instance **/
|
||||
static size_type shallow_size(const DVarRef & self) noexcept;
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(const DVarRef & self, obj<AAllocator> mm) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(DVarRef & self, obj<AAllocator> mm) noexcept;
|
||||
/** during GC: forward immdiate children **/
|
||||
static size_type forward_children(DVarRef & self, obj<ACollector> gc) noexcept;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,11 @@ public:
|
|||
/** @defgroup scm-symboltable-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** An uninitialized ASymbolTable instance will have zero vtable pointer (per {linux,osx} abi).
|
||||
* Use case for this is narrow. We go to some lengths to avoid null vtable pointers. For example
|
||||
* obj<AFacet> will have non-null vtable (via IFacet_Any) with all methods terminating.
|
||||
**/
|
||||
bool _has_null_vptr() const noexcept { return *reinterpret_cast<const void * const *>(this) == nullptr; }
|
||||
/** RTTI: unique id# for actual runtime data representation **/
|
||||
virtual typeseq _typeseq() const noexcept = 0;
|
||||
/** destroy instance @p d; calls c++ dtor only for actual runtime type; does not recover memory **/
|
||||
|
|
|
|||
|
|
@ -52,10 +52,10 @@ namespace xo {
|
|||
// const methods
|
||||
/** memory consumption for this instance **/
|
||||
static size_type shallow_size(const DGlobalSymtab & self) noexcept;
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(const DGlobalSymtab & self, obj<AAllocator> mm) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(DGlobalSymtab & self, obj<AAllocator> mm) noexcept;
|
||||
/** during GC: forward immdiate children **/
|
||||
static size_type forward_children(DGlobalSymtab & self, obj<ACollector> gc) noexcept;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -52,10 +52,10 @@ namespace xo {
|
|||
// const methods
|
||||
/** memory consumption for this instance **/
|
||||
static size_type shallow_size(const DLocalSymtab & self) noexcept;
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(const DLocalSymtab & self, obj<AAllocator> mm) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(DLocalSymtab & self, obj<AAllocator> mm) noexcept;
|
||||
/** during GC: forward immdiate children **/
|
||||
static size_type forward_children(DLocalSymtab & self, obj<ACollector> gc) noexcept;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -50,10 +50,10 @@ namespace xo {
|
|||
// const methods
|
||||
/** memory consumption for this instance **/
|
||||
static size_type shallow_size(const DTypename & self) noexcept;
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(const DTypename & self, obj<AAllocator> mm) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(DTypename & self, obj<AAllocator> mm) noexcept;
|
||||
/** during GC: forward immdiate children **/
|
||||
static size_type forward_children(DTypename & self, obj<ACollector> gc) noexcept;
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -52,10 +52,10 @@ namespace xo {
|
|||
// const methods
|
||||
/** memory consumption for this instance **/
|
||||
static size_type shallow_size(const DVariable & self) noexcept;
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(const DVariable & self, obj<AAllocator> mm) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(DVariable & self, obj<AAllocator> mm) noexcept;
|
||||
/** during GC: forward immdiate children **/
|
||||
static size_type forward_children(DVariable & self, obj<ACollector> gc) noexcept;
|
||||
///@}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue