fix: refactor GC gray set to use count/capacity and handle empty set edge cases

- Rename grayDepth to grayCount and maxGray to grayCapacity for clarity
- Fix gray stack growth condition to check capacity instead of depth
- Use config.reallocateFn directly instead of wrenReallocate wrapper
- Change blacken loop from do-while to while to handle empty gray set
- Remove separate initializeGC function and inline allocation in wrenNewVM
- Add explicit System.gc() calls in deeply_nested_gc and many_reallocations tests
- Normalize test output strings to lowercase "done"
This commit is contained in:
Bob Nystrom
2015-10-29 14:38:09 +00:00
parent 9fe0b2475e
commit 8afa5c3d68
5 changed files with 22 additions and 24 deletions
+2 -1
View File
@@ -4,4 +4,5 @@ for (i in 1..400000) {
head = { "next" : head }
}
System.print("done") // expect: done
System.gc()
System.print("done") // expect: done
+3 -1
View File
@@ -10,5 +10,7 @@ for (i in 1..1000) {
}
found.add(bar)
}
System.gc()
System.print(found.all {|i| i == 1337}) // expect: true
System.print("DONE!") // expect: DONE!
System.print("done") // expect: done