V8 Project
free-buffer-extension.cc
Go to the documentation of this file.
1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
8 #include "src/v8.h"
9 
10 namespace v8 {
11 namespace internal {
12 
13 
15  v8::Isolate* isolate,
18 }
19 
20 
23  v8::Handle<v8::ArrayBuffer> arrayBuffer = args[0].As<v8::ArrayBuffer>();
24  v8::ArrayBuffer::Contents contents = arrayBuffer->Externalize();
25  V8::ArrayBufferAllocator()->Free(contents.Data(), contents.ByteLength());
26 }
27 
28 } } // namespace v8::internal
virtual void Free(void *data, size_t length)=0
Free the memory block of size |length|, pointed to by |data|.
The contents of an |ArrayBuffer|.
Definition: v8.h:2891
An instance of the built-in ArrayBuffer constructor (ES6 draft 15.13.5).
Definition: v8.h:2850
The argument information given to function call callbacks.
Definition: v8.h:2650
static Local< FunctionTemplate > New(Isolate *isolate, FunctionCallback callback=0, Handle< Value > data=Handle< Value >(), Handle< Signature > signature=Handle< Signature >(), int length=0)
Creates a function template.
Definition: api.cc:904
An object reference managed by the v8 garbage collector.
Definition: v8.h:198
Isolate represents an isolated instance of the V8 engine.
Definition: v8.h:4356
virtual v8::Handle< v8::FunctionTemplate > GetNativeFunctionTemplate(v8::Isolate *isolate, v8::Handle< v8::String > name)
static void FreeBuffer(const v8::FunctionCallbackInfo< v8::Value > &args)
static v8::ArrayBuffer::Allocator * ArrayBufferAllocator()
Definition: v8.h:72
Debugger support for the V8 JavaScript engine.
Definition: accessors.cc:20