| Index: tools/parser-shell.cc
|
| diff --git a/tools/parser-shell.cc b/tools/parser-shell.cc
|
| index 810c5b9d174c5d25497ed3c96edd1705fe67af99..f4e54402b12791c04081ac3ef30093beb149cbc4 100644
|
| --- a/tools/parser-shell.cc
|
| +++ b/tools/parser-shell.cc
|
| @@ -45,16 +45,6 @@
|
|
|
| using namespace v8::internal;
|
|
|
| -class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
|
| - public:
|
| - virtual void* Allocate(size_t length) {
|
| - void* data = AllocateUninitialized(length);
|
| - return data == NULL ? data : memset(data, 0, length);
|
| - }
|
| - virtual void* AllocateUninitialized(size_t length) { return malloc(length); }
|
| - virtual void Free(void* data, size_t) { free(data); }
|
| -};
|
| -
|
| class StringResource8 : public v8::String::ExternalOneByteStringResource {
|
| public:
|
| StringResource8(const char* data, int length)
|
| @@ -168,9 +158,9 @@ int main(int argc, char* argv[]) {
|
| fnames.push_back(std::string(argv[i]));
|
| }
|
| }
|
| - ArrayBufferAllocator array_buffer_allocator;
|
| v8::Isolate::CreateParams create_params;
|
| - create_params.array_buffer_allocator = &array_buffer_allocator;
|
| + create_params.array_buffer_allocator =
|
| + v8::ArrayBuffer::Allocator::NewDefaultAllocator();
|
| v8::Isolate* isolate = v8::Isolate::New(create_params);
|
| {
|
| v8::Isolate::Scope isolate_scope(isolate);
|
| @@ -199,5 +189,6 @@ int main(int argc, char* argv[]) {
|
| v8::V8::Dispose();
|
| v8::V8::ShutdownPlatform();
|
| delete platform;
|
| + delete create_params.array_buffer_allocator;
|
| return 0;
|
| }
|
|
|