![]() |
XII Release 0.1.0
|
Copyright (c) Theophilus Eriata. All Rights Reserved. More...
#include <LinearAllocator.h>
Public Member Functions | |
| xiiLinearAllocator (xiiStringView sName, xiiAllocator *pParent, xiiUInt32 uiInitialSize) | |
| Copyright (c) Theophilus Eriata. All Rights Reserved. | |
| virtual void * | Allocate (size_t uiSize, size_t uiAlign, xiiMemoryUtils::DestructorFunction destructorFunc) override |
| virtual void | Deallocate (void *pPtr) override |
| void | Reset () |
| Public Member Functions inherited from xiiAllocatorWithPolicy< xiiAllocationPolicyLinear< false >, xiiAllocatorTrackingMode::Default > | |
| xiiAllocatorWithPolicy (xiiStringView sName, xiiAllocator *pParent=nullptr) | |
| Public Member Functions inherited from xiiInternal::xiiAllocatorMixinReallocate< xiiAllocationPolicyLinear< false >, TrackingMode, xiiHasReallocate< xiiAllocationPolicyLinear< false >, void *(xiiAllocationPolicyLinear< false >::*)(void *, size_t, size_t, size_t)>::value > | |
| xiiAllocatorMixinReallocate (xiiStringView sName, xiiAllocator *pParent) | |
| Public Member Functions inherited from xiiInternal::xiiAllocatorImpl< xiiAllocationPolicyLinear< false >, TrackingMode > | |
| xiiAllocatorImpl (xiiStringView sName, xiiAllocator *pParent) | |
| virtual size_t | AllocatedSize (const void *pPtr) override |
| virtual xiiAllocatorId | GetId () const override |
| virtual Stats | GetStats () const override |
| xiiAllocator * | GetParent () const |
| Public Member Functions inherited from xiiAllocator | |
| xiiAllocator () | |
| Copyright (c) Theophilus Eriata. All Rights Reserved. | |
| virtual void * | Reallocate (void *pPtr, size_t uiCurrentSize, size_t uiNewSize, size_t uiAlign) |
| Copyright (c) Theophilus Eriata. All Rights Reserved. | |
Additional Inherited Members | |
| Protected Attributes inherited from xiiInternal::xiiAllocatorImpl< xiiAllocationPolicyLinear< false >, TrackingMode > | |
| xiiAllocationPolicyLinear< false > | m_Allocator |
| xiiAllocatorId | m_Id |
| xiiThreadID | m_ThreadID |
Copyright (c) Theophilus Eriata. All Rights Reserved.
Linear allocator that allocates memory sequentially.
This allocator allocates memory by simply advancing a pointer within pre-allocated chunks. Individual deallocations are not supported - the entire allocator must be reset at once. Very efficient for short lived allocations.
Template parameters:
Performance characteristics:
Use when:
|
overridevirtual |
Interface, do not use this directly, always use the new/delete macros below
Allocates aligned memory of the specified size. The destructorFunc parameter is used for automatic cleanup when the allocator is reset or destroyed (mainly used by linear allocators).
Reimplemented from xiiInternal::xiiAllocatorImpl< xiiAllocationPolicyLinear< false >, TrackingMode >.
|
overridevirtual |
Deallocates memory previously allocated by this allocator.
The pointer must have been returned by a previous call to Allocate() on this allocator instance. Passing nullptr is safe and will be ignored.
Reimplemented from xiiInternal::xiiAllocatorImpl< xiiAllocationPolicyLinear< false >, TrackingMode >.
| XII_MSVC_ANALYSIS_WARNING_PUSH void xiiLinearAllocator< TrackingMode, OverwriteMemoryOnReset >::Reset | ( | ) |
Resets the allocator, freeing all memory and calling destructors.
This resets the allocation pointer to the beginning and calls destructors for all objects that were allocated with destructor functions. After reset, all previously allocated pointers become invalid and must not be used.