#include <MemoryResource.h>
Abstract base class for memory resources which are to be used by polymorphic allocators defined by zserio.
Definition at line 17 of file MemoryResource.h.
zserio::pmr::MemoryResource::MemoryResource |
( |
| ) |
|
|
default |
virtual zserio::pmr::MemoryResource::~MemoryResource |
( |
| ) |
|
|
virtualdefault |
zserio::pmr::MemoryResource::MemoryResource |
( |
const MemoryResource & |
other | ) |
|
|
delete |
Copying and moving is disallowed!
zserio::pmr::MemoryResource::MemoryResource |
( |
MemoryResource && |
other | ) |
|
|
delete |
Copying and moving is disallowed!
void* zserio::pmr::MemoryResource::allocate |
( |
size_t |
bytes, |
|
|
size_t |
alignment = alignof(max_align_t) |
|
) |
| |
|
inline |
Allocates storage with a size of at least bytes bytes, aligned to the specified alignment.
- Parameters
-
bytes | Minimum number of bytes to allocate. |
alignment | Requested alignment. |
- Returns
- Pointer to the allocated storage.
Definition at line 50 of file MemoryResource.h.
void zserio::pmr::MemoryResource::deallocate |
( |
void * |
p, |
|
|
size_t |
bytes, |
|
|
size_t |
alignment = alignof(max_align_t) |
|
) |
| |
|
inline |
Deallocates the storage pointed to by p.
Arguments shall match to prior call to allocate!
- Parameters
-
p | Pointer to the storage to deallocate. |
bytes | Number of bytes to deallocate. |
alignment | Requested alignment. |
Definition at line 71 of file MemoryResource.h.
bool zserio::pmr::MemoryResource::isEqual |
( |
const MemoryResource & |
other | ) |
const |
|
inlinenoexcept |
Compares *this for equality with other.
Two memory resources compare equal if and only if memory allocated from one memory resource can be deallocated from the other and vice versa.
- Parameters
-
other | Other memory resource to compare. |
- Returns
- True when the two resources are equal, false otherwise.
Definition at line 90 of file MemoryResource.h.
Copying and moving is disallowed!
Copying and moving is disallowed!
The documentation for this class was generated from the following file: