summaryrefslogtreecommitdiff
path: root/src/node_worker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/node_worker.cc')
-rw-r--r--src/node_worker.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/node_worker.cc b/src/node_worker.cc
index 9f2da4c9de..3c604ec2ec 100644
--- a/src/node_worker.cc
+++ b/src/node_worker.cc
@@ -51,7 +51,6 @@ Worker::Worker(Environment* env,
per_isolate_opts_(per_isolate_opts),
exec_argv_(exec_argv),
platform_(env->isolate_data()->platform()),
- array_buffer_allocator_(ArrayBufferAllocator::Create()),
start_profiler_idle_notifier_(env->profiler_idle_notifier_started()),
thread_id_(Environment::AllocateThreadId()),
env_vars_(env->env_vars()) {
@@ -95,10 +94,6 @@ bool Worker::is_stopped() const {
return stopped_;
}
-std::shared_ptr<ArrayBufferAllocator> Worker::array_buffer_allocator() {
- return array_buffer_allocator_;
-}
-
void Worker::UpdateResourceConstraints(ResourceConstraints* constraints) {
constraints->set_stack_limit(reinterpret_cast<uint32_t*>(stack_base_));
@@ -138,9 +133,11 @@ class WorkerThreadData {
: w_(w) {
CHECK_EQ(uv_loop_init(&loop_), 0);
+ std::shared_ptr<ArrayBufferAllocator> allocator =
+ ArrayBufferAllocator::Create();
Isolate::CreateParams params;
SetIsolateCreateParamsForNode(&params);
- params.array_buffer_allocator = w->array_buffer_allocator_.get();
+ params.array_buffer_allocator_shared = allocator;
w->UpdateResourceConstraints(&params.constraints);
@@ -164,7 +161,7 @@ class WorkerThreadData {
isolate_data_.reset(CreateIsolateData(isolate,
&loop_,
w_->platform_,
- w->array_buffer_allocator_.get()));
+ allocator.get()));
CHECK(isolate_data_);
if (w_->per_isolate_opts_)
isolate_data_->set_options(std::move(w_->per_isolate_opts_));