xo-interpreter/xo-alloc: GlobalEnv + mm -> shallow_copy()
This commit is contained in:
parent
56a1c3bc75
commit
4d2cd54365
18 changed files with 52 additions and 37 deletions
|
|
@ -56,7 +56,7 @@ namespace xo {
|
|||
|
||||
// LCOV_EXCL_START
|
||||
Object *
|
||||
Boolean::_shallow_copy() const
|
||||
Boolean::_shallow_copy(gc::IAlloc *) const
|
||||
{
|
||||
|
||||
/* Boolean instances not created in GC-owned space,
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ namespace xo {
|
|||
}
|
||||
|
||||
Object *
|
||||
Float::_shallow_copy() const {
|
||||
Cpof cpof(Object::mm, this);
|
||||
Float::_shallow_copy(gc::IAlloc * mm) const {
|
||||
Cpof cpof(mm, this);
|
||||
return new (cpof) Float(*this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ namespace xo {
|
|||
}
|
||||
|
||||
Object *
|
||||
Integer::_shallow_copy() const {
|
||||
Cpof cpof(Object::mm, this);
|
||||
Integer::_shallow_copy(gc::IAlloc * mm) const {
|
||||
Cpof cpof(mm, this);
|
||||
return new (cpof) Integer(*this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,12 +97,12 @@ namespace xo {
|
|||
}
|
||||
|
||||
Object *
|
||||
List::_shallow_copy() const {
|
||||
scope log(XO_DEBUG(Object::mm->debug_flag()));
|
||||
List::_shallow_copy(gc::IAlloc * mm) const {
|
||||
scope log(XO_DEBUG(mm->debug_flag()));
|
||||
|
||||
assert(!(this->is_nil()));
|
||||
|
||||
Cpof cpof(Object::mm, this);
|
||||
Cpof cpof(mm, this);
|
||||
|
||||
return new (cpof) List(*this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,11 +126,11 @@ namespace xo {
|
|||
}
|
||||
|
||||
Object *
|
||||
String::_shallow_copy() const
|
||||
String::_shallow_copy(gc::IAlloc * mm) const
|
||||
{
|
||||
// Reminder: String must come before secondary allocation,
|
||||
|
||||
Cpof cpof(Object::mm, this);
|
||||
Cpof cpof(mm, this);
|
||||
|
||||
// might expect to write:
|
||||
// gp<String> copy = new (gcm) String(Object::mm, owner_, z_chars_, chars_);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue