[gjs: 14/18] jsapi-util: Change upper limit of RSS trigger to uint32 max
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 14/18] jsapi-util: Change upper limit of RSS trigger to uint32 max
- Date: Mon, 5 Oct 2020 02:09:53 +0000 (UTC)
commit 4b90d2a2d12bd8d0475b9ab058795cb3cd6dce9b
Author: Philip Chimento <philip chimento gmail com>
Date: Wed Sep 30 18:12:35 2020 -0700
jsapi-util: Change upper limit of RSS trigger to uint32 max
Rationale: this code was likely written on a 32-bit system in 2011 in
which G_MAXULONG would have been 4294967295, not 18446744073709551615.
gjs/jsapi-util.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index de3ed8a1..1bcfed44 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -586,7 +586,7 @@ gjs_gc_if_needed (JSContext *context)
return; // doesn't make sense
uint64_t rss_usize = rss_size;
if (rss_usize > linux_rss_trigger) {
- linux_rss_trigger = MIN(G_MAXULONG, rss_usize * 1.25);
+ linux_rss_trigger = MIN(G_MAXUINT32, rss_usize * 1.25);
JS::NonIncrementalGC(context, GC_SHRINK, JS::GCReason::API);
} else if (rss_size < (0.75 * linux_rss_trigger)) {
/* If we've shrunk by 75%, lower the trigger */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]