SpiderMonkey garbage collector
-
16-06-2021 - |
Question
If SM's GC is a conservative stack scanner, why is the example 3 "bad"? Why is "root as you go" necessary? The GC should scan the stack and observe that str1, str2 are roots, no?
Solution
You need to get your timeline straight.
- A conservative stack scanner was introduced in SpiderMonkey 1.8.5.
- The document linked above also mentions 22 March 2011 as the release date of SpiderMonkey 1.8.5.
- The documentation you linked to wasn't edited since August 2008.
In other words: you found a piece of very outdated documentation. Indeed, the tags at the bottom say: NeedsEditorialReview
, NeedsTechnicalReview
. Not something that you should rely on.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow