Foundation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Foundation::Core::AllocatorHeap Class Reference

General purpose heap allocator. More...

#include <AllocatorHeap.hpp>

Inheritance diagram for Foundation::Core::AllocatorHeap:
Foundation::Core::Allocator

Public Member Functions

pointer Allocate (size_type size, size_t alignment) override
 
void Deallocate (pointer ptr) override
 
pointer Reallocate (pointer ptr, size_type new_size, size_t alignment) override
 
void QueryBudget (size_t &used, size_t &budget) const override
 
- Public Member Functions inherited from Foundation::Core::Allocator
virtual ~Allocator ()=default
 
Arena AllocateArena (size_type size, size_t alignment)
 
Arena AllocateArena (size_type size)
 
void DeallocateArena (Arena arena)
 
AllocatorPtr ()
 

Detailed Description

General purpose heap allocator.

Note
By default, this allocator uses mimalloc for memory management - which can be overridden by defining FOUNDATION_CORE_USES_OS_ALLOC to use the OS's default allocator.
As mimalloc/OS allocators are thread-safe by default, so is this allocator. This is only a thin wrapper around the underlying allocator, and is thus stateless.
Queried values will reflect the global state of the underlying allocator.

Member Function Documentation

◆ Allocate()

pointer Foundation::Core::AllocatorHeap::Allocate ( size_type  size,
size_t  alignment 
)
overridevirtual

◆ Deallocate()

void Foundation::Core::AllocatorHeap::Deallocate ( pointer  ptr)
overridevirtual

◆ QueryBudget()

void Foundation::Core::AllocatorHeap::QueryBudget ( size_t used,
size_t budget 
) const
overridevirtual
Note
Queried values will reflect the global state of the underlying allocator.

Implements Foundation::Core::Allocator.

◆ Reallocate()

pointer Foundation::Core::AllocatorHeap::Reallocate ( pointer  ptr,
size_type  new_size,
size_t  alignment 
)
overridevirtual

The documentation for this class was generated from the following files: