Subj : Re: AddRoot on the table of pointers To : netscape.public.mozilla.jseng From : Aleksander Wysocki Date : Tue Jan 27 2004 10:06 am Brendan Eich wrote: > There's no such "JS_AddRootArray" API. There could be, but it adds code > bloat for something no one has requested until now (in > 6 years). hmm... anyway solution would slow down the gc - as i understand every object in mark phase (if not marked and not in pending list) has to be checked if belongs to roots. as for now it is checked via hashing, so O(1), and if there were set of tables with roots, they should have been traversed in linear time... is my reasoning correct? > Is this table of roots part of the private data of a native object? If > so, you can implement JSClass.mark and avoid adding roots altogether. do you mean, that if i put my roots in native part of my complex object and if js-component is marked by gc it can pass control to native component, which would use JS_MarkGSThing(...) on every element of the table? i have found: JS_MarkGSThing(JSContext *cx, void *thing, const char *name, void *arg) in jsapi.c (but not in jsapi.h) prefix JS_ suggest it could be used externally...? what do arguments "name" and mystical "arg" mean ? is it to be passed arg from (* JS_DLL_CALLBACK JSMarkOp)(JSContext *cx, JSObject *obj, void *arg); ? maybe some hints? regards aw .