| |||||||||
SummaryAdds a garbage collection hash table entry for a specified JS item to protect it from garbage collection. | |||||||||
SyntaxJSBool JS_AddRoot(JSContext *cx, void *rp);
| |||||||||
DescriptionJS_AddRoot protects the GC thing pointed at by a specified pointer, *rp , from garbage collection. rp is a pointer to a pointer to a JS double, string, or object. An entry for rp is added to the garbage collector's table for the JSRuntime of the specified JSContext , cx .
If the GC thing pointed to by
| |||||||||
NotesYou should useJS_AddRoot to root only JS objects, JS strings, or JS doubles, and then only if they are derived from calls to their respective JS_New XXX creation functions.
If the entry in the root table is successfully created,
| |||||||||
See Also
|