electron/patches/common/v8/array_buffer.patch

39 lines
1.2 KiB
Diff
Raw Normal View History

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
2019-01-24 09:42:21 +00:00
index 4d513fc2e28ce60ae4c0e50a56e4e59084a017cf..fd061fde06956418373ded038f6f37e4488ac1a3 100644
--- a/include/v8.h
+++ b/include/v8.h
2019-01-24 09:42:21 +00:00
@@ -7705,6 +7705,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
2019-01-24 09:42:21 +00:00
index 95d242de7d11b1ea990d277d2f09c23749401f5e..d963a10525dbdeb60c9d762f1fa5038c4d410010 100644
--- a/src/api.cc
+++ b/src/api.cc
2019-01-16 18:09:10 +00:00
@@ -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);
2019-01-09 00:53:35 +00:00
return !isolate->context().is_null();