Open 3D Engine AzCore API Reference 25.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::ChildAllocatorSchema< ParentAllocator > Class Template Reference

Inherits AZ::ChildAllocatorSchemaBase.

Public Types

using Parent = ParentAllocator
 

Public Member Functions

 AZ_RTTI ((ChildAllocatorSchema, "{2A28BEF4-278A-4A98-AC7D-5C1D6D190A36}", ParentAllocator), ChildAllocatorSchemaBase)
 
 ChildAllocatorSchema ()
 
 ChildAllocatorSchema (bool enableProfiling)
 
 ChildAllocatorSchema (bool enableProfiling, bool skipRegistration)
 
 ~ChildAllocatorSchema () override
 
AllocateAddress allocate (size_type byteSize, size_type alignment) override
 
size_type deallocate (pointer ptr, size_type byteSize=0, size_type alignment=0) override
 
AllocateAddress reallocate (pointer ptr, size_type newSize, size_type newAlignment) override
 
size_type get_allocated_size (pointer ptr, align_type alignment) const override
 
void GarbageCollect () override
 
size_type NumAllocatedBytes () const override
 
IAllocatorGetParentAllocator () const override
 
- Public Member Functions inherited from AZ::ChildAllocatorSchemaBase
 AZ_RTTI (ChildAllocatorSchemaBase, "{AF5C2C64-EED4-4BF7-BBD9-3328A81BBC00}", AllocatorBase)
 
 AllocatorBase ()
 
 AllocatorBase (bool enableProfiling)
 
- Public Member Functions inherited from AZ::AllocatorBase
const Debug::AllocationRecordsGetRecords () const override
 Returns a pointer to the allocation records. They might be available or not depending on the build type. Debug::AllocationRecords.
 
void SetRecords (Debug::AllocationRecords *records) final
 Sets the allocation records.
 
bool IsReady () const final
 Returns true if this allocator is ready to use.
 
void PostCreate () override
 All conforming allocators must call PostCreate() after their custom Create() method in order to be properly registered.
 
void PreDestroy () final
 All conforming allocators must call PreDestroy() before their custom Destroy() method in order to be properly deregistered.
 
void SetProfilingActive (bool active) final
 
bool IsProfilingActive () const final
 Returns true if profiling calls will be made.
 
virtual const Debug::AllocationRecordsGetRecords () const
 Returns a pointer to the allocation records. They might be available or not depending on the build type. Debug::AllocationRecords.
 
Debug::AllocationRecordsGetRecords ()
 
- Public Member Functions inherited from AZ::IAllocator
 AZ_RTTI (IAllocator, "{0A3C59AE-169C-45F6-9423-3B8C89245E2E}")
 
 IAllocator (const IAllocator &)=delete
 
 IAllocator (IAllocator &&)=delete
 
IAllocatoroperator= (const IAllocator &)=delete
 
IAllocatoroperator= (IAllocator &&)=delete
 
virtual AllocateAddress allocate (size_type byteSize, align_type alignment=1)=0
 Allocates memory and returns the address + the amount of memory allocated.
 
virtual size_type deallocate (pointer ptr, size_type byteSize=0, align_type alignment=0)=0
 Deallocates memory at the ptr address and returns the amount of memory that was allocated.
 
virtual AllocateAddress reallocate (pointer ptr, size_type newSize, align_type newAlignment=1)=0
 
virtual size_type max_size () const
 
virtual const charGetName () const
 
pointer Allocate (size_type byteSize, size_type alignment=1, int flags=0, const char *name=nullptr, const char *fileName=nullptr, int lineNum=0, unsigned int suppressStackRecord=0)
 
void DeAllocate (pointer ptr, size_type byteSize=0, size_type alignment=0)
 
 AZ_DEPRECATED_MESSAGE ("Resize no longer supported, use reallocate instead, note that the pointer address could change, " "Allocators should do best effort to keep the ptr at the same address") size_type Resize(pointer ptr
 
pointer ReAllocate (pointer ptr, size_type newSize, size_type newAlignment)
 
size_type AllocationSize (pointer ptr)
 Returns allocation size for given address. 0 if the address doesn't belong to the allocator.
 
size_type Capacity () const
 
size_type GetMaxAllocationSize () const
 Returns max allocation size if possible. If not returned value is 0.
 
size_type GetMaxContiguousAllocationSize () const
 Returns the maximum contiguous allocation size of a single allocation.
 
size_type GetUnAllocatedMemory (bool isPrint=false) const
 
virtual AllocatorDebugConfig GetDebugConfig ()
 Returns the debug configuration for this allocator.
 
Debug::AllocationRecordsGetRecords ()
 

Additional Inherited Members

- Public Attributes inherited from AZ::IAllocator
size_type newSize
 
- Protected Member Functions inherited from AZ::AllocatorBase
 AllocatorBase (bool enableProfiling)
 
AZ_FORCE_INLINE size_t MemorySizeAdjustedUp (size_t byteSize) const
 Returns the size of a memory allocation after adjusting for tracking.
 
AZ_FORCE_INLINE size_t MemorySizeAdjustedDown (size_t byteSize) const
 Returns the size of a memory allocation, removing any tracking overhead.
 
void DisableRegistration ()
 
void ProfileAllocation (void *ptr, size_t byteSize, size_t alignment, int suppressStackRecord)
 Records an allocation for profiling.
 
void ProfileDeallocation (void *ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo *info)
 Records a deallocation for profiling.
 
void ProfileReallocation (void *ptr, void *newPtr, size_t newSize, size_t newAlignment)
 Records a reallocation for profiling.
 
void ProfileResize (void *ptr, size_t newSize)
 Records a resize for profiling.
 
bool OnOutOfMemory (size_t byteSize, size_t alignment)
 User allocator should call this function when they run out of memory!
 
- Protected Member Functions inherited from AZ::IAllocator
virtual void Destroy ()
 All allocators must provide their deinitialization routine here.
 

Constructor & Destructor Documentation

◆ ChildAllocatorSchema() [1/3]

template<class ParentAllocator >
AZ::ChildAllocatorSchema< ParentAllocator >::ChildAllocatorSchema ( )
inline

Invoke the AllocatorBase PostCreate function to register the child schema allocator with the AZ::Allocator Manager as well as to create the Allocation Records for the ChildAllocatorSchema

◆ ChildAllocatorSchema() [2/3]

template<class ParentAllocator >
AZ::ChildAllocatorSchema< ParentAllocator >::ChildAllocatorSchema ( bool  enableProfiling)
inlineexplicit
Parameters
enableProfilingdetermines whether the allocations should be recorded in an allocation records structure

◆ ChildAllocatorSchema() [3/3]

template<class ParentAllocator >
AZ::ChildAllocatorSchema< ParentAllocator >::ChildAllocatorSchema ( bool  enableProfiling,
bool  skipRegistration 
)
inline
Parameters
enableProfilingdetermines whether the allocations should be recorded in an allocation records structure
skipRegistrationdetermines if this instance of the allocator should be registered with the allocator manager

◆ ~ChildAllocatorSchema()

Invoke the AllocatorBase PreDestroy function to deregister the child schema allocator with the AZ::Allocator Manager

Member Function Documentation

◆ GarbageCollect()

template<class ParentAllocator >
void AZ::ChildAllocatorSchema< ParentAllocator >::GarbageCollect ( )
inlineoverridevirtual

Reimplemented from AZ::IAllocator.

◆ get_allocated_size()

template<class ParentAllocator >
size_type AZ::ChildAllocatorSchema< ParentAllocator >::get_allocated_size ( pointer  ptr,
align_type  alignment 
) const
inlineoverridevirtual

Implements AZ::IAllocator.

◆ GetParentAllocator()

template<class ParentAllocator >
IAllocator * AZ::ChildAllocatorSchema< ParentAllocator >::GetParentAllocator ( ) const
inlineoverridevirtual

◆ NumAllocatedBytes()

template<class ParentAllocator >
size_type AZ::ChildAllocatorSchema< ParentAllocator >::NumAllocatedBytes ( ) const
inlineoverridevirtual

Reimplemented from AZ::IAllocator.


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