summaryrefslogtreecommitdiffstats
path: root/js/public/GCAPI.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /js/public/GCAPI.h
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/public/GCAPI.h')
-rw-r--r--js/public/GCAPI.h36
1 files changed, 26 insertions, 10 deletions
diff --git a/js/public/GCAPI.h b/js/public/GCAPI.h
index b0f1325a1e..9bdaca9661 100644
--- a/js/public/GCAPI.h
+++ b/js/public/GCAPI.h
@@ -308,22 +308,21 @@ typedef enum JSGCParamKey {
JSGC_LARGE_HEAP_INCREMENTAL_LIMIT = 26,
/**
- * Attempt to run a minor GC in the idle time if the free space falls
- * below this number of bytes.
+ * Free space bytes threshold for eager nursery collection.
*
* Default: NurseryChunkUsableSize / 4
- * Pref: None
+ * Pref: javascript.options.mem.nursery_eager_collection_threshold_kb
*/
- JSGC_NURSERY_FREE_THRESHOLD_FOR_IDLE_COLLECTION = 27,
+ JSGC_NURSERY_EAGER_COLLECTION_THRESHOLD_KB = 27,
/**
- * Attempt to run a minor GC in the idle time if the free space falls
- * below this percentage (from 0 to 99).
+ * Free space fraction threshold for eager nursery collection. This is a
+ * percentage (from 0 to 99).
*
* Default: 25
- * Pref: None
+ * Pref: javascript.options.mem.nursery_eager_collection_threshold_percent
*/
- JSGC_NURSERY_FREE_THRESHOLD_FOR_IDLE_COLLECTION_PERCENT = 30,
+ JSGC_NURSERY_EAGER_COLLECTION_THRESHOLD_PERCENT = 30,
/**
* Minimum size of the generational GC nurseries.
@@ -418,9 +417,9 @@ typedef enum JSGCParamKey {
* collected in this many milliseconds.
*
* Default: 5000
- * Pref: None
+ * Pref: javascript.options.mem.nursery_eager_collection_timeout_ms
*/
- JSGC_NURSERY_TIMEOUT_FOR_IDLE_COLLECTION_MS = 46,
+ JSGC_NURSERY_EAGER_COLLECTION_TIMEOUT_MS = 46,
/**
* The system page size in KB.
@@ -456,6 +455,7 @@ typedef enum JSGCParamKey {
/**
* The heap size above which to use parallel marking.
*
+ * Pref: javascript.options.mem.gc_parallel_marking_threshold_mb
* Default: ParallelMarkingThresholdMB
*/
JSGC_PARALLEL_MARKING_THRESHOLD_MB = 50,
@@ -1287,10 +1287,26 @@ JS_GetExternalStringCallbacks(JSString* str);
namespace JS {
+/**
+ * Check whether the nursery should be eagerly collected, this is before it is
+ * full.
+ *
+ * The idea is that this can be called when the host environment has some idle
+ * time which it can use to for GC activity.
+ *
+ * Returns GCReason::NO_REASON to indicate no collection is desired.
+ */
extern JS_PUBLIC_API GCReason WantEagerMinorGC(JSRuntime* rt);
extern JS_PUBLIC_API GCReason WantEagerMajorGC(JSRuntime* rt);
+/**
+ * Check whether the nursery should be eagerly collected as per WantEagerMajorGC
+ * above, and if so run a collection.
+ *
+ * The idea is that this can be called when the host environment has some idle
+ * time which it can use to for GC activity.
+ */
extern JS_PUBLIC_API void MaybeRunNurseryCollection(JSRuntime* rt,
JS::GCReason reason);