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 83b9d3d0d1f981edc444452b500df9fa5b89a056..6ebadc3b85b0f954305bc3a9187b996aa248a347 100644
|
|
--- a/include/v8.h
|
|
+++ b/include/v8.h
|
|
@@ -7661,6 +7661,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 9ddef27b9f7004fb50290f0dd91d2994d9771466..b4a0f5bb5e484ea80dbfc234e207b44413f2d22f 100644
|
|
--- a/src/api.cc
|
|
+++ b/src/api.cc
|
|
@@ -8072,6 +8072,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();
|