#[repr(C)]pub struct Allocator(_);
Expand description
A thread-safe allocator that V8 uses to allocate |ArrayBuffer|’s memory. The allocator is a global V8 setting. It has to be set via Isolate::CreateParams.
Memory allocated through this allocator by V8 is accounted for as external memory by V8. Note that V8 keeps track of the memory for all internalized |ArrayBuffer|s. Responsibility for tracking external memory (using Isolate::AdjustAmountOfExternalAllocatedMemory) is handed over to the embedder upon externalization and taken over upon internalization (creating an internalized buffer from an existing buffer).
Note that it is unsafe to call back into V8 from any of the allocator functions.
This is called v8::ArrayBuffer::Allocator in C++. Rather than use the namespace array_buffer, which will contain only the Allocator we opt in Rust to allow it to live in the top level: v8::Allocator