#include <IAllocator.h>
Inherited by AZ::ChildAllocatorSchema< AZ::OSAllocator >, AZ::HphaSchemaBase< Internal::HphaDebugAllocator >, AZ::AllocatorBase, AZ::AllocatorGlobalWrapper< Allocator >, AZ::AllocatorPointerWrapper, AZ::ChildAllocatorSchema< ParentAllocator >, AZ::HphaSchemaBase< DebugAllocator >, AZ::IAllocatorWithTracking, AZ::PoolSchema, and AZ::ThreadPoolSchema.
Public Member Functions | |
AZ_RTTI (IAllocator, "{0A3C59AE-169C-45F6-9423-3B8C89245E2E}") | |
IAllocator (const IAllocator &)=delete | |
IAllocator (IAllocator &&)=delete | |
IAllocator & | operator= (const IAllocator &)=delete |
IAllocator & | operator= (IAllocator &&)=delete |
virtual pointer | allocate (size_type byteSize, align_type alignment=1)=0 |
virtual void | deallocate (pointer ptr, size_type byteSize=0, align_type alignment=0)=0 |
virtual pointer | reallocate (pointer ptr, size_type newSize, align_type newAlignment=1)=0 |
virtual size_type | max_size () const |
virtual size_type | get_allocated_size (pointer ptr, align_type alignment=1) const =0 |
virtual void | GarbageCollect () |
const char * | GetName () 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. | |
virtual size_type | NumAllocatedBytes () const |
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. | |
virtual const Debug::AllocationRecords * | GetRecords () const |
Returns a pointer to the allocation records. They might be available or not depending on the build type. Debug::AllocationRecords. | |
Debug::AllocationRecords * | GetRecords () |
virtual void | SetRecords (Debug::AllocationRecords *records) |
Sets the allocation records. | |
virtual bool | IsReady () const |
Returns true if this allocator is ready to use. | |
virtual void | SetProfilingActive (bool active) |
virtual bool | IsProfilingActive () const |
Returns true if profiling calls will be made. | |
Public Attributes | |
size_type | newSize |
Protected Member Functions | |
virtual void | PostCreate () |
All conforming allocators must call PostCreate() after their custom Create() method in order to be properly registered. | |
virtual void | PreDestroy () |
All conforming allocators must call PreDestroy() before their custom Destroy() method in order to be properly deregistered. | |
virtual void | Destroy () |
All allocators must provide their deinitialization routine here. | |
Friends | |
class | AllocatorManager |
template<class Allocator > | |
class | AllocatorWrapper |
Allocator interface base class
AZ::IAllocator::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" | |||
) |
Resize an allocated memory block. Returns the new adjusted size (as close as possible or equal to the requested one) or 0 (if you don't support resize at all).
|
inline |
Returns the capacity of the Allocator in bytes. If the return value is 0 the Capacity is undefined (usually depends on another allocator)
|
inlineprotectedvirtual |
All allocators must provide their deinitialization routine here.
Reimplemented in AZ::OSAllocator.
|
inlinevirtual |
|
inlinevirtual |
Returns the debug configuration for this allocator.
Reimplemented in AZ::OSAllocator, AZ::PoolAllocator, AZ::ThreadPoolAllocator, AZ::SimpleSchemaAllocator< Schema, ProfileAllocations, ReportOutOfMemory >, AZ::SimpleSchemaAllocator< Schema, true, false >, AZ::SimpleSchemaAllocator< PoolSchema, true, false >, and AZ::SystemAllocator.
|
inlinevirtual |
Returns a pointer to the allocation records. They might be available or not depending on the build type. Debug::AllocationRecords.
Reimplemented in AZ::AllocatorBase, and AZ::AllocatorBase.
|
inline |
Returns memory allocated by the allocator and available to the user for allocations. IMPORTANT: this is not the overhead memory this is just the memory that is allocated, but not used. Example: the pool allocators allocate in chunks. So we might be using one elements in that chunk and the rest is free/unallocated. This is the memory that will be reported.
|
inlinevirtual |
Returns true if profiling calls will be made.
Reimplemented in AZ::AllocatorBase.
|
inlinevirtual |
Returns true if this allocator is ready to use.
Reimplemented in AZ::AllocatorBase.
|
inlineprotectedvirtual |
All conforming allocators must call PostCreate() after their custom Create() method in order to be properly registered.
Reimplemented in AZ::AllocatorBase.
|
inlineprotectedvirtual |
All conforming allocators must call PreDestroy() before their custom Destroy() method in order to be properly deregistered.
Reimplemented in AZ::AllocatorBase.
|
inline |
Realloc an allocate memory memory block. Similar to Resize except it will move the memory block if needed. Return NULL if realloc is not supported or run out of memory.
|
inlinevirtual |
Sets whether profiling calls should be made. This is primarily a performance compromise, as the profiling calls go out on an EBus that may not exist if not activated, and will result in an expensive hash lookup if that is the case.
Reimplemented in AZ::AllocatorBase.
|
inlinevirtual |
Sets the allocation records.
Reimplemented in AZ::AllocatorBase.
size_type AZ::IAllocator::newSize |