From 17df4b1ff7f4cbcf3b3218fea68f65d3cb60c984 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Fri, 25 Sep 2026 17:36:15 -0400 Subject: pit: Add fuel economy --- pit/src/runtime.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pit/src/runtime.c') diff --git a/pit/src/runtime.c b/pit/src/runtime.c index d4a0a62..ab65d71 100644 --- a/pit/src/runtime.c +++ b/pit/src/runtime.c @@ -45,6 +45,7 @@ pit_runtime *pit_runtime_new(u8 *buf, i64 len) { ret->traversal = pit_vec_new(pit_traversal_entry)(pit_arena_alloc_back(a, stack_size), stack_size); ret->callstack = pit_vec_new(pit_callstack_entry)(pit_arena_alloc_back(a, stack_size), stack_size); ret->saved_bindings = pit_vec_new(pit_value)(pit_arena_alloc_back(a, stack_size), stack_size); + ret->fuel = -1; ret->frozen_values = 0; ret->frozen_symtab = 0; ret->error = PIT_NIL; @@ -60,6 +61,10 @@ pit_runtime *pit_runtime_new(u8 *buf, i64 len) { return ret; } +void pit_runtime_set_fuel(pit_runtime *rt, i64 fuel) { + rt->fuel = fuel; +} + void pit_runtime_freeze(pit_runtime *rt) { rt->frozen_values = rt->heap->next; rt->frozen_symtab = rt->symtab->next; -- cgit v1.3.1