GC might miss marking some functions
tiendo1011 opened this issue · comments
Tien commented
In chapter 26, In the implementation of markCompilerRoots, the GC only mark the functions outward from the current function, what about function next to it (its sibling)?
For example:
fun a() {}
fun b() {}
When compiling b
, let's say it triggers a garbage collection, markCompilerRoots
will not mark a
to avoid it from being collected. Isn't it supposed to do so?
Tien commented
It seems that a
will be marked because it's in the enclosing function constants list, since the enclosing function will be marked, its constants will be marked too.