mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-22 12:23:08 +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
|
|
@ -1410,6 +1410,17 @@ JS_SetGCParameter(JSContext* cx, JSGCParamKey key, uint32_t value)
|
|||
MOZ_ALWAYS_TRUE(cx->gc.setParameter(key, value, lock));
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
JS_SetGGCMode(JSContext* cx, bool enabled)
|
||||
{
|
||||
// Control GGC
|
||||
if (enabled && !cx->gc.isGenerationalGCEnabled()) {
|
||||
cx->gc.enableGenerationalGC();
|
||||
} else if (!enabled && cx->gc.isGenerationalGCEnabled()) {
|
||||
cx->gc.disableGenerationalGC();
|
||||
}
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(uint32_t)
|
||||
JS_GetGCParameter(JSContext* cx, JSGCParamKey key)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue