summaryrefslogtreecommitdiffstats
path: root/js/src/jsapi.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-02-02 20:44:40 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-02-02 20:44:40 +0100
commit4bf1a2a1cb61a165c0540208098070222eafdfff (patch)
tree41e81fdf433c32c263cb2fad07f87812e30c747a /js/src/jsapi.cpp
parentc0c702a5e3284e843e680064b4c6a7280242c567 (diff)
parentb80de6fe930792c94c9e64dd3867ffb1d663f16f (diff)
downloadUXP-4bf1a2a1cb61a165c0540208098070222eafdfff.tar
UXP-4bf1a2a1cb61a165c0540208098070222eafdfff.tar.gz
UXP-4bf1a2a1cb61a165c0540208098070222eafdfff.tar.lz
UXP-4bf1a2a1cb61a165c0540208098070222eafdfff.tar.xz
UXP-4bf1a2a1cb61a165c0540208098070222eafdfff.zip
Merge branch 'ported-moebius'
Diffstat (limited to 'js/src/jsapi.cpp')
-rw-r--r--js/src/jsapi.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
index a99d08951..e4e86effa 100644
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -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)
{