Chromium Code Reviews| Index: src/d8.cc |
| diff --git a/src/d8.cc b/src/d8.cc |
| index 57e0c0424f3ddef31a6d517476c6005f61ea74e6..1d980a9841b1e921154a5e0082797c2d993ccf91 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 |
| + static ShellArrayBufferAllocator array_buffer_allocator; |
|
Sven Panne
2013/06/11 09:54:37
Why do we need "static"?
Dmitry Lomov (no reviews)
2013/06/11 10:40:09
Done.
|
| + v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); |
| int result = 0; |
| Isolate* isolate = Isolate::GetCurrent(); |
| DumbLineEditor dumb_line_editor(isolate); |