xo-interpreter: + toplevel env in VSM
This commit is contained in:
parent
40128c423c
commit
eec5bc0981
2 changed files with 32 additions and 2 deletions
|
|
@ -132,11 +132,15 @@ namespace xo {
|
|||
up<GC>
|
||||
GC::make(const Config & config)
|
||||
{
|
||||
//GC * gc = new GC(config);
|
||||
|
||||
return std::make_unique<GC>(config);
|
||||
}
|
||||
|
||||
GC *
|
||||
GC::from(IAlloc * mm)
|
||||
{
|
||||
return dynamic_cast<GC *>(mm);
|
||||
}
|
||||
|
||||
const std::string &
|
||||
GC::name() const
|
||||
{
|
||||
|
|
@ -390,6 +394,19 @@ namespace xo {
|
|||
gc_root_v_.push_back(addr);
|
||||
}
|
||||
|
||||
void
|
||||
GC::remove_gc_root(Object ** addr)
|
||||
{
|
||||
/* Multithreaded GC not supported */
|
||||
|
||||
assert(!this->gc_in_progress());
|
||||
|
||||
auto new_end_ix = std::remove(gc_root_v_.begin(), gc_root_v_.end(), addr);
|
||||
|
||||
/* erase now-unused slots */
|
||||
gc_root_v_.erase(new_end_ix, gc_root_v_.end());
|
||||
}
|
||||
|
||||
auto
|
||||
GC::add_gc_copy_callback(up<GcCopyCallback> fn) -> CallbackId
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue