From 5a1b7c5aa661791ccfddd196fd576a52b8712007 Mon Sep 17 00:00:00 2001 From: CHatingPython Date: Fri, 19 Jun 2026 14:15:05 +0200 Subject: [PATCH] refactor(furvm): expose context thing allocator Refs: #12 --- furvm/include/furvm/context.hpp | 2 ++ furvm/src/executor.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/furvm/include/furvm/context.hpp b/furvm/include/furvm/context.hpp index e1203dd..35d41e5 100644 --- a/furvm/include/furvm/context.hpp +++ b/furvm/include/furvm/context.hpp @@ -92,6 +92,8 @@ public: auto erase_thing(Args&&... args) { return m_things.erase(std::forward(args)...); } + + thing_allocator thing_alloc() const { return m_thingAllocator; } public: /** * @brief Removes unreferenced things from the thing list. diff --git a/furvm/src/executor.cpp b/furvm/src/executor.cpp index c784346..5468cf9 100644 --- a/furvm/src/executor.cpp +++ b/furvm/src/executor.cpp @@ -78,7 +78,7 @@ void executor::step() { switch (instr) { case instruction_t::NoOperation: break; case instruction_t::PushB2I: { - push_thing({ thing_t::Int32, m_context->m_thingAllocator })->int32() = frame.mod->byte(frame.position++); + push_thing({ thing_t::Int32, m_context->thing_alloc() })->int32() = frame.mod->byte(frame.position++); } break; case instruction_t::Drop: { pop_thing();