Ion
|
AllocationManager is a singleton class that is used to manage Allocators used to allocate Ion objects. More...
#include "allocationmanager.h"
Public Member Functions | |
~AllocationManager () | |
Static Public Member Functions | |
static void | SetDefaultAllocationLifetime (AllocationLifetime lifetime) |
Sets/returns the AllocationLifetime that is assumed when a default new() operator is used for an Allocatable. More... | |
static AllocationLifetime | GetDefaultAllocationLifetime () |
static void | SetDefaultAllocatorForLifetime (AllocationLifetime lifetime, const AllocatorPtr &allocator) |
Sets/returns the default Allocator to use for a specific AllocationLifetime. More... | |
static const AllocatorPtr & | GetDefaultAllocatorForLifetime (AllocationLifetime lifetime) |
static const AllocatorPtr & | GetDefaultAllocator () |
Convenience function that returns the default allocator to use when no lifetime is specified. More... | |
static const AllocatorPtr & | GetMallocAllocator () |
Returns an allocator that performs conventional allocation and deallocation with malloc() and free(). More... | |
static const AllocatorPtr & | GetNonNullAllocator (const AllocatorPtr &allocator) |
This convenience function can be used where a non-NULL Allocator pointer is needed. More... | |
AllocationManager is a singleton class that is used to manage Allocators used to allocate Ion objects.
Definition at line 29 of file allocationmanager.h.
ion::base::AllocationManager::~AllocationManager | ( | ) |
Definition at line 58 of file allocationmanager.cc.
|
inlinestatic |
Definition at line 38 of file allocationmanager.h.
|
inlinestatic |
Convenience function that returns the default allocator to use when no lifetime is specified.
It returns the default allocator for the lifetime returned by GetDefaultAllocationLifetime().
Definition at line 70 of file allocationmanager.h.
|
inlinestatic |
Definition at line 62 of file allocationmanager.h.
Referenced by ion::base::DataContainer::CreateAndCopy(), ion::base::Allocator::GetAllocatorForLifetime(), and ion::base::ScopedAllocation< T >::ScopedAllocation().
|
inlinestatic |
Returns an allocator that performs conventional allocation and deallocation with malloc() and free().
Definition at line 77 of file allocationmanager.h.
|
inlinestatic |
This convenience function can be used where a non-NULL Allocator pointer is needed.
It returns the passed-in Allocator if it is not NULL; otherwise it returns the Allocator returned by GetDefaultAllocator().
Definition at line 84 of file allocationmanager.h.
References ion::base::SharedPtr< T >::Get().
Referenced by ion::image::NinePatch::BuildImage(), ion::image::ConvertFromExternalImageData(), ion::image::ConvertImage(), ion::base::Allocatable::GetNonNullAllocator(), and ion::base::Variant< GLint, GLfloat, math::Range1f, math::Range1i, GraphicsManager::ShaderPrecision, std::vector< GLint > >::InitArray().
|
inlinestatic |
Sets/returns the AllocationLifetime that is assumed when a default new() operator is used for an Allocatable.
It is MediumTerm by default.
Definition at line 35 of file allocationmanager.h.
|
inlinestatic |
Sets/returns the default Allocator to use for a specific AllocationLifetime.
The default Allocator will be used for allocations of Allocatable objects when using the new(AllocationLifetime) operator or when Ion allocates subordinate objects, unless the Allocator for the owner object overrides its GetAllocatorForLifetime() function.
By default, the Allocator returned by GetMallocAllocator() is used for all lifetimes. Setting an Allocator to NULL restores GetMallocAllocator() as the default allocator.
Definition at line 56 of file allocationmanager.h.
References ion::base::SharedPtr< T >::Get().