fix: fix this mess

I am stupid
I am stupid
I am stupid
I can't believe how f- ricking stupid I am
This commit is contained in:
2026-07-19 22:04:50 +02:00
parent 6dce7016ce
commit 549af109b9
5 changed files with 7 additions and 8 deletions
+1 -3
View File
@@ -9,15 +9,13 @@ main:
store %0 store %0
lenof lenof
push $s32 1
sub
store %1 store %1
push $s32 0 push $s32 0
loop: loop:
dup dup
load %1 load %1
eq ge
jnz #end jnz #end
body: body:
dup dup
+2 -2
View File
@@ -7,14 +7,14 @@ main:
array $arr array $arr
store %0 store %0
push $s32 1 push $s32 2
store %1 store %1
push $s32 0 push $s32 0
loop: loop:
dup dup
load %1 load %1
eq ge
jnz #end jnz #end
body: body:
dup dup
+1 -1
View File
@@ -111,7 +111,7 @@ using function_id = std::uint16_t;
/** /**
* @brief A handle to a furvm function. * @brief A handle to a furvm function.
*/ */
using function_h = handle<function, generic_header<function_id>>; using function_h = handle<function, refcount_header<function_id>>;
// module.hpp // module.hpp
+2 -1
View File
@@ -69,8 +69,9 @@ public:
[[nodiscard]] T* allocate(std::size_t count = 1) { [[nodiscard]] T* allocate(std::size_t count = 1) {
for (auto it = m_deadThings->begin(); it != m_deadThings->end(); ++it) { for (auto it = m_deadThings->begin(); it != m_deadThings->end(); ++it) {
if (it->second != count) continue; if (it->second != count) continue;
T* data = it->first;
m_deadThings->erase(it); m_deadThings->erase(it);
return it->first; return data;
} }
return m_arena->allocate<T>(count); return m_arena->allocate<T>(count);
} }
+1 -1
View File
@@ -101,7 +101,7 @@ thing_h executor::pop_thing() {
if (m_frames.top().stackBase >= m_stack.size()) throw stack_underflow(); if (m_frames.top().stackBase >= m_stack.size()) throw stack_underflow();
thing_h top = std::move(m_stack.top()); thing_h top = std::move(m_stack.top());
m_stack.pop(); m_stack.pop();
return top; return std::move(top);
} }
thing_h executor::thing() const { thing_h executor::thing() const {