Skip to content

LiteFX::Rendering::VirtualAllocator::allocate

Allocates a piece of memory of size bytes, aligned to alignment.

Synopsis

Declared in <litefx/rendering_api.hpp>

[[dllimport, nodiscard, dllexport]] Allocation allocate(
    UInt64 size,
    UInt32 alignment = 1u,
    AllocationStrategy strategy = AllocationStrategy::OptimizePacking,
    void* privateData = nullptr) const;

Return Value

An object that contains details about the allocation.

Note

The return value should not be discarded.

Parameters

NameDescription
sizeThe size (in bytes) of the resource to place in the allocation.
alignmentThe alignment requirements of the resource.
strategyThe strategy to look for a place to put the allocation in.
privateDataA pointer to an object that should be internally associated with the allocation.