Subj : The new changes to atom safety in garbage collection To : netscape.public.mozilla.jseng From : "Steven C. Cole" Date : Wed Jul 30 2003 01:48 pm Brendan & other Spidermonkey code jockeys, A while ago we learned that calling JS_GC() from within a resolve hook was a bad thing to do, because there can be unrooted atoms during a resolve call that the GC then removes. We still wanted to do GCs from within the resolve hook, however (for last-ditch help in out-of-memory scenarios), so I wrote a little "restricted" GC routine that used the JS_KEEP_ATOMS parameter of js_GC to avoid hitting the atoms. But with the changes that went in last week, this all got changed around a bit, and now there's a runtime flag that indicates whether atoms are safe for GC or not. I notice that this flag is set around compilation, where the GC used to be disabled. Here's my question: Is the "keep atoms" flag also set in other places where it's not safe to GC them? In other words, can we go back to calling the "official" api JS_GC() call from our out-of-memory hooks (which can happen in resolve hooks or any of the other object hooks), and remove the "restricted GC" routine that I wrote? Thanks, Steve Cole .