V8 Project
v8::internal::FreeBufferExtension Class Reference

#include <free-buffer-extension.h>

+ Inheritance diagram for v8::internal::FreeBufferExtension:
+ Collaboration diagram for v8::internal::FreeBufferExtension:

Public Member Functions

 FreeBufferExtension ()
 
virtual v8::Handle< v8::FunctionTemplateGetNativeFunctionTemplate (v8::Isolate *isolate, v8::Handle< v8::String > name)
 
- Public Member Functions inherited from v8::Extension
 Extension (const char *name, const char *source=0, int dep_count=0, const char **deps=0, int source_length=-1)
 
virtual ~Extension ()
 
const char * name () const
 
size_t source_length () const
 
const String::ExternalOneByteStringResourcesource () const
 
int dependency_count ()
 
const char ** dependencies ()
 
void set_auto_enable (bool value)
 
bool auto_enable ()
 

Static Public Member Functions

static void FreeBuffer (const v8::FunctionCallbackInfo< v8::Value > &args)
 

Detailed Description

Definition at line 13 of file free-buffer-extension.h.

Constructor & Destructor Documentation

◆ FreeBufferExtension()

v8::internal::FreeBufferExtension::FreeBufferExtension ( )
inline

Definition at line 15 of file free-buffer-extension.h.

16  : v8::Extension("v8/free-buffer", "native function freeBuffer();") {}
Ignore.
Definition: v8.h:4008

Member Function Documentation

◆ FreeBuffer()

void v8::internal::FreeBufferExtension::FreeBuffer ( const v8::FunctionCallbackInfo< v8::Value > &  args)
static

Definition at line 21 of file free-buffer-extension.cc.

22  {
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 }
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
An object reference managed by the v8 garbage collector.
Definition: v8.h:198
static v8::ArrayBuffer::Allocator * ArrayBufferAllocator()
Definition: v8.h:72

References v8::internal::V8::ArrayBufferAllocator(), and v8::ArrayBuffer::Allocator::Free().

Referenced by GetNativeFunctionTemplate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNativeFunctionTemplate()

v8::Handle< v8::FunctionTemplate > v8::internal::FreeBufferExtension::GetNativeFunctionTemplate ( v8::Isolate isolate,
v8::Handle< v8::String name 
)
virtual

Reimplemented from v8::Extension.

Definition at line 14 of file free-buffer-extension.cc.

16  {
18 }
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
static void FreeBuffer(const v8::FunctionCallbackInfo< v8::Value > &args)

References FreeBuffer(), and v8::FunctionTemplate::New().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: