xo-interpreter2 stack: + more primitive function-type decoration

This commit is contained in:
Roland Conybeare 2026-03-16 12:34:59 -05:00
commit ea31dbf0d3
3 changed files with 14 additions and 5 deletions

View file

@ -18,7 +18,8 @@ namespace xo {
public:
/** create primitive: report memory use to console **/
static DPrimitive_gco_0 * make_report_memory_use_pm(obj<AAllocator> mm);
static DPrimitive_gco_0 * make_report_memory_use_pm(obj<AAllocator> mm,
StringTable * stbl);
};
} /*namespace scm*/

View file

@ -6,6 +6,8 @@
#include "VsmPrimitives.hpp"
#include <xo/numeric/NumericDispatch.hpp>
#include <xo/object2/Boolean.hpp>
#include <xo/type/AtomicType.hpp>
#include <xo/type/FunctionType.hpp>
namespace xo {
//using xo::scm::NumericDispatch;
@ -38,10 +40,18 @@ namespace xo {
}
DPrimitive_gco_0 *
VsmPrimitives::make_report_memory_use_pm(obj<AAllocator> mm)
VsmPrimitives::make_report_memory_use_pm(obj<AAllocator> mm,
StringTable * stbl)
{
(void)stbl;
auto bool_ty = DAtomicType::make(mm, Metatype::t_bool());
// report_memory_use: () -> bool
auto pm_ty = obj<AType,DFunctionType>(DFunctionType::_make(mm, bool_ty));
return DPrimitive_gco_0::_make(mm,
"report_memory_use",
pm_ty,
&xfer_report_memory_use);
}

View file

@ -56,13 +56,11 @@ namespace xo {
InstallSink sink,
InstallFlags flags)
{
(void)stbl;
scope log(XO_DEBUG(true));
bool ok = true;
ok = ok & install_aux(sink, VsmPrimitives::make_report_memory_use_pm(mm), flags);
ok = ok & install_aux(sink, VsmPrimitives::make_report_memory_use_pm(mm, stbl), flags);
return ok;
}