Class Allocator¶
- Defined in File Allocator.h
Inheritance Relationships¶
Derived Types¶
public Azura::Memory::MonotonicAllocator
(Class MonotonicAllocator)public Azura::Memory::RangeAllocator
(Class RangeAllocator)
Class Documentation¶
-
class
Allocator
¶ Base class for an Allocator.
Subclassed by Azura::Memory::MonotonicAllocator, Azura::Memory::RangeAllocator
Public Functions
-
Allocator
(void *resource, U32 size)¶
-
Allocator
(AddressPtr resource, U32 size)¶
-
~Allocator
()¶
-
template <typename Type, typename... Args>
UniquePtr<Type>New
(Args... args)¶ Allocates & initializes the Type and returns a pointer to that memory location.
New is analogous to the C++ new keyword. It tells the allocator to construct an object in the memory recourse it is managing. This functions first allocates a block of memory and then constructs it with the supplied params. Some example usages:
auto floatDataPtr = MyAllocator.New<float>(0.0f); class CustomClass{}; auto customDataPtr = MyAllocator.New<CustomClass>();
The actual returned type is a
UniquePtr<T>
which is a std::unique_ptr with a custom deleter.- Return
- A unique pointer with a custom deleter
- Template Parameters
Type
: Data Type to allocateArgs
: Initialization Arguments
- Parameters
args
: The list of arguments that Type needs for construction
-
template <typename Type, typename... Args>
UniqueArrayPtr<Type>NewArray
(U32 numElements, Args... args)¶
-
template <typename Type, typename... Args>
UniquePtr<Type>RawNew
(Args... args)¶
-
template <typename Type, typename... Args>
UniqueArrayPtr<Type>RawNewArray
(U32 numElements, Args... args)¶
-