mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 08:42:13 +00:00
Bug 1691920 - Add a systemPageSizeKB parameter. r=jonco
Add a read-only parameter systemPageSizeKB to get the same result from js::Nursery::roundSize. Differential Revision: https://phabricator.services.mozilla.com/D106188
This commit is contained in:
parent
b5cbcf36ee
commit
8fbec92c35
@ -405,6 +405,13 @@ typedef enum JSGCParamKey {
|
||||
* Pref: None
|
||||
*/
|
||||
JSGC_NURSERY_TIMEOUT_FOR_IDLE_COLLECTION_MS = 46,
|
||||
|
||||
/**
|
||||
* The system page size in KB.
|
||||
*
|
||||
* This parameter is read-only.
|
||||
*/
|
||||
JSGC_SYSTEM_PAGE_SIZE_KB = 47,
|
||||
} JSGCParamKey;
|
||||
|
||||
/*
|
||||
|
@ -651,7 +651,8 @@ static bool MinorGC(JSContext* cx, unsigned argc, Value* vp) {
|
||||
_("chunkBytes", JSGC_CHUNK_BYTES, false) \
|
||||
_("helperThreadRatio", JSGC_HELPER_THREAD_RATIO, true) \
|
||||
_("maxHelperThreads", JSGC_MAX_HELPER_THREADS, true) \
|
||||
_("helperThreadCount", JSGC_HELPER_THREAD_COUNT, false)
|
||||
_("helperThreadCount", JSGC_HELPER_THREAD_COUNT, false) \
|
||||
_("systemPageSizeKB", JSGC_SYSTEM_PAGE_SIZE_KB, false)
|
||||
|
||||
static const struct ParamInfo {
|
||||
const char* name;
|
||||
|
@ -1641,6 +1641,8 @@ uint32_t GCRuntime::getParameter(JSGCParamKey key, const AutoLockGC& lock) {
|
||||
return maxHelperThreads;
|
||||
case JSGC_HELPER_THREAD_COUNT:
|
||||
return helperThreadCount;
|
||||
case JSGC_SYSTEM_PAGE_SIZE_KB:
|
||||
return SystemPageSize() / 1024;
|
||||
default:
|
||||
MOZ_CRASH("Unknown parameter key");
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
load(libdir + "asserts.js");
|
||||
|
||||
const chunkSizeKB = gcparam('chunkBytes') / 1024;
|
||||
const pageSizeKB = gcparam('systemPageSizeKB');
|
||||
|
||||
var testSizesKB = [128, 129, 255, 256, 516, 1023, 1024, 3*1024, 4*1024+1, 16*1024];
|
||||
|
||||
@ -48,7 +49,7 @@ function allocateSomeThings() {
|
||||
}
|
||||
|
||||
function nearestLegalSize(sizeKB) {
|
||||
let step = sizeKB >= chunkSizeKB ? chunkSizeKB : 4;
|
||||
let step = sizeKB >= chunkSizeKB ? chunkSizeKB : pageSizeKB;
|
||||
return round(sizeKB, step);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user