diff --git a/src/interpreter2/VirtualSchematikaMachine.cpp b/src/interpreter2/VirtualSchematikaMachine.cpp index bc3cc913..714b2804 100644 --- a/src/interpreter2/VirtualSchematikaMachine.cpp +++ b/src/interpreter2/VirtualSchematikaMachine.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -30,6 +31,7 @@ #include // for getcwd() namespace xo { + using xo::scm::DDictionary; using xo::print::APrintable; using xo::print::ppconfig; using xo::print::ppstate_standalone; @@ -40,6 +42,7 @@ namespace xo { using xo::mm::DX1Collector; using xo::mm::DArena; using xo::facet::FacetRegistry; + using xo::facet::TypeRegistry; using std::cout; namespace scm { @@ -878,6 +881,8 @@ namespace xo { xtag("resv", info.reserved_)); }; + FacetRegistry::instance().visit_pools(visitor); + TypeRegistry::instance().visit_pools(visitor); rcx.visit_pools(visitor); return DBoolean::box(rcx.allocator(), true); @@ -900,11 +905,24 @@ namespace xo { static DPrimitive_gco_0 s_cwd_pm("_cwd", &xfer_cwd); + // ----- primitive: dict_make() ----- + + obj + xfer_dict_make(obj rcx) + { + return obj(DDictionary::empty(rcx.allocator(), + 8 /*cap*/)); + } + + static DPrimitive_gco_0 s_dict_make_pm("_dict_make", + &xfer_dict_make); + // ----- install primitives ----- void VirtualSchematikaMachine::install_core_primitives() { + /* report_memory_use */ { const DUniqueString * name = reader_.intern_string("report_memory_use"); @@ -916,6 +934,7 @@ namespace xo { obj(&s_report_memory_use_pm)); } + /* cwd */ { const DUniqueString * name = reader_.intern_string("cwd"); @@ -926,6 +945,18 @@ namespace xo { Reflect::require(), obj(&s_cwd_pm)); } + + /* dict_make */ + { + const DUniqueString * name + = reader_.intern_string("dict_make"); + + global_env_->_upsert_value + (mm_.to_op(), + name, + Reflect::require(), + obj(&s_dict_make_pm)); + } } } /*namespace scm*/