From c01f847b68a7fcd48eb0f3d456aa993a6f69ea8d Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Wed, 2 Sep 2026 21:13:24 -0400 Subject: pit: Debug x86.pit --- pit/src/runtime/eval.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pit/src/runtime/eval.c') diff --git a/pit/src/runtime/eval.c b/pit/src/runtime/eval.c index b0b53b6..a2b9e79 100644 --- a/pit/src/runtime/eval.c +++ b/pit/src/runtime/eval.c @@ -180,8 +180,11 @@ bool pit_vm_run_one(pit_runtime *rt) { pit_value pit_vm_eval(pit_runtime *rt, pit_value v) { i64 start = rt->callstack->next; vm_push_code(rt, v); + i64 gc = 0; while (pit_vm_run_one(rt) && rt->callstack->next > start) { - if (rt->expr_stack->next == 0 && rt->compilation_stack->next == 0) { + gc += 1; + if (gc > 100 && rt->expr_stack->next == 0 && rt->compilation_stack->next == 0) { + gc = 0; pit_gc(rt); /* TODO hack to avoid running GC during macroexpansion */ } } -- cgit v1.3.1