38 lines
1.2 KiB
Diff
38 lines
1.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
Date: Mon, 22 Oct 2018 10:47:12 -0700
|
|
Subject: array_buffer.patch
|
|
|
|
|
|
diff --git a/include/v8.h b/include/v8.h
|
|
index da8beb3a50cd766fa77cab2396ed9ce889614b85..16a17739e5396dc7db5b5f483b2fe34cc4afbd39 100644
|
|
--- a/include/v8.h
|
|
+++ b/include/v8.h
|
|
@@ -7825,6 +7825,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 f9c3f9e55525119359f7d2a1f0978e7acf302775..b2efe0ee52ca548a5d8d25555c4a6119422efd71 100644
|
|
--- a/src/api.cc
|
|
+++ b/src/api.cc
|
|
@@ -7982,6 +7982,13 @@ void Isolate::SetIdle(bool is_idle) {
|
|
isolate->SetIdle(is_idle);
|
|
}
|
|
|
|
+
|
|
+ArrayBuffer::Allocator* Isolate::GetArrayBufferAllocator() {
|
|
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
|
|
+ return isolate->array_buffer_allocator();
|
|
+}
|
|
+
|
|
+
|
|
bool Isolate::InContext() {
|
|
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
|
|
return !isolate->context().is_null();
|