mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 06:48:38 +09:00
Implement configuration pref for Generational Garbage Collection.
Pref: javascript.options.mem.gc_generational This resolves #20
This commit is contained in:
parent
05eb40a155
commit
935b074787
4 changed files with 20 additions and 0 deletions
|
|
@ -2282,6 +2282,7 @@ SetMemoryGCModePrefChangedCallback(const char* aPrefName, void* aClosure)
|
|||
{
|
||||
bool enableZoneGC = Preferences::GetBool("javascript.options.mem.gc_per_zone");
|
||||
bool enableIncrementalGC = Preferences::GetBool("javascript.options.mem.gc_incremental");
|
||||
bool enableGenerationalGC = Preferences::GetBool("javascript.options.mem.gc_generational");
|
||||
JSGCMode mode;
|
||||
if (enableIncrementalGC) {
|
||||
mode = JSGC_MODE_INCREMENTAL;
|
||||
|
|
@ -2291,6 +2292,7 @@ SetMemoryGCModePrefChangedCallback(const char* aPrefName, void* aClosure)
|
|||
mode = JSGC_MODE_GLOBAL;
|
||||
}
|
||||
JS_SetGCParameter(sContext, JSGC_MODE, mode);
|
||||
JS_SetGGCMode(sContext, enableGenerationalGC);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -2485,6 +2487,9 @@ nsJSContext::EnsureStatics()
|
|||
Preferences::RegisterCallbackAndCall(SetMemoryGCSliceTimePrefChangedCallback,
|
||||
"javascript.options.mem.gc_incremental_slice_ms");
|
||||
|
||||
Preferences::RegisterCallbackAndCall(SetMemoryGCModePrefChangedCallback,
|
||||
"javascript.options.mem.gc_generational");
|
||||
|
||||
Preferences::RegisterCallbackAndCall(SetMemoryGCCompactingPrefChangedCallback,
|
||||
"javascript.options.mem.gc_compacting");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue