libfoedus-core
FOEDUS Core Library
|
Obtains multiple free volatile pages at once and releases them automatically when this object gets out of scope. More...
Obtains multiple free volatile pages at once and releases them automatically when this object gets out of scope.
You can also dispatch some of the grabbed pages, which means they will NOT be released.
Definition at line 391 of file thread.hpp.
#include <thread.hpp>
Public Member Functions | |
GrabFreeVolatilePagesScope (Thread *context, memory::PagePoolOffset *offsets) | |
~GrabFreeVolatilePagesScope () | |
ErrorCode | grab (uint32_t count) |
If this thread doesn't have enough free pages, no page is obtained, returning kErrorCodeMemoryNoFreePages. More... | |
void | release () |
Idempotent. More... | |
uint32_t | get_count () const |
void | dispatch (uint32_t index) |
Call this when the page is placed somewhere. More... | |
memory::PagePoolOffset | get (uint32_t index) const |
|
inline |
Definition at line 393 of file thread.hpp.
|
inline |
Definition at line 395 of file thread.hpp.
References release().
|
inline |
Call this when the page is placed somewhere.
Definition at line 409 of file thread.hpp.
References ASSERT_ND.
Referenced by foedus::storage::masstree::SplitBorder::run(), and foedus::storage::masstree::SplitIntermediate::split_impl_no_error().
|
inline |
Definition at line 413 of file thread.hpp.
References ASSERT_ND.
Referenced by foedus::storage::masstree::SplitIntermediate::split_impl_no_error().
|
inline |
Definition at line 406 of file thread.hpp.
ErrorCode foedus::thread::GrabFreeVolatilePagesScope::grab | ( | uint32_t | count | ) |
If this thread doesn't have enough free pages, no page is obtained, returning kErrorCodeMemoryNoFreePages.
Definition at line 147 of file thread.cpp.
References foedus::thread::Thread::get_thread_memory(), foedus::memory::NumaCoreMemory::grab_free_volatile_page(), foedus::kErrorCodeMemoryNoFreePages, foedus::kErrorCodeOk, release(), and foedus::memory::NumaCoreMemory::release_free_volatile_page().
Referenced by foedus::storage::masstree::Adopt::adopt_case_b(), foedus::storage::masstree::SplitBorder::run(), and foedus::storage::masstree::SplitIntermediate::run().
void foedus::thread::GrabFreeVolatilePagesScope::release | ( | ) |
Idempotent.
You can release it at any moment.
Definition at line 165 of file thread.cpp.
References foedus::thread::Thread::get_thread_memory(), and foedus::memory::NumaCoreMemory::release_free_volatile_page().
Referenced by grab(), and ~GrabFreeVolatilePagesScope().