Index: src/d8.cc |
diff --git a/src/d8.cc b/src/d8.cc |
index 57e0c0424f3ddef31a6d517476c6005f61ea74e6..a917dbdbe3a52b2641613063381fc10d6632e71a 100644 |
--- a/src/d8.cc |
+++ b/src/d8.cc |
@@ -1571,6 +1571,13 @@ static void EnableHarmonyTypedArraysViaCommandLine() { |
#endif |
+class ShellArrayBufferAllocator : public v8::ArrayBuffer::Allocator { |
+ public: |
+ virtual void* Allocate(size_t length) { return malloc(length); } |
+ virtual void Free(void* data) { free(data); } |
+}; |
+ |
+ |
int Shell::Main(int argc, char* argv[]) { |
if (!SetOptions(argc, argv)) return 1; |
#ifndef V8_SHARED |
@@ -1579,6 +1586,8 @@ int Shell::Main(int argc, char* argv[]) { |
#else |
EnableHarmonyTypedArraysViaCommandLine(); |
#endif |
+ ShellArrayBufferAllocator array_buffer_allocator; |
+ v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); |
int result = 0; |
Isolate* isolate = Isolate::GetCurrent(); |
DumbLineEditor dumb_line_editor(isolate); |