v8
3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
|
#include <v8.h>
Data Structures | |
class | Allocator |
class | Contents |
Static Public Member Functions | |
static Local< ArrayBuffer > | New (Isolate *isolate, size_t byte_length) |
static Local< ArrayBuffer > | New (Isolate *isolate, void *data, size_t byte_length) |
static V8_INLINE ArrayBuffer * | Cast (Value *obj) |
Static Public Member Functions inherited from Object | |
static V8_INLINE int | InternalFieldCount (const PersistentBase< Object > &object) |
static V8_INLINE void * | GetAlignedPointerFromInternalField (const PersistentBase< Object > &object, int index) |
static Local< Object > | New (Isolate *isolate) |
static V8_INLINE Object * | Cast (Value *obj) |
Static Public Member Functions inherited from Value | |
template<class T > | |
static V8_INLINE Value * | Cast (T *value) |
Static Public Attributes | |
static const int | kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT |
An instance of the built-in ArrayBuffer constructor (ES6 draft 15.13.5). This API is experimental and may change significantly.
size_t ByteLength | ( | ) | const |
Data length in bytes.
Definition at line 5988 of file api.cc.
References Utils::OpenHandle().
Referenced by TEST(), and THREADED_TEST().
|
static |
v8::ArrayBuffer::Contents Externalize | ( | ) |
Make this ArrayBuffer external. The pointer to underlying memory block and byte length are returned as |Contents| structure. After ArrayBuffer had been etxrenalized, it does no longer owns the memory block. The caller should take steps to free memory when it is no longer needed.
The memory block is guaranteed to be allocated with |Allocator::Allocate| that has been set with V8::SetArrayBufferAllocator.
Definition at line 5962 of file api.cc.
References Utils::ApiCheck(), and Utils::OpenHandle().
Referenced by FreeBufferExtension::FreeBuffer(), TEST(), and THREADED_TEST().
bool IsExternal | ( | ) | const |
Returns true if ArrayBuffer is extrenalized, that is, does not own its memory block.
Definition at line 5957 of file api.cc.
References Utils::OpenHandle().
Referenced by TEST().
void Neuter | ( | ) |
Neuters this ArrayBuffer and all its views (typed arrays). Neutering sets the byte length of the buffer and all typed arrays to zero, preventing JavaScript from ever accessing underlying backing store. ArrayBuffer should have been externalized.
Definition at line 5976 of file api.cc.
References Utils::ApiCheck(), ENTER_V8, LOG_API, Runtime::NeuterArrayBuffer(), and Utils::OpenHandle().
Referenced by THREADED_TEST().
|
static |
Create a new ArrayBuffer. Allocate |byte_length| bytes. Allocated memory will be owned by a created ArrayBuffer and will be deallocated when it is garbage-collected, unless the object is externalized.
Definition at line 5994 of file api.cc.
References ENTER_V8, Isolate::factory(), LOG_API, Factory::NewJSArrayBuffer(), Runtime::SetupArrayBufferAllocatingData(), and Utils::ToLocal().
Referenced by Shell::ReadBuffer(), TEST(), TestViewFromApi(), THREADED_TEST(), and TypedArrayTestHelper().
|
static |
Create a new ArrayBuffer over an existing memory block. The created array buffer is immediately in externalized state. The memory block will not be reclaimed when a created ArrayBuffer is garbage-collected.
Definition at line 6006 of file api.cc.
References ENTER_V8, Isolate::factory(), LOG_API, Factory::NewJSArrayBuffer(), Runtime::SetupArrayBuffer(), and Utils::ToLocal().
|
static |
Definition at line 2840 of file v8.h.
Referenced by Runtime::SetupArrayBuffer().