electron/patches/common/v8/array_buffer.patch
2019-02-14 23:57:58 +05:30

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 4b8fb04bc8210c0273157009b3560983b1322b18..f10a7950de2166804f779346bce580cfb2e7c3ec 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -7701,6 +7701,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 56be5e2e007c0ea84653a5487abef49cc206efc3..dd22b2a30b632fb9507eb2e2b95837dd9b8810db 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<i::Isolate*>(this);
+ return isolate->array_buffer_allocator();
+}
+
+
bool Isolate::InContext() {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
return !isolate->context().is_null();