#include <PoolAllocator.h>
Inherits AZ::ThreadPoolSchema.
Static Protected Member Functions | |
| static ThreadPoolData * | GetThreadPoolData () |
| static void | SetThreadPoolData (ThreadPoolData *data) |
Static Protected Attributes | |
| static AZ_THREAD_LOCAL ThreadPoolData * | m_threadData = 0 |
Additional Inherited Members | |
Public Types inherited from AZ::ThreadPoolSchema | |
| typedef ThreadPoolData *(* | GetThreadPoolData) () |
| typedef void(* | SetThreadPoolData) (ThreadPoolData *) |
Public Member Functions inherited from AZ::ThreadPoolSchema | |
| ThreadPoolSchema (GetThreadPoolData getThreadPoolData, SetThreadPoolData setThreadPoolData) | |
| bool | Create () |
| bool | Create (PoolSchema::size_type pageSize, PoolSchema::size_type minAllocationSize, PoolSchema::size_type maxAllocationSize) |
| AllocateAddress | allocate (size_type byteSize, size_type alignment) override |
| size_type | deallocate (pointer ptr, size_type byteSize, size_type alignment) 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 |
| Return unused memory to the OS. Don't call this too often because you will force unnecessary allocations. | |
| size_type | NumAllocatedBytes () const override |
Public Member Functions inherited from AZ::IAllocator | |
| 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 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 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. | |
| 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 inherited from AZ::IAllocator | |
| size_type | newSize |
Protected Member Functions inherited from AZ::ThreadPoolSchema | |
| ThreadPoolSchema (const ThreadPoolSchema &) | |
| ThreadPoolSchema & | operator= (const ThreadPoolSchema &) |
Protected Member Functions inherited from AZ::IAllocator | |
| 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. | |
Protected Attributes inherited from AZ::ThreadPoolSchema | |
| GetThreadPoolData | m_threadPoolGetter |
| SetThreadPoolData | m_threadPoolSetter |
| class ThreadPoolSchemaImpl * | m_impl |
Helper class to allow multiple instances of ThreadPool that can operate independent from each other. Your thread pool allocator should inherit from that class.