зеркало из https://github.com/mozilla/gecko-dev.git
Bug 661690. Add preferences for gczeal frequency and whether the gczeal gc should be a per-compartment gc. r=wmccloskey
This commit is contained in:
Родитель
4f571c208d
Коммит
2f7dd9228d
|
@ -908,7 +908,9 @@ static const char js_strict_debug_option_str[] = JS_OPTIONS_DOT_STR "strict.debu
|
|||
static const char js_werror_option_str[] = JS_OPTIONS_DOT_STR "werror";
|
||||
static const char js_relimit_option_str[]= JS_OPTIONS_DOT_STR "relimit";
|
||||
#ifdef JS_GC_ZEAL
|
||||
static const char js_zeal_option_str[] = JS_OPTIONS_DOT_STR "gczeal";
|
||||
static const char js_zeal_option_str[] = JS_OPTIONS_DOT_STR "gczeal";
|
||||
static const char js_zeal_frequency_str[] = JS_OPTIONS_DOT_STR "gczeal.frequency";
|
||||
static const char js_zeal_compartment_str[] = JS_OPTIONS_DOT_STR "gczeal.compartment_gc";
|
||||
#endif
|
||||
static const char js_tracejit_content_str[] = JS_OPTIONS_DOT_STR "tracejit.content";
|
||||
static const char js_tracejit_chrome_str[] = JS_OPTIONS_DOT_STR "tracejit.chrome";
|
||||
|
@ -1012,8 +1014,10 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
|
|||
|
||||
#ifdef JS_GC_ZEAL
|
||||
PRInt32 zeal = Preferences::GetInt(js_zeal_option_str, -1);
|
||||
PRInt32 frequency = Preferences::GetInt(js_zeal_frequency_str, JS_DEFAULT_ZEAL_FREQ);
|
||||
PRBool compartment = Preferences::GetBool(js_zeal_compartment_str, JS_FALSE);
|
||||
if (zeal >= 0)
|
||||
::JS_SetGCZeal(context->mContext, (PRUint8)zeal, JS_DEFAULT_ZEAL_FREQ, JS_FALSE);
|
||||
::JS_SetGCZeal(context->mContext, (PRUint8)zeal, frequency, compartment);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче