Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::IO::IStreamerTypes::DefaultRequestMemoryAllocator Class Referencefinal

#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
 

Detailed Description

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.

Member Function Documentation

◆ Allocate()

RequestMemoryAllocatorResult AZ::IO::IStreamerTypes::DefaultRequestMemoryAllocator::Allocate ( u64  minimalSize,
u64  recommendeSize,
size_t  alignment 
)
overridevirtual

Allocate memory for a request.

Parameters
minimalSizeThe minimal amount of memory to reserve. More can be reserved, but not less.
recommendedSizeThe recommended amount of memory to reserve. If this size or more is reserved temporary buffers can be avoided.
alignmentThe 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.
Returns
A description of the allocated memory. If allocation fails, return a size of 0 and a null pointer for the address.

Implements AZ::IO::IStreamerTypes::RequestMemoryAllocator.

◆ LockAllocator()

void AZ::IO::IStreamerTypes::DefaultRequestMemoryAllocator::LockAllocator ( )
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.

◆ Release()

void AZ::IO::IStreamerTypes::DefaultRequestMemoryAllocator::Release ( void *  address)
overridevirtual

Releases memory previously allocated by Allocate.

Parameters
addressThe address previously provided by Allocate.

Implements AZ::IO::IStreamerTypes::RequestMemoryAllocator.

◆ UnlockAllocator()

void AZ::IO::IStreamerTypes::DefaultRequestMemoryAllocator::UnlockAllocator ( )
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.


The documentation for this class was generated from the following file: