omni::structuredlog::Allocator¶
Defined in omni/structuredlog/JsonTree.h
Inheritance Relationships¶
Derived Type¶
public omni::structuredlog::BlockAllocator
(omni::structuredlog::BlockAllocator)
-
class
omni::structuredlog
::
Allocator
¶ A memory allocator interface, which can be overwritten with your custom allocator.
Subclassed by omni::structuredlog::BlockAllocator
Public Functions
-
inline virtual
~Allocator
()¶
-
inline virtual void *
alloc
(size_t size)¶ Allocated memory.
- Remark
This should be overwritten by custom memory allocators to use another allocation mechanism.
- Parameters
size – [in] The number of bytes to allocate.
- Returns
The allocated memory.
- Returns
nullptr if memory was not available.
Public Static Functions
-
static inline size_t
fixupAlignment
(size_t size)¶ Round a size up to be aligned to kAlignment.
- Parameters
size – [in] The size to align.
- Returns
size
rounded up to the next multiple of kAlignment.
Public Static Attributes
-
static constexpr size_t
kAlignment
= alignof(void*)¶ The alignment that each allocation must be.
-
inline virtual