SuperDex Physics C++ API
Loading...
Searching...
No Matches
superdex::DefaultAllocator Class Referencefinal

Mochi's default implementation of the Allocator interface. More...

#include <allocator.h>

Inheritance diagram for superdex::DefaultAllocator:
superdex::Allocator

Additional Inherited Members

Public Member Functions inherited from superdex::Allocator
void * allocate (std::size_t sizeInBytes, std::size_t alignment=alignof(std::max_align_t))
 Allocate memory of the specified size and alignment.
void deallocate (void *ptr, std::size_t sizeInBytes, std::size_t alignment=alignof(std::max_align_t))
 Deallocate a block of memory that was previously allocated by this Allocator instance or by a compatible Allocator instance.
bool is_equal (Allocator const &other) const noexcept
 Return true if memory allocated by this Allocator instance can be deallocated by the other Allocator instance, and visa versa.
virtual ~Allocator ()=default
Protected Member Functions inherited from superdex::Allocator
virtual void * do_allocate (std::size_t sizeInBytes, std::size_t alignment)=0
virtual void do_deallocate (void *ptr, std::size_t sizeInBytes, std::size_t alignment)=0

Detailed Description

Mochi's default implementation of the Allocator interface.

This class allows you to allocate memory on any thread and then deallocate it on any thread, similar to std::pmr::new_delete_resource. All instance of this class are considered to be "equal" so that memory allocated from one instance can be deallocated by another instance.

Definition at line 107 of file allocator.h.


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