xo-interpreter adds + explict mm arg to ctors (retiring Object::mm)
This commit is contained in:
parent
bfee0bdf9b
commit
f3e7330d92
38 changed files with 664 additions and 103 deletions
|
|
@ -8,4 +8,8 @@ set(SELF_SRCS
|
|||
Integer.cpp)
|
||||
|
||||
xo_add_shared_library4(${SELF_LIB} ${PROJECT_NAME}Targets ${PROJECT_VERSION} 1 ${SELF_SRCS})
|
||||
xo_headeronly_dependency(${SELF_LIB} xo_reflectutil)
|
||||
xo_headeronly_dependency(${SELF_LIB} xo_unit)
|
||||
xo_headeronly_dependency(${SELF_LIB} callback)
|
||||
xo_dependency(${SELF_LIB} xo_alloc)
|
||||
xo_dependency(${SELF_LIB} reflect)
|
||||
|
|
|
|||
|
|
@ -10,12 +10,13 @@
|
|||
namespace xo {
|
||||
using xo::reflect::Reflect;
|
||||
using xo::reflect::TaggedPtr;
|
||||
using xo::gc::IAlloc;
|
||||
|
||||
namespace obj {
|
||||
Integer::Integer(int_type x) : value_{x} {}
|
||||
|
||||
gp<Integer>
|
||||
Integer::make(int_type x) {
|
||||
Integer::make(IAlloc * mm, int_type x) {
|
||||
return new (MMPtr(mm)) Integer(x);
|
||||
}
|
||||
|
||||
|
|
@ -41,7 +42,7 @@ namespace xo {
|
|||
|
||||
Object *
|
||||
Integer::_shallow_copy() const {
|
||||
Cpof cpof(this);
|
||||
Cpof cpof(Object::mm, this);
|
||||
return new (cpof) Integer(*this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ namespace xo {
|
|||
|
||||
assert(!(this->is_nil()));
|
||||
|
||||
Cpof cpof(this);
|
||||
Cpof cpof(Object::mm, this);
|
||||
|
||||
return new (cpof) List(*this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ namespace xo {
|
|||
{
|
||||
// Reminder: String must come before secondary allocation,
|
||||
|
||||
Cpof cpof(this);
|
||||
Cpof cpof(Object::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