diff options
| author | LLLL Colonq <llll@colonq> | 2026-09-25 17:36:15 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-09-25 17:36:15 -0400 |
| commit | 17df4b1ff7f4cbcf3b3218fea68f65d3cb60c984 (patch) | |
| tree | 5e0b2b81a3ac9c7e506303e8570c16c742072d5d /pit/src/runtime.c | |
| parent | c1a6dfb43efca52cacae738ce3d9648c4981906e (diff) | |
pit: Add fuel economy
Diffstat (limited to 'pit/src/runtime.c')
| -rw-r--r-- | pit/src/runtime.c | 5 |
1 files changed, 5 insertions, 0 deletions
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; |
