5#ifndef INCLUDE_V8_ARRAY_BUFFER_H_
6#define INCLUDE_V8_ARRAY_BUFFER_H_
18class SharedArrayBuffer;
20#ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
22#define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2
83 void operator delete(
void* ptr) { ::operator
delete(ptr); }
91 "Reallocate is unsafe, please do not use. Please allocate a new "
92 "BackingStore and copy instead.")
114 static
void EmptyDeleter(
void* data,
size_t length,
void* deleter_data);
124#if !defined(V8_IMMINENT_DEPRECATION_WARNINGS)
171 virtual void Free(
void* data,
size_t length) = 0;
186 "Reallocate is unsafe, please do not use. Please allocate new memory "
188 virtual
void* Reallocate(
void* data,
size_t old_length,
size_t new_length);
240 std::shared_ptr<BackingStore> backing_store);
278 size_t byte_length,
size_t max_byte_length);
297 "Use the version which takes a key parameter (passing a null handle is "
331 bool IsResizableByUserJavaScript() const;
340#ifdef V8_ENABLE_CHECKS
351 static void CheckCast(
Value* obj);
354#ifndef V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT
356#define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT 2
396#ifdef V8_ENABLE_CHECKS
402 static const int kInternalFieldCount =
404 static const int kEmbedderFieldCount =
409 static void CheckCast(
Value* obj);
418 size_t byte_offset,
size_t length);
420 size_t byte_offset,
size_t length);
422#ifdef V8_ENABLE_CHECKS
425 return static_cast<DataView*
>(value);
430 static void CheckCast(
Value* obj);
469 Isolate* isolate, std::shared_ptr<BackingStore> backing_store);
509#ifdef V8_ENABLE_CHECKS
519 static void CheckCast(
Value* obj);
Definition: v8-array-buffer.h:363
static ArrayBufferView * Cast(Value *value)
Definition: v8-array-buffer.h:395
Local< ArrayBuffer > Buffer()
size_t CopyContents(void *dest, size_t byte_length)
Definition: v8-array-buffer.h:151
virtual ~Allocator()=default
virtual void Free(void *data, size_t length)=0
static Allocator * NewDefaultAllocator()
virtual void * AllocateUninitialized(size_t length)=0
AllocationMode
Definition: v8-array-buffer.h:195
virtual void * Allocate(size_t length)=0
Definition: v8-array-buffer.h:134
static std::unique_ptr< BackingStore > NewBackingStore(void *data, size_t byte_length, v8::BackingStore::DeleterCallback deleter, void *deleter_data)
size_t MaxByteLength() const
static std::unique_ptr< BackingStore > NewResizableBackingStore(size_t byte_length, size_t max_byte_length)
static Local< ArrayBuffer > New(Isolate *isolate, std::shared_ptr< BackingStore > backing_store)
static Local< ArrayBuffer > New(Isolate *isolate, size_t byte_length)
bool IsDetachable() const
static std::unique_ptr< BackingStore > NewBackingStore(Isolate *isolate, size_t byte_length)
size_t ByteLength() const
Definition: v8-array-buffer.h:40
size_t MaxByteLength() const
size_t ByteLength() const
void(*)(void *data, size_t length, void *deleter_data) DeleterCallback
Definition: v8-array-buffer.h:103
bool IsResizableByUserJavaScript() const
Definition: v8-array-buffer.h:415
static Local< DataView > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static DataView * Cast(Value *value)
Definition: v8-array-buffer.h:421
static Local< DataView > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
Definition: v8-isolate.h:210
Definition: v8-local-handle.h:258
Definition: v8-maybe.h:32
Definition: v8-object.h:238
Definition: v8-array-buffer.h:436
static Local< SharedArrayBuffer > New(Isolate *isolate, std::shared_ptr< BackingStore > backing_store)
std::shared_ptr< BackingStore > GetBackingStore()
static std::unique_ptr< BackingStore > NewBackingStore(void *data, size_t byte_length, v8::BackingStore::DeleterCallback deleter, void *deleter_data)
size_t ByteLength() const
size_t MaxByteLength() const
static std::unique_ptr< BackingStore > NewBackingStore(Isolate *isolate, size_t byte_length)
static SharedArrayBuffer * Cast(Value *value)
Definition: v8-array-buffer.h:508
static Local< SharedArrayBuffer > New(Isolate *isolate, size_t byte_length)
Definition: v8-value.h:32
Definition: v8-internal.h:1204
Definition: libplatform.h:15
void(*)(void *data, size_t length, void *deleter_data) BackingStoreDeleterCallback
Definition: v8-array-buffer.h:127
ArrayBufferCreationMode
Definition: v8-array-buffer.h:25
#define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
Definition: v8-array-buffer.h:22
#define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT
Definition: v8-array-buffer.h:356
#define V8_EXPORT
Definition: v8config.h:762
#define V8_INLINE
Definition: v8config.h:477
#define V8_DEPRECATE_SOON(message)
Definition: v8config.h:580
#define V8_DEPRECATED(message)
Definition: v8config.h:572
#define V8_WARN_UNUSED_RESULT
Definition: v8config.h:637