diff --git a/BACKLOG.md b/BACKLOG.md index ba5195ad..c594c6e7 100644 --- a/BACKLOG.md +++ b/BACKLOG.md @@ -1,20 +1,20 @@ # reader2 -## globalsymtab for essential primitives - -rework essential primitives (*,/,+,-,==,!=,..) -so parser doesn't rely on magic globalsymtab lookup strings. - -## support missing primitives - -tokenizer support + utest for !=,<,>,<=,>= - ## boolean operators ^ (xor), | (or), & (and), ~ (not) # gc +## add_virtual_root + +Explicit alternative to `add_gc_root_poly()` for virtual roots. +Since gc doesn't touch data pointer for virtual roots, we can pass +`obj` instead of `obj*`. + +Will evolve some awkwardness in VSM: having to construct a purposeless +`obj` just to appease the `add_gc_root_poly` signature. + ## remove_root Remove root doesn't work. diff --git a/xo-interpreter2/src/interpreter2/DVirtualSchematikaMachine.cpp b/xo-interpreter2/src/interpreter2/DVirtualSchematikaMachine.cpp index 788a16a4..52cdbf78 100644 --- a/xo-interpreter2/src/interpreter2/DVirtualSchematikaMachine.cpp +++ b/xo-interpreter2/src/interpreter2/DVirtualSchematikaMachine.cpp @@ -47,6 +47,7 @@ namespace xo { using xo::mm::AGCObject; using xo::mm::MemorySizeInfo; using xo::mm::AAllocator; + using xo::mm::ACollector; using xo::mm::DX1Collector; using xo::mm::DArena; using xo::facet::FacetRegistry; @@ -71,8 +72,9 @@ namespace xo { // (though DX1Collector allocations will be from explictly mmap'd memory) // DVirtualSchematikaMachine::DVirtualSchematikaMachine(const VsmConfig & config, - obj aux_mm) + obj aux_mm) : config_{config}, + self_vroot_{obj(this)}, aux_mm_{aux_mm}, mm_(abox::make(aux_mm_, config.x1_config_)), rcx_(abox::make(aux_mm_, this)), @@ -88,7 +90,13 @@ namespace xo { this->global_env_ = obj(reader_.global_env()); - //this->_add_gc_roots(); + // TODO: + // annoying to have to create self_vroot_ to appease + // add_gc_root_poly() signature. + // In practice gc won't modify the pointer + // (instead traverses it to find +update children) + // + mm_.to_op().to_facet().add_gc_root_poly(&self_vroot_); } DVirtualSchematikaMachine *