Implemented garbage collection

As a whole, this is still tentative.
This commit is contained in:
2026-05-08 16:28:12 +10:00
parent be84a8dfe2
commit 6c055a0435
15 changed files with 267 additions and 80 deletions
+4 -1
View File
@@ -1097,7 +1097,10 @@ void Toy_resetVM(Toy_VM* vm, bool preserveScope, bool preserveStack) {
Toy_resetStack(&vm->stack); //NOTE: has a realloc()
}
//NOTE: buckets are not altered during resets
//not sure how often to call teh GC
if (vm->memoryBucket) {
Toy_collectBucketGarbage(&vm->memoryBucket);
}
}
void Toy_initVM(Toy_VM* vm) {