refactor: retire GCObject.shallow_size()
Not needed. Rely on size stored in gc-owned object header
This commit is contained in:
parent
fefb15fbad
commit
8f360b74e2
5 changed files with 9 additions and 18 deletions
|
|
@ -45,15 +45,15 @@
|
|||
],
|
||||
const_methods: [
|
||||
// size_type shallow_size() const noexcept
|
||||
{
|
||||
name: "shallow_size",
|
||||
doc: ["memory consumption for this instance"],
|
||||
return_type: "size_type",
|
||||
args: [],
|
||||
const: true,
|
||||
noexcept: true,
|
||||
attributes: [],
|
||||
},
|
||||
// {
|
||||
// name: "shallow_size",
|
||||
// doc: ["memory consumption for this instance"],
|
||||
// return_type: "size_type",
|
||||
// args: [],
|
||||
// const: true,
|
||||
// noexcept: true,
|
||||
// attributes: [],
|
||||
// },
|
||||
],
|
||||
nonconst_methods: [
|
||||
// Opaque shallow_move(obj<AAllocator>>) noexcept
|
||||
|
|
|
|||
|
|
@ -62,8 +62,6 @@ public:
|
|||
virtual typeseq _typeseq() const noexcept = 0;
|
||||
/** destroy instance @p d; calls c++ dtor only for actual runtime type; does not recover memory **/
|
||||
virtual void _drop(Opaque d) const noexcept = 0;
|
||||
/** memory consumption for this instance **/
|
||||
virtual size_type shallow_size(Copaque data) const noexcept = 0;
|
||||
|
||||
// nonconst methods
|
||||
/** move instance using allocator **/
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ namespace mm {
|
|||
[[noreturn]] void _drop(Opaque) const noexcept override { _fatal(); }
|
||||
|
||||
// const methods
|
||||
[[noreturn]] size_type shallow_size(Copaque) const noexcept override { _fatal(); }
|
||||
|
||||
// nonconst methods
|
||||
[[noreturn]] Opaque shallow_move(Opaque, obj<ACollector>) const noexcept override;
|
||||
|
|
|
|||
|
|
@ -49,9 +49,6 @@ namespace mm {
|
|||
void _drop(Opaque d) const noexcept override { _dcast(d).~DRepr(); }
|
||||
|
||||
// const methods
|
||||
size_type shallow_size(Copaque data) const noexcept override {
|
||||
return I::shallow_size(_dcast(data));
|
||||
}
|
||||
|
||||
// non-const methods
|
||||
Opaque shallow_move(Opaque data, obj<ACollector> gc) const noexcept override {
|
||||
|
|
|
|||
|
|
@ -55,9 +55,6 @@ public:
|
|||
void _drop() const noexcept { O::iface()->_drop(O::data()); }
|
||||
|
||||
// const methods
|
||||
size_type shallow_size() const noexcept {
|
||||
return O::iface()->shallow_size(O::data());
|
||||
}
|
||||
|
||||
// non-const methods (still const in router!)
|
||||
Opaque shallow_move(obj<ACollector> gc) noexcept {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue