#include <LinearAllocator.h>
Inherits AZ::RHI::Allocator.
Classes | |
struct | Descriptor |
Public Member Functions | |
AZ_CLASS_ALLOCATOR (LinearAllocator, AZ::SystemAllocator) | |
void | Init (const Descriptor &descriptor) |
void | Shutdown () override |
VirtualAddress | Allocate (size_t byteCount, size_t byteAlignment) override |
void | DeAllocate (VirtualAddress allocation) override |
void | GarbageCollect () override |
void | GarbageCollectForce () override |
Forces garbage collection of all allocations, regardless of the GC latency. | |
size_t | GetAllocatedByteCount () const override |
const Descriptor & | GetDescriptor () const override |
Returns the descriptor used to initialize the allocator. | |
void | SetBaseAddress (VirtualAddress address) |
Public Member Functions inherited from AZ::RHI::Allocator | |
virtual void | Shutdown ()=0 |
virtual VirtualAddress | Allocate (size_t byteCount, size_t byteAlignment)=0 |
virtual void | DeAllocate (VirtualAddress offset)=0 |
virtual void | GarbageCollect ()=0 |
virtual void | GarbageCollectForce ()=0 |
Forces garbage collection of all allocations, regardless of the GC latency. | |
virtual size_t | GetAllocationCount () const |
virtual size_t | GetAllocatedByteCount () const |
virtual const Descriptor & | GetDescriptor () const =0 |
Returns the descriptor used to initialize the allocator. | |
virtual float | ComputeFragmentation () const |
virtual void | Clone (RHI::Allocator *newAllocator) |
Clone the current allocator to the new allocator passed in. | |
template<typename T > | |
T * | AllocateAs (size_t byteCount, size_t byteAlignment) |
A linear allocator where each allocation is a simple increment to the cursor. Garbage collection controls when the cursor resets back to the beginning.
|
overridevirtual |
Allocates a virtual address relative to the base address provided at initialization time.
byteCount | The number of bytes to allocate. |
byteAlignement | The alignment used to align the allocation. |
Implements AZ::RHI::Allocator.
|
overridevirtual |
Deallocates an allocation. The memory is not reclaimed until garbage collect is called. Depending on the garbage collection latency, it may take several garbage collection cycles before the memory is reclaimed.
Implements AZ::RHI::Allocator.
|
overridevirtual |
Allocations are deferred-released until a specific number of GC cycles have occurred. This is useful for allocations actively being consumed by the GPU.
Implements AZ::RHI::Allocator.
|
overridevirtual |
Forces garbage collection of all allocations, regardless of the GC latency.
Implements AZ::RHI::Allocator.
|
overridevirtual |
Returns the number of bytes used by the allocator. This includes allocations that are pending garbage collection.
Reimplemented from AZ::RHI::Allocator.
|
overridevirtual |
Returns the descriptor used to initialize the allocator.
Implements AZ::RHI::Allocator.
|
overridevirtual |
Implements AZ::RHI::Allocator.