From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 22 Oct 2018 10:47:12 -0700 Subject: array_buffer.patch diff --git a/include/v8.h b/include/v8.h index fa3a4dd82c0deeaddba0a84e8bf2841e04bc8483..3070f4aa50eed8722805feaf8d9b9db0d68fbbbf 100644 --- a/include/v8.h +++ b/include/v8.h @@ -7737,6 +7737,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/src/api.cc b/src/api.cc index 809bbe52178a3f8cbcf0b6eb81fba0910c1fb0e6..c1f863d148243d3988a70959fd91a37788137393 100644 --- a/src/api.cc +++ b/src/api.cc @@ -8107,6 +8107,13 @@ 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;