Subj : Re: help with GC To : netscape.public.mozilla.jseng From : "Jashin Eugene" Date : Tue Sep 16 2003 08:07 pm ok, i already understood that i must call JS_AddRoot(cx, &gc_obj); instead of.. but can gc_obj variable be a stack variable? anyway, i'm trying to cache compiled JSScript * objects, which is the best method to do that? (protecting from GC) > > JSScript *js = JS_CompileScript(...); > JSObject *gc_obj = JS_NewScriptObject(cx, script); > JS_AddRoot(cx, gc_obj); > JS_GC(cx); > > on JS_GC it falls with "root_points_to_gcArenaPool".. > all funcs return not null values.. > version: JavaScript-C 1.5 pre-release 4a 2002-03-21 > thanks.. > .