MCPcopy Index your code
hub / github.com/nodejs/node / parseResourceLimits

Function parseResourceLimits

lib/internal/worker.js:674–688  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

672
673const resourceLimitsArray = new Float64Array(kTotalResourceLimitCount);
674function parseResourceLimits(obj) {
675 const ret = resourceLimitsArray;
676 TypedArrayPrototypeFill(ret, -1);
677 if (typeof obj !== 'object' || obj === null) return ret;
678
679 if (typeof obj.maxOldGenerationSizeMb === 'number')
680 ret[kMaxOldGenerationSizeMb] = MathMax(obj.maxOldGenerationSizeMb, 2);
681 if (typeof obj.maxYoungGenerationSizeMb === 'number')
682 ret[kMaxYoungGenerationSizeMb] = obj.maxYoungGenerationSizeMb;
683 if (typeof obj.codeRangeSizeMb === 'number')
684 ret[kCodeRangeSizeMb] = obj.codeRangeSizeMb;
685 if (typeof obj.stackSizeMb === 'number')
686 ret[kStackSizeMb] = obj.stackSizeMb;
687 return ret;
688}
689
690function makeResourceLimits(float64arr) {
691 return {

Callers 1

constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…