Index: test/cctest/interpreter/generate-bytecode-expectations.cc |
diff --git a/test/cctest/interpreter/generate-bytecode-expectations.cc b/test/cctest/interpreter/generate-bytecode-expectations.cc |
index 53f2e3fce3e532731d5220e19d8b19e0a8c0647a..f8237593e4ce84d79a7fed7e8c795f90306002a4 100644 |
--- a/test/cctest/interpreter/generate-bytecode-expectations.cc |
+++ b/test/cctest/interpreter/generate-bytecode-expectations.cc |
@@ -93,17 +93,6 @@ class ProgramOptions final { |
std::string test_function_name_; |
}; |
-class ArrayBufferAllocator final : public v8::ArrayBuffer::Allocator { |
- public: |
- void* Allocate(size_t length) override { |
- void* data = AllocateUninitialized(length); |
- if (data != nullptr) memset(data, 0, length); |
- return data; |
- } |
- void* AllocateUninitialized(size_t length) override { return malloc(length); } |
- void Free(void* data, size_t) override { free(data); } |
-}; |
- |
class V8InitializationScope final { |
public: |
explicit V8InitializationScope(const char* exec_path); |
@@ -114,6 +103,7 @@ class V8InitializationScope final { |
private: |
v8::base::SmartPointer<v8::Platform> platform_; |
+ v8::base::SmartPointer<v8::ArrayBuffer::Allocator> allocator_; |
v8::Isolate* isolate_; |
DISALLOW_COPY_AND_ASSIGN(V8InitializationScope); |
@@ -363,9 +353,9 @@ V8InitializationScope::V8InitializationScope(const char* exec_path) |
v8::V8::InitializePlatform(platform_.get()); |
v8::V8::Initialize(); |
- ArrayBufferAllocator allocator; |
v8::Isolate::CreateParams create_params; |
- create_params.array_buffer_allocator = &allocator; |
+ allocator_.Reset(v8::ArrayBuffer::Allocator::NewDefaultAllocator()); |
+ create_params.array_buffer_allocator = allocator_.get(); |
isolate_ = v8::Isolate::New(create_params); |
} |