JS_ACQUIRE_LOCK(arena_freelist_lock);
FreeArenaList(JSArenaPool *pool, JSArena *head, JSBool reallyFree){    JSArena **ap, *a;#ifdef JS_THREADSAFE    JSArena *b;#endif    ap = &head->next;    a = *ap;    if (!a)	return;#ifdef DEBUG    do {	JS_ASSERT(a->base <= a->avail && a->avail <= a->limit);	a->avail = a->base;	JS_CLEAR_UNUSED(a);    } while ((a = a->next) != NULL);    a = *ap;#endif    if (reallyFree) {	do {	    *ap = a->next;	    JS_CLEAR_ARENA(a);	    JS_COUNT_ARENA(pool,--);	    free(a);	} while ((a = *ap) != NULL);    } else {	/* Insert the whole arena chain at the front of the freelist. */	do {	    ap = &(*ap)->next;	} while (*ap);#ifdef JS_THREADSAFE	do {	    *ap = b = arena_freelist;	} while (!js_CompareAndSwap((jsword *)&arena_freelist, (jsword)b,                                    (jsword)a));#else	*ap = arena_freelist;	arena_freelist = a;#endif	head->next = NULL;    }    pool->current = head;}