2018-10-24 18:24:11 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/include/v8.h b/include/v8.h
|
2019-01-12 01:00:43 +00:00
|
|
|
index b2301cd8d07c1ef57e77cedab920a43f0b498597..6934a9c3838641446fa96a8ab48abed4cfc1841c 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/include/v8.h
|
|
|
|
+++ b/include/v8.h
|
2019-01-12 01:00:43 +00:00
|
|
|
@@ -7653,6 +7653,9 @@ class V8_EXPORT Isolate {
|
2018-09-14 05:02:16 +00:00
|
|
|
*/
|
|
|
|
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-12 01:00:43 +00:00
|
|
|
index 2863b73e0677b666040766fef638abbc6fc95b8c..8d83474bcd0ed257b8f387d7996085c605326236 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/src/api.cc
|
|
|
|
+++ b/src/api.cc
|
2019-01-12 01:00:43 +00:00
|
|
|
@@ -7984,6 +7984,13 @@ void Isolate::SetIdle(bool is_idle) {
|
2018-09-14 05:02:16 +00:00
|
|
|
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() != nullptr;
|