v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ArrayBuffer::Allocator Class Referenceabstract

#include <v8.h>

Inheritance diagram for ArrayBuffer::Allocator:

Public Member Functions

virtual ~Allocator ()
 
virtual void * Allocate (size_t length)=0
 
virtual void * AllocateUninitialized (size_t length)=0
 
virtual void Free (void *data, size_t length)=0
 

Detailed Description

Allocator that V8 uses to allocate |ArrayBuffer|'s memory. The allocator is a global V8 setting. It should be set with V8::SetArrayBufferAllocator prior to creation of a first ArrayBuffer.

This API is experimental and may change significantly.

Definition at line 2744 of file v8.h.

Constructor & Destructor Documentation

virtual ~Allocator ( )
inlinevirtual

Definition at line 2746 of file v8.h.

Member Function Documentation

virtual void* Allocate ( size_t  length)
pure virtual

Allocate |length| bytes. Return NULL if allocation is not successful. Memory should be initialized to zeroes.

Implemented in MockArrayBufferAllocator, and ShellArrayBufferAllocator.

Referenced by Runtime::SetupArrayBufferAllocatingData().

virtual void* AllocateUninitialized ( size_t  length)
pure virtual

Allocate |length| bytes. Return NULL if allocation is not successful. Memory does not have to be initialized.

Implemented in MockArrayBufferAllocator, and ShellArrayBufferAllocator.

Referenced by Runtime::SetupArrayBufferAllocatingData().

virtual void Free ( void *  data,
size_t  length 
)
pure virtual

Free the memory block of size |length|, pointed to by |data|. That memory is guaranteed to be previously allocated by |Allocate|.

Implemented in MockArrayBufferAllocator, and ShellArrayBufferAllocator.

Referenced by Runtime::FreeArrayBuffer(), FreeBufferExtension::FreeBuffer(), and v8::internal::RUNTIME_FUNCTION().


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