A GC language could target C by storing all heap pointers on a shadow stack or similar. Remember how the Factor runtime used macros and later smart pointers for that
-
-
Yeah, you could do that, or you could use conservative GC. It won’t be perf-competitive with the best GCs though.
2 replies 0 retweets 1 like -
Replying to @pcwalton @slava_pestov and
Why wouldn’t a conservative GC be competitive?
1 reply 0 retweets 0 likes -
Replying to @jfbastien @slava_pestov and
It can’t be a moving GC, which means it can’t have bump allocating TLABs in the nursery. So malloc will be slower than it needs to be.
1 reply 0 retweets 0 likes -
Replying to @pcwalton @slava_pestov and
The JSC GC is conservative and non-moving, seems to be doing fine. Agreed malloc when you can't just bump a pointer isn't as fast, but you have other costs that this, no?
2 replies 0 retweets 0 likes -
Replying to @jfbastien @slava_pestov and
Well, to be honest I don’t really have the motivation for a Twitter debate about GC strategies right now :) Suffice it to say that if you’re targeting C you’re limited in your choice of GC algorithms.
1 reply 0 retweets 2 likes -
Replying to @pcwalton @slava_pestov and
We're debating?
Agreed that targeting C limits GC algorithms. Really it's Boehm or do something else than C
https://www.youtube.com/watch?v=wxrbOVeRonQ …1 reply 0 retweets 1 like -
Replying to @jfbastien @pcwalton and
Boehm is "something else than C". It's 100% filthy UB. But you can do GC in C. Just not on arbitrary C objects, rather higher-level object you implement in terms of C ones.
1 reply 0 retweets 0 likes -
Replying to @RichFelker @jfbastien and
Failure to understand this for decades is the main reason browsers are such buggy, memleaky crap.
1 reply 0 retweets 0 likes -
Replying to @RichFelker @jfbastien and
Hey now, Firefox/Gecko has fully precise hybrid GC/refcounting, with a cycle collector :) Took a mountain of engineering work (
@graydon_pub did a lot of it, in fact!)3 replies 0 retweets 2 likes
(Runner up is Chromium, which is not fully precise GC, but it does precise collections once the event loop is done and there’s no native code on the stack, which is usually good enough.)
-
-
Replying to @pcwalton @RichFelker and
My kernel does precise GC at process boundary
0 replies 0 retweets 3 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
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.