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 970d4dc270a68076d5131085a13264bd42281809..ddf751106d4e0b2fb6f3c46f065adc6d76eca781 100644
|
|
--- a/src/api.cc
|
|
+++ b/src/api.cc
|
|
@@ -7983,6 +7983,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();
|