Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-04-27 04:41:56 +0300
committerAnna Henningsen <anna@addaleax.net>2020-04-29 06:13:42 +0300
commite7b99e027b2fe2fc0834bf2df9daf6d94b27f02b (patch)
treee280ed7486944384816c6a48f0a113c0195c629e /src/node_worker.h
parentef85bd1908e9550e59dbfa16372b79c1a95ea2a8 (diff)
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>
Diffstat (limited to 'src/node_worker.h')
-rw-r--r--src/node_worker.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_worker.h b/src/node_worker.h
index f9deaa59b4a..1b9ba322bed 100644
--- a/src/node_worker.h
+++ b/src/node_worker.h
@@ -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;