Subj : GC question: JS_GetStringBytes To : netscape.public.mozilla.jseng From : Eric Anholt Date : Sat Aug 27 2005 04:47 pm 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. - 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. .