From 6d176e58f37b3054137fdc1725ecebf4cd87e17b Mon Sep 17 00:00:00 2001 From: CHatingPython Date: Sat, 15 Aug 2026 12:00:18 +0200 Subject: [PATCH] refactor(furvm): remove thing allocator Refs: #62 --- furdb/src/main.cpp | 2 +- furvm/include/furvm/context.hpp | 17 +--- furvm/include/furvm/fwd.hpp | 7 +- furvm/include/furvm/thing.hpp | 1 - furvm/include/furvm/thing_allocator.hpp | 113 ------------------------ furvm/src/executor.cpp | 34 +++---- furvm/test/test.cpp | 8 +- 7 files changed, 21 insertions(+), 161 deletions(-) delete mode 100644 furvm/include/furvm/thing_allocator.hpp diff --git a/furdb/src/main.cpp b/furdb/src/main.cpp index b2218a9..54c9c83 100644 --- a/furdb/src/main.cpp +++ b/furdb/src/main.cpp @@ -10,7 +10,7 @@ #include // taken from furvm uwu :3 ^^ nya~ ngh~ -static void print_thing(const furvm::thing& thing) { +static void print_thing(const furvm::thing<>& thing) { using namespace furvm; switch (thing.true_type().type) { diff --git a/furvm/include/furvm/context.hpp b/furvm/include/furvm/context.hpp index 8fd5411..51a082e 100644 --- a/furvm/include/furvm/context.hpp +++ b/furvm/include/furvm/context.hpp @@ -7,9 +7,7 @@ #include "furvm/handle.hpp" #include "furvm/module.hpp" // IWYU pragma: keep #include "furvm/thing.hpp" // IWYU pragma: keep -#include "furvm/thing_allocator.hpp" -#include #include #include @@ -22,8 +20,7 @@ public: /** * @brief Constructs a context. */ - context() - : m_thingAllocator(m_thingArena) {} + context() {} ~context() = default; @@ -70,21 +67,13 @@ public: const std::vector& executors() const { return m_executors; } public: - /** - * @brief Returns context's thing allocator. - * - * @return The thing allocator. - */ - thing_allocator thing_alloc() const { return m_thingAllocator; } - thing_type_store& tt_store() { return m_thingTypeStore; } private: handle_container m_modules; std::vector m_executors; - furlang::arena m_thingArena; - thing_allocator m_thingAllocator; - class thing_type_store m_thingTypeStore; + furlang::arena m_thingArena; + class thing_type_store m_thingTypeStore; }; } // namespace furvm diff --git a/furvm/include/furvm/fwd.hpp b/furvm/include/furvm/fwd.hpp index a6b27a1..7f1227d 100644 --- a/furvm/include/furvm/fwd.hpp +++ b/furvm/include/furvm/fwd.hpp @@ -140,11 +140,6 @@ using mod_id = std::string; */ using mod_h = handle>; -// thing_allocator.hpp - -template -class thing_allocator; - // thing.hpp /** @@ -161,7 +156,7 @@ using thing_type_id = std::uint32_t; * * A stack element. Think of it like of a value in C++ or I guess a class in java. */ -template