Logo
Explore Mail Help
Register Sign In
Mirror/wren
1
0
Fork 1
You've already forked wren
mirror of https://github.com/wren-lang/wren.git synced 2026-01-18 13:49:59 +01:00
Code Issues Packages Projects Releases Wiki Activity
Files
48a6a5f67ad004879bb373dc16455c2eea00d355
wren/test/language/deeply_nested_gc.wren

9 lines
112 B
Plaintext
Raw Normal View History

Remove Recursive Mark from GC The previous GC implementation used a recursive mark method. This can result in stack overflows when attempting to mark deeply nested objects. This commit replaces the recursive approach with an iteritive one, moving the state stack from the C call stack to the `WrenVM` structure. As objects are 'grayed' they are pushed onto the VM's gray stack. When we have grayed all of the root objects we iterate until the stack is empty graying any obejcts which haven't been marked as dark before. At the end of the process we clean up all unmarked objects as before. This commit also adds a few new tests which check garbage collection by allocating some new deeply nested objects and triggering the GC a few times in the process.
2015-10-19 22:45:15 +01:00
var head
for (i in 1..400000) {
head = { "next" : head }
}
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
System.gc()
System.print("done") // expect: done
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.0 Page: 496ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API