|
join 1.0
lightweight network framework library
|
local anonymous memory provider. More...
#include <memory.hpp>
Public Types | |
| template<size_t Count, size_t... Sizes> | |
| using | Allocator = BasicArena<LocalMem, Count, Sizes...> |
| using | Spsc = SyncBinding<LocalMem, ::join::Spsc> |
| using | Mpsc = SyncBinding<LocalMem, ::join::Mpsc> |
| using | Mpmc = SyncBinding<LocalMem, ::join::Mpmc> |
Public Member Functions | |
| LocalMem (uint64_t size) | |
| allocates a local anonymous memory segment. | |
| LocalMem (const LocalMem &other)=delete | |
| copy constructor. | |
| LocalMem & | operator= (const LocalMem &other)=delete |
| copy assignment operator. | |
| LocalMem (LocalMem &&other) noexcept | |
| move constructor. | |
| LocalMem & | operator= (LocalMem &&other) noexcept |
| move assignment operator. | |
| ~LocalMem () noexcept | |
| releases the mapped memory. | |
| const void * | get (uint64_t offset=0) const |
| get a const pointer to the memory at a given offset. | |
| void * | get (uint64_t offset=0) |
| get a pointer to the memory at a given offset. | |
| int | mbind (int numa) const noexcept |
| bind memory to a NUMA node. | |
| int | mlock () const noexcept |
| lock memory in RAM. | |
local anonymous memory provider.
| using join::LocalMem::Allocator = BasicArena<LocalMem, Count, Sizes...> |
| using join::LocalMem::Mpmc = SyncBinding<LocalMem, ::join::Mpmc> |
| using join::LocalMem::Mpsc = SyncBinding<LocalMem, ::join::Mpsc> |
| using join::LocalMem::Spsc = SyncBinding<LocalMem, ::join::Spsc> |
|
inlineexplicit |
allocates a local anonymous memory segment.
| size | allocation size in bytes. |
| std::system_error | if mmap fails. |
|
delete |
copy constructor.
| other | other object to copy. |
|
inlinenoexcept |
move constructor.
| other | other object to move. |
|
inlinenoexcept |
releases the mapped memory.
|
inline |
get a pointer to the memory at a given offset.
| offset | byte offset from the start of the memory. |
| std::runtime_error | if memory is not mapped. |
| std::out_of_range | if offset is out of bounds. |
|
inline |
get a const pointer to the memory at a given offset.
| offset | byte offset from the start of the memory. |
| std::runtime_error | if memory is not mapped. |
| std::out_of_range | if offset is out of bounds. |
|
inlinenoexcept |
bind memory to a NUMA node.
| numa | NUMA node ID. |
|
inlinenoexcept |
lock memory in RAM.
copy assignment operator.
| other | other object to copy. |
move assignment operator.
| other | other object to move. |