worker: add stack size resource limit option

Add `stackSizeMb` to the `resourceLimit` option group.

Refs: https://github.com/nodejs/node/pull/31593#issuecomment-619633820

PR-URL: https://github.com/nodejs/node/pull/33085
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Anna Henningsen committed 2020-04-29 05:13:42 +02:00
1 parent ef85bd1908
commit e7b99e027b
6 files changed
+61 -20

No files matched your search

+2 -1
View File
@@ -16,6 +16,7 @@ enum ResourceLimits {
kMaxYoungGenerationSizeMb,
kMaxOldGenerationSizeMb,
kCodeRangeSizeMb,
kStackSizeMb,
kTotalResourceLimitCount
};
@@ -95,7 +96,7 @@ class Worker : public AsyncWrap {
void UpdateResourceConstraints(v8::ResourceConstraints* constraints);
// Full size of the thread's stack.
static constexpr size_t kStackSize = 4 * 1024 * 1024;
size_t stack_size_ = 4 * 1024 * 1024;
// Stack buffer size that is not available to the JS engine.
static constexpr size_t kStackBufferSize = 192 * 1024;