Subj : Re: GC question: JS_GetStringBytes To : netscape.public.mozilla.jseng From : Eric Anholt Date : Sat Aug 27 2005 05:25 pm Eric Anholt wrote: > I'm one of the developers of swfdec, and we've been using the > spidermonkey code for interpreting actionscript with pretty good success > (primary complaint would be the lack of a build system outside of > mozilla that properly builds and installs shared libraries). > > However, while re-reading the code I realized I was being really sloppy > with GC, and I had a couple of questions as a result: > > - I assume JS_GetStringBytes returns GCed bytes, right? What is the > guaranteed lifetime of these guys? If it's "as long as the original > stirng is rooted," I'm fine. Sorry for the lack of RTFM. I hadn't found the JS Embedder's Reference somehow (and noticed it while reading more newsgroup entries). > - What would you do if you have to maintain a stack of jsvals? I'm > using a manually rooted JS array and setting jsvals into indexes of it, > but I'm not terribly pleased with this method. .