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>2019-02-05 23:51:28 +0300
committerAnna Henningsen <anna@addaleax.net>2019-02-13 23:36:24 +0300
commita80b29b38a66cec456e4ec73fb8030f45d186005 (patch)
treead44198e7620505db311cdc99f689b6d7f7a058b /src/node_worker.h
parentda0dc51e396ea4a1f12f259a8149f4177ad674e8 (diff)
worker: set stack size for worker threads
This is so we can inform V8 about a known limit for the stack. Otherwise, on some systems recursive functions may lead to segmentation faults rather than “safe” failures. PR-URL: https://github.com/nodejs/node/pull/26049 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src/node_worker.h')
-rw-r--r--src/node_worker.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/node_worker.h b/src/node_worker.h
index 4d7a7335ca6..68848c85999 100644
--- a/src/node_worker.h
+++ b/src/node_worker.h
@@ -80,6 +80,12 @@ class Worker : public AsyncWrap {
bool thread_joined_ = true;
int exit_code_ = 0;
uint64_t thread_id_ = -1;
+ uintptr_t stack_base_;
+
+ // Full size of the thread's stack.
+ static constexpr size_t kStackSize = 4 * 1024 * 1024;
+ // Stack buffer size that is not available to the JS engine.
+ static constexpr size_t kStackBufferSize = 192 * 1024;
std::unique_ptr<MessagePortData> child_port_data_;