GC_MARK(cx, thing, "locked object", NULL);
if (!JSVAL_IS_NULL(v) && JSVAL_IS_GCTHING(v)) { JSContext *cx = (JSContext *)arg; #ifdef DEBUG uintN i; JSArena *a; jsuword firstpage; JSBool root_points_to_gcArenaPool = JS_FALSE; void *thing = JSVAL_TO_GCTHING(v);  for (i = 0; i < GC_NUM_FREELISTS; i++) { for (a = cx->runtime->gcArenaPool[i].first.next; a; a = a->next) { firstpage = FIRST_THING_PAGE(a); if (JS_UPTRDIFF(thing, firstpage) < a->avail - firstpage) { root_points_to_gcArenaPool = JS_TRUE; break; } } } if (!root_points_to_gcArenaPool && rhe->name) { fprintf(stderr, "JS API usage error: the address passed to JS_AddNamedRoot currently holds an\n" "invalid jsval.  This is usually caused by a missing call to JS_RemoveRoot.\n" "The root's name is \"%s\".\n", rhe->name); } JS_ASSERT(root_points_to_gcArenaPool); #endif  GC_MARK(cx, JSVAL_TO_GCTHING(v), rhe->name ? rhe->name : "root", NULL); }
JS_STATIC_DLL_CALLBACK(JSDHashOperator)gc_lock_marker(JSDHashTable *table, JSDHashEntryHdr *hdr, uint32 num, void *arg){    JSGCLockHashEntry *lhe = (JSGCLockHashEntry *)hdr;    void *thing = (void *)lhe->thing;    JSContext *cx = (JSContext *)arg;    GC_MARK(cx, thing, "locked object", NULL);    return JS_DHASH_NEXT;}