summaryrefslogtreecommitdiff
path: root/pit/include
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2026-09-06 17:40:51 -0400
committerLLLL Colonq <llll@colonq>2026-09-06 17:40:51 -0400
commit71bfa9094a4a25f762d681bb07f79f92a95dbb87 (patch)
tree1b7ff31dad86e072a37e4270e762a5e0f12f87ac /pit/include
parent843ea34efc2c5ea10edc4d534304f8287f97fbbc (diff)
pit: Fix evaluator bug
Diffstat (limited to 'pit/include')
-rw-r--r--pit/include/lcq/pit/arena.h6
-rw-r--r--pit/include/lcq/pit/runtime/gc.h1
-rw-r--r--pit/include/lcq/pit/runtime/symtab.h3
3 files changed, 9 insertions, 1 deletions
diff --git a/pit/include/lcq/pit/arena.h b/pit/include/lcq/pit/arena.h
index fcaca55..82f66a5 100644
--- a/pit/include/lcq/pit/arena.h
+++ b/pit/include/lcq/pit/arena.h
@@ -2,6 +2,7 @@
#define LCOLONQ_PIT_ARENA_H
#include <lcq/pit/types.h>
+#include <lcq/pit/utils.h>
typedef i64 pit_arena_index;
@@ -21,6 +22,11 @@ typedef struct {
u8 data[];
} pit_arena;
+static inline i64 pit_arena_byte_idx(pit_arena *a, pit_arena_index idx) {
+ i64 byte_idx = 0; pit_mul(&byte_idx, a->elem_size, idx);
+ return byte_idx;
+}
+
/* create a new arena in a buffer of buf_len size in bytes that stores elements of elem_size */
pit_arena *pit_arena_new(u8 *buf, i64 buf_len, i64 elem_size);
diff --git a/pit/include/lcq/pit/runtime/gc.h b/pit/include/lcq/pit/runtime/gc.h
index 49921f0..713c7d4 100644
--- a/pit/include/lcq/pit/runtime/gc.h
+++ b/pit/include/lcq/pit/runtime/gc.h
@@ -4,5 +4,6 @@
#include <lcq/pit/runtime.h>
void pit_gc(pit_runtime *rt);
+void pit_gc_if_necessary(pit_runtime *rt);
#endif
diff --git a/pit/include/lcq/pit/runtime/symtab.h b/pit/include/lcq/pit/runtime/symtab.h
index e385884..183af8d 100644
--- a/pit/include/lcq/pit/runtime/symtab.h
+++ b/pit/include/lcq/pit/runtime/symtab.h
@@ -20,7 +20,8 @@ void pit_symtab_symbol_mark_macro(pit_runtime *rt, pit_value sym);
void pit_symtab_mset(pit_runtime *rt, pit_value sym, pit_value v);
bool pit_symtab_is_symbol_special_form(pit_runtime *rt, pit_value sym);
void pit_symtab_symbol_mark_special_form(pit_runtime *rt, pit_value sym);
-void pit_symtab_bind(pit_runtime *rt, pit_value sym, pit_value v);
+void pit_symtab_replace(pit_runtime *rt, pit_value sym, pit_value cell);
+void pit_symtab_bind(pit_runtime *rt, pit_value sym, pit_value cell);
pit_value pit_symtab_unbind(pit_runtime *rt, pit_value sym);
#endif