libfoedus-core
FOEDUS Core Library
foedus::memory::AutoVolatilePageReleaseScope Struct Reference

Automatically invokes a page offset acquired for volatile page. More...

Detailed Description

Automatically invokes a page offset acquired for volatile page.

This is used in places that acquire a new volatile page offset but might have to release it when there is some other error. You must NOT forget to call set_released() to avoid releasing the page when no error happens. Well, so maybe it's better to not use this class...

Definition at line 220 of file numa_core_memory.hpp.

#include <numa_core_memory.hpp>

Collaboration diagram for foedus::memory::AutoVolatilePageReleaseScope:

Public Member Functions

 AutoVolatilePageReleaseScope (NumaCoreMemory *memory, PagePoolOffset offset)
 
 ~AutoVolatilePageReleaseScope ()
 
void set_released ()
 

Public Attributes

NumaCoreMemory *const memory_
 
const PagePoolOffset offset_
 
bool released_
 

Constructor & Destructor Documentation

foedus::memory::AutoVolatilePageReleaseScope::AutoVolatilePageReleaseScope ( NumaCoreMemory memory,
PagePoolOffset  offset 
)
inline
foedus::memory::AutoVolatilePageReleaseScope::~AutoVolatilePageReleaseScope ( )
inline

Definition at line 223 of file numa_core_memory.hpp.

References memory_, offset_, foedus::memory::NumaCoreMemory::release_free_volatile_page(), and released_.

223  {
224  if (!released_) {
226  released_ = true;
227  }
228  }
void release_free_volatile_page(PagePoolOffset offset)
Returns one free volatile page to local page pool.

Here is the call graph for this function:

Member Function Documentation

void foedus::memory::AutoVolatilePageReleaseScope::set_released ( )
inline

Definition at line 229 of file numa_core_memory.hpp.

References released_.

229  {
230  released_ = true;
231  }

Member Data Documentation

NumaCoreMemory* const foedus::memory::AutoVolatilePageReleaseScope::memory_

Definition at line 232 of file numa_core_memory.hpp.

Referenced by ~AutoVolatilePageReleaseScope().

const PagePoolOffset foedus::memory::AutoVolatilePageReleaseScope::offset_

Definition at line 233 of file numa_core_memory.hpp.

Referenced by ~AutoVolatilePageReleaseScope().

bool foedus::memory::AutoVolatilePageReleaseScope::released_

Definition at line 234 of file numa_core_memory.hpp.

Referenced by set_released(), and ~AutoVolatilePageReleaseScope().


The documentation for this struct was generated from the following file: