#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.
◆ MemoryResource() [1/3]
zserio::pmr::MemoryResource::MemoryResource |
( |
| ) |
|
|
default |
◆ ~MemoryResource()
virtual zserio::pmr::MemoryResource::~MemoryResource |
( |
| ) |
|
|
virtualdefault |
◆ MemoryResource() [2/3]
zserio::pmr::MemoryResource::MemoryResource |
( |
const MemoryResource & |
other | ) |
|
|
delete |
Copying and moving is disallowed!
◆ MemoryResource() [3/3]
zserio::pmr::MemoryResource::MemoryResource |
( |
MemoryResource && |
other | ) |
|
|
delete |
Copying and moving is disallowed!
◆ allocate()
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.
◆ deallocate()
void zserio::pmr::MemoryResource::deallocate |
( |
void * |
storage, |
|
|
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
-
storage | Pointer to the storage to deallocate. |
bytes | Number of bytes to deallocate. |
alignment | Requested alignment. |
Definition at line 71 of file MemoryResource.h.
◆ isEqual()
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.
◆ operator=() [1/2]
Copying and moving is disallowed!
◆ operator=() [2/2]
Copying and moving is disallowed!
The documentation for this class was generated from the following file: