#include <IStreamerTypes.h>
Inherits AZ::IO::IStreamerTypes::RequestMemoryAllocator.
Public Member Functions | |
DefaultRequestMemoryAllocator () | |
DefaultRequestMemoryAllocator wraps around the AZ::SystemAllocator by default. | |
DefaultRequestMemoryAllocator (AZ::IAllocator &allocator) | |
void | LockAllocator () override |
Called when the Streamer is about to start allocating memory for a request. This will be called multiple times. | |
void | UnlockAllocator () override |
RequestMemoryAllocatorResult | Allocate (u64 minimalSize, u64 recommendeSize, size_t alignment) override |
void | Release (void *address) override |
int | GetNumLocks () const |
virtual void | LockAllocator ()=0 |
Called when the Streamer is about to start allocating memory for a request. This will be called multiple times. | |
virtual void | UnlockAllocator ()=0 |
virtual RequestMemoryAllocatorResult | Allocate (u64 minimalSize, u64 recommendeSize, size_t alignment)=0 |
virtual void | Release (void *address)=0 |
Default memory allocator for file requests. This allocator is a wrapper around the standard memory allocator and can be used if only delayed memory allocations are needed but no special memory requirements.
|
overridevirtual |
Allocate memory for a request.
minimalSize | The minimal amount of memory to reserve. More can be reserved, but not less. |
recommendedSize | The recommended amount of memory to reserve. If this size or more is reserved temporary buffers can be avoided. |
alignment | The minimal recommended memory alignment. If the alignment is less than the recommendation it may force the Streamer to create temporary buffers and do extra processing. |
Implements AZ::IO::IStreamerTypes::RequestMemoryAllocator.
|
overridevirtual |
Called when the Streamer is about to start allocating memory for a request. This will be called multiple times.
Implements AZ::IO::IStreamerTypes::RequestMemoryAllocator.
|
overridevirtual |
Releases memory previously allocated by Allocate.
address | The address previously provided by Allocate. |
Implements AZ::IO::IStreamerTypes::RequestMemoryAllocator.
|
overridevirtual |
Called when the Streamer no longer needs to manage memory for a request. This will be called multiple times. If the number of unlocks matches the number of locks it means the memory allocator is not actively being used by the Streamer.
Implements AZ::IO::IStreamerTypes::RequestMemoryAllocator.