Working garbage collection in emscripten

152 views
Skip to first unread message

Carlo Kok

unread,
Jul 21, 2016, 7:43:59 AM7/21/16
to emscripten-discuss
hi,

Does anyone here know a working GC for emscripten? Specifically one that works with and without pthread support? From the chat channel I heard boehm depends on stack scanning which makes it pretty limited in it's abilities.

--
Carlo KOk

Juha Järvi

unread,
Nov 27, 2016, 9:34:25 AM11/27/16
to emscripten-discuss
Can you somehow avoid needing full GC? nbind-based bindings have a (currently undocumented) feature that calling a toggleLightGC method causes all objects passed by value or shared pointer from C++ to JavaScript always get freed on the next tick, unless their persist method is called. That means if you have some small JavaScript algorithm generating temporary values, at least those will be "garbage collected" automatically. Is your issue simply one of convenience, that might be fixed if you only had to explicitly keep things rather than explicitly free them?

Carlo Kok

unread,
Nov 27, 2016, 10:38:34 AM11/27/16
to emscripte...@googlegroups.com, Juha Järvi
Not really. Was more looking for a boehm equivalent.
--
Carlo Kok
RemObjects Software

Alon Zakai

unread,
Nov 27, 2016, 7:25:04 PM11/27/16
to emscripten-discuss
One way to avoid Boehm's stack scanning limitation is to GC in between turns of the event loop, as in a browser each frame needs to return control to the browser anyhow, and nothing is on the stack at that point.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages