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 v8::Isolate* isolate, std::unique_ptr<BackingStore> backing_store,
111 static void EmptyDeleter(
void* data,
size_t length,
void* deleter_data);
121#if !defined(V8_IMMINENT_DEPRECATION_WARNINGS)
168 virtual void Free(
void* data,
size_t length) = 0;
182 virtual void*
Reallocate(
void* data,
size_t old_length,
size_t new_length);
234 std::shared_ptr<BackingStore> backing_store);
272 size_t byte_length,
size_t max_byte_length);
291 "Use the version which takes a key parameter (passing a null handle is "
325 bool IsResizableByUserJavaScript() const;
334#ifdef V8_ENABLE_CHECKS
345 static void CheckCast(
Value* obj);
348#ifndef V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT
350#define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT 2
390#ifdef V8_ENABLE_CHECKS
396 static const int kInternalFieldCount =
398 static const int kEmbedderFieldCount =
403 static void CheckCast(
Value* obj);
412 size_t byte_offset,
size_t length);
414 size_t byte_offset,
size_t length);
416#ifdef V8_ENABLE_CHECKS
419 return static_cast<DataView*
>(value);
424 static void CheckCast(
Value* obj);
463 Isolate* isolate, std::shared_ptr<BackingStore> backing_store);
503#ifdef V8_ENABLE_CHECKS
513 static void CheckCast(
Value* obj);
static Allocator * NewDefaultAllocator()
virtual void * Reallocate(void *data, size_t old_length, size_t new_length)
virtual void * AllocateUninitialized(size_t length)=0
virtual ~Allocator()=default
virtual void Free(void *data, size_t length)=0
virtual void * Allocate(size_t length)=0
static Local< ArrayBuffer > New(Isolate *isolate, std::shared_ptr< BackingStore > backing_store)
size_t MaxByteLength() const
static std::unique_ptr< BackingStore > NewBackingStore(void *data, size_t byte_length, v8::BackingStore::DeleterCallback deleter, void *deleter_data)
bool IsDetachable() const
V8_DEPRECATE_SOON("Use the version which takes a key parameter (passing a null handle is " "ok).") void Detach()
static Local< ArrayBuffer > New(Isolate *isolate, size_t byte_length)
size_t ByteLength() const
static std::unique_ptr< BackingStore > NewBackingStore(Isolate *isolate, size_t byte_length)
static std::unique_ptr< BackingStore > NewResizableBackingStore(size_t byte_length, size_t max_byte_length)
Local< ArrayBuffer > Buffer()
size_t CopyContents(void *dest, size_t byte_length)
static V8_INLINE ArrayBufferView * Cast(Value *value)
void(*)(void *data, size_t length, void *deleter_data) DeleterCallback
size_t MaxByteLength() const
static void EmptyDeleter(void *data, size_t length, void *deleter_data)
static std::unique_ptr< BackingStore > Reallocate(v8::Isolate *isolate, std::unique_ptr< BackingStore > backing_store, size_t byte_length)
size_t ByteLength() const
bool IsResizableByUserJavaScript() const
static Local< DataView > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static V8_INLINE DataView * Cast(Value *value)
static Local< DataView > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static Local< SharedArrayBuffer > New(Isolate *isolate, std::shared_ptr< BackingStore > backing_store)
size_t MaxByteLength() const
static std::unique_ptr< BackingStore > NewBackingStore(void *data, size_t byte_length, v8::BackingStore::DeleterCallback deleter, void *deleter_data)
static V8_INLINE SharedArrayBuffer * Cast(Value *value)
std::shared_ptr< BackingStore > GetBackingStore()
size_t ByteLength() const
static std::unique_ptr< BackingStore > NewBackingStore(Isolate *isolate, size_t byte_length)
static Local< SharedArrayBuffer > New(Isolate *isolate, size_t byte_length)
void(*)(void *data, size_t length, void *deleter_data) BackingStoreDeleterCallback
#define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
#define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT
#define V8_WARN_UNUSED_RESULT