Skip to content

LiteFX::Rendering::VirtualAllocator

Represents a virtual allocator that manages memory distribution from a piece of raw memory.

Synopsis

Declared in <litefx/rendering_api.hpp>

class [[dllimport, dllexport]] VirtualAllocator final

Description

Note that the virtual allocator does not actually contain memory, but rather keeps track over a range of memory that is externally managed.

Types

NameDescription
Allocation Represents an allocation within the memory managed by the virtual allocator.

Member Functions

NameDescription
VirtualAllocator [constructor]Constructors
~VirtualAllocator [destructor]Destructor
operator= Assignment operators
algorithm Returns the algorithm used by the allocator.
allocate Allocates a piece of memory of size bytes, aligned to alignment.
free Releases an allocation from the allocator, so that its memory can be re-used later.
privateData Returns the private data associated with an allocation.
size Returns the size of the memory managed by the virtual allocator.
tryAllocate Attempts to allocate a piece of memory of size bytes, aligned to alignment. If the allocation fails std::nullopt is returned.

Static Member Functions

NameDescription
create Creates a new virtual allocator instance.