Periodic reminder: Don’t compile to C.
No, you just put the necessary data structures for walking live objects inside your objects rather than trying to access some underlying layer that would make it intrinsically nonportable.
-
-
How, without runtime overhead? I see no way around having to spill every root to the stack around every function call (and that’s assuming you can walk your stack). “Portable” GC is a nonstarter from a performance point of view.
-
You don't make objects collectable if their lifetime can be known statically. Only objects where reference patterns don't admit static analysis need to be walkable.
-
“Knowing the lifetime statically” means “stack and register maps”, which are impossible to do in C.
-
Cards on the table: I’m, in vain, trying to prevent other projects from falling into the trap of “implement conservative GC, then spend a decade trying to dig out of the hole”. SpiderMonkey is the only project I know of that successfully transitioned from conservative to moving.
-
"Conservative GC" is just fake C full of shitty UB (invalid pointer arithmetic).
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.