libfoedus-core
FOEDUS Core Library
|
A slice of foedus::memory::AlignedMemory. More...
A slice of foedus::memory::AlignedMemory.
This class is used to split a single (often large) foedus::memory::AlignedMemory to be used by multiple consumers. Such use has a performance advantage because many smaller memory pieces are consolidated to one large piece from the viewpoint of OS. In particular, it might be that allocating a consolidated memory triggers transparent hugepage while allocating individual memory does not.
This object is a POD.
Definition at line 210 of file aligned_memory.hpp.
#include <aligned_memory.hpp>
Public Member Functions | |
AlignedMemorySlice () | |
Empty constructor. More... | |
AlignedMemorySlice (AlignedMemory *memory) | |
A dummy slice that covers the memory entirely. More... | |
AlignedMemorySlice (AlignedMemory *memory, uint64_t offset, uint64_t count) | |
A slice that covers the specified region of the memory. More... | |
AlignedMemorySlice (const AlignedMemorySlice &slice, uint64_t offset, uint64_t count) | |
A slice that covers the specified region of another slice. More... | |
void | clear () |
bool | is_valid () const |
uint64_t | get_size () const |
void * | get_block () const |
Public Attributes | |
AlignedMemory * | memory_ |
The wrapped memory. More... | |
uint64_t | offset_ |
Byte offset of this slice in memory_. More... | |
uint64_t | count_ |
Byte count of this slice in memory_. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &o, const AlignedMemorySlice &v) |
|
inline |
Empty constructor.
Definition at line 212 of file aligned_memory.hpp.
|
inlineexplicit |
A dummy slice that covers the memory entirely.
Definition at line 215 of file aligned_memory.hpp.
|
inline |
A slice that covers the specified region of the memory.
Definition at line 219 of file aligned_memory.hpp.
References ASSERT_ND, and foedus::memory::AlignedMemory::get_size().
|
inline |
A slice that covers the specified region of another slice.
Definition at line 225 of file aligned_memory.hpp.
References ASSERT_ND, and get_size().
|
inline |
Definition at line 232 of file aligned_memory.hpp.
References CXX11_NULLPTR, and memory_.
Referenced by foedus::memory::NumaCoreMemory::uninitialize_once().
|
inline |
Definition at line 235 of file aligned_memory.hpp.
References foedus::memory::AlignedMemory::get_block(), memory_, and offset_.
Referenced by foedus::log::ThreadLogBuffer::initialize_once(), foedus::fs::DirectIoFile::read(), and foedus::fs::DirectIoFile::write().
|
inline |
Definition at line 234 of file aligned_memory.hpp.
References count_.
Referenced by AlignedMemorySlice(), and foedus::log::ThreadLogBuffer::initialize_once().
|
inline |
Definition at line 233 of file aligned_memory.hpp.
References memory_.
Referenced by foedus::fs::DirectIoFile::write().
|
friend |
Definition at line 282 of file aligned_memory.cpp.
uint64_t foedus::memory::AlignedMemorySlice::count_ |
Byte count of this slice in memory_.
Definition at line 242 of file aligned_memory.hpp.
Referenced by get_size(), foedus::memory::operator<<(), foedus::fs::DirectIoFile::read(), and foedus::fs::DirectIoFile::write().
AlignedMemory* foedus::memory::AlignedMemorySlice::memory_ |
The wrapped memory.
This object is just a view. It doesn't release the block.
Definition at line 238 of file aligned_memory.hpp.
Referenced by clear(), get_block(), is_valid(), foedus::memory::operator<<(), foedus::fs::DirectIoFile::read(), and foedus::fs::DirectIoFile::write().
uint64_t foedus::memory::AlignedMemorySlice::offset_ |
Byte offset of this slice in memory_.
Definition at line 240 of file aligned_memory.hpp.
Referenced by get_block(), and foedus::memory::operator<<().