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 fc20cf50c3a6dc66c37b8b46d06db7a2f0f558ce..f23567c1429ae0bbc5f916e4ee0a1190dae8d88f 100644 --- a/include/v8.h +++ b/include/v8.h @@ -7707,6 +7707,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 55b2a1a2da257924eba7e3757994d68c1b508367..279edffbcc283ebfd11faf263d60f5a20c121d87 100644 --- a/src/api.cc +++ b/src/api.cc @@ -7966,6 +7966,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().is_null();