Subj : Re: The new changes to atom safety in garbage collection To : "Steven C. Cole" From : Brendan Eich Date : Wed Jul 30 2003 06:43 pm Steven C. Cole wrote: > 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. Right. Disabling was overkill, and never surfaced via an API. Note that there's still a js_GC gcflags parameter: GC_KEEP_ATOMS, so direct callers don't have to farble the rt->gcKeepAtoms counter. > 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? That's a great idea -- thanks. We just need the resolve code in js_LookupProperty to farble rt->gcKeepAtoms. I'm hopeful that's the last place, but I haven't checked. If you know of other cases where JSClass or JSObjectOps callbacks might be unable to trigger a GC without collecting an atom in use, hit me. /be .