12 MemAllocatorRegistry* MemAllocatorRegistry::s_registry =
nullptr;
20 return this->
allocate(identifier, size, unused, alignment);
28 void* memory = this->
allocate(identifier, size, recoverable, alignment);
29 FW_ASSERT(memory !=
nullptr && size >= requestedSize, static_cast<FwAssertArgType>(identifier),
30 static_cast<FwAssertArgType>(requestedSize), static_cast<FwAssertArgType>(size));
41 MemAllocatorRegistry::s_registry =
this;
46 this->m_allocators[type] = &allocator;
55 FW_ASSERT(this->m_allocators[type] !=
nullptr, static_cast<FwAssertArgType>(type));
56 return *this->m_allocators[type];
61 if (this->m_allocators[type] ==
nullptr) {
64 return *this->m_allocators[type];
virtual void * allocate(const FwEnumStoreType identifier, FwSizeType &size, bool &recoverable, FwSizeType alignment=alignof(std::max_align_t))=0
PlatformSizeType FwSizeType
REQUIRED: required for allocation for memory using a standard system allocator (i.e. the default)
static MemAllocatorRegistry & getInstance()
get the singleton registry
MemAllocator & getAnAllocator(const MemoryAllocation::MemoryAllocatorType type)
void * checkedAllocate(const FwEnumStoreType identifier, FwSizeType &size, bool &recoverable, FwSizeType alignment=alignof(std::max_align_t))
Memory Allocation base class.
MemAllocator & getAllocator(const MemoryAllocation::MemoryAllocatorType type)
Defines a base class for a memory allocator for classes.
Implementation of malloc based allocator.
void registerAllocator(const MemoryAllocation::MemoryAllocatorType type, MemAllocator &allocator)
register an allocator for the given type