PL_INIT_ARENA_POOL(&gPrefNameArena, "PrefNameArena", PREFNAME_ARENA_SIZE);
PRBool PREF_Init(const char *filename){    PRBool ok = PR_TRUE, request = PR_FALSE;    if (!gHashTable.ops) {        if (!PL_DHashTableInit(&gHashTable, &pref_HashTableOps, nsnull,                               sizeof(PrefHashEntry), 1024))            gHashTable.ops = nsnull;    }            if (!gMochaTaskState)    {        gMochaTaskState = PREF_GetJSRuntime();        if (!gMochaTaskState)            return PR_FALSE;    }    if (!gMochaContext)    {        ok = PR_FALSE;        gMochaContext = JS_NewContext(gMochaTaskState, 8192);        if (!gMochaContext)            goto out;        JS_BeginRequest(gMochaContext);        request = PR_TRUE;        gGlobalConfigObject = JS_NewObject(gMochaContext, &global_class, NULL,                                           NULL);        if (!gGlobalConfigObject)            goto out;        /* MLM - need a global object for set version call now. */        JS_SetGlobalObject(gMochaContext, gGlobalConfigObject);        JS_SetVersion(gMochaContext, JSVERSION_1_5);        JS_SetBranchCallback(gMochaContext, pref_BranchCallback);        JS_SetErrorReporter(gMochaContext, NULL);        gMochaPrefObject = JS_DefineObject(gMochaContext,                                             gGlobalConfigObject,                                             "PrefConfig",                                            &autoconf_class,                                             NULL,                                             JSPROP_ENUMERATE|JSPROP_READONLY);                if (gMochaPrefObject)        {            if (!JS_DefineProperties(gMochaContext,                                     gMochaPrefObject,                                     autoconf_props))            {                goto out;            }            if (!JS_DefineFunctions(gMochaContext,                                    gMochaPrefObject,                                    autoconf_methods))            {                goto out;            }        }        ok = pref_InitInitialObjects();    } out:    if (request)        JS_EndRequest(gMochaContext);    if (!ok)        gErrorOpeningUserPrefs = PR_TRUE;    return ok;} /*PREF_Init*/