Files
wren/test/language/many_reallocations.wren
Bob Nystrom 2ff8acbe1a Tweak a few things in the new GC.
- Make sure it handles an empty gray set.
- Make sure growing the gray stack doesn't itself trigger a GC.
- Make sure it works when stress testing is enabled.
- Ensure the tests kick off a GC.
2015-10-29 07:38:09 -07:00

17 lines
301 B
Plaintext

var found = []
for (i in 1..1000) {
var foo = 1337
for (i in 1..1000) {
foo = { "a" : foo, "b": foo }
}
var bar = foo
for (i in 1..1000) {
bar = bar["a"]
}
found.add(bar)
}
System.gc()
System.print(found.all {|i| i == 1337}) // expect: true
System.print("done") // expect: done