diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index e1951ec270597d..325d3b0988314c 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -7717,6 +7717,9 @@ class V8_EXPORT Isolate { */ void SetIdle(bool is_idle); + /** Returns the ArrayBuffer::Allocator used in this isolate. */ + ArrayBuffer::Allocator* GetArrayBufferAllocator(); + /** Returns true if this isolate has a current context. */ bool InContext(); diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index 8163b9061f3813..3f0cad545f5cee 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -8084,6 +8084,11 @@ void Isolate::SetIdle(bool is_idle) { isolate->SetIdle(is_idle); } +ArrayBuffer::Allocator* Isolate::GetArrayBufferAllocator() { + i::Isolate* isolate = reinterpret_cast(this); + return isolate->array_buffer_allocator(); +} + bool Isolate::InContext() { i::Isolate* isolate = reinterpret_cast(this); return isolate->context() != nullptr; diff --git a/deps/v8/test/cctest/test-api.cc b/deps/v8/test/cctest/test-api.cc index ae8b133b2dd5de..7aa54a00f838a6 100644 --- a/deps/v8/test/cctest/test-api.cc +++ b/deps/v8/test/cctest/test-api.cc @@ -20773,6 +20773,7 @@ TEST(IsolateNewDispose) { CHECK_NOT_NULL(isolate); CHECK(current_isolate != isolate); CHECK(current_isolate == CcTest::isolate()); + CHECK(isolate->GetArrayBufferAllocator() == CcTest::array_buffer_allocator()); isolate->SetFatalErrorHandler(StoringErrorCallback); last_location = last_message = nullptr;