libfoedus-core
FOEDUS Core Library
foedus::memory::PagePoolOffsetDynamicChunk Class Reference

Used to point to an already existing array. More...

Detailed Description

Used to point to an already existing array.

Definition at line 81 of file page_pool.hpp.

#include <page_pool.hpp>

Public Member Functions

 PagePoolOffsetDynamicChunk (uint32_t size, PagePoolOffset *chunk)
 
uint32_t capacity () const
 
uint32_t size () const
 
bool empty () const
 
bool full () const
 
void move_to (PagePoolOffset *destination, uint32_t count)
 
uint32_t unused_dummy_func_padding () const
 

Constructor & Destructor Documentation

foedus::memory::PagePoolOffsetDynamicChunk::PagePoolOffsetDynamicChunk ( uint32_t  size,
PagePoolOffset chunk 
)
inline

Definition at line 83 of file page_pool.hpp.

84  : size_(size), padding_(0), chunk_(chunk) {}

Member Function Documentation

uint32_t foedus::memory::PagePoolOffsetDynamicChunk::capacity ( ) const
inline

Definition at line 86 of file page_pool.hpp.

86 { return size_; }
bool foedus::memory::PagePoolOffsetDynamicChunk::empty ( ) const
inline

Definition at line 88 of file page_pool.hpp.

88 { return size_ == 0; }
bool foedus::memory::PagePoolOffsetDynamicChunk::full ( ) const
inline

Definition at line 89 of file page_pool.hpp.

89 { return true; }
void foedus::memory::PagePoolOffsetDynamicChunk::move_to ( PagePoolOffset destination,
uint32_t  count 
)

Definition at line 48 of file page_pool.cpp.

References ASSERT_ND.

48  {
49  ASSERT_ND(size_ >= count);
50  std::memcpy(destination, chunk_, count * sizeof(PagePoolOffset));
51 
52  // Skip the consumed entries
53  chunk_ += count;
54  size_ -= count;
55 }
uint32_t PagePoolOffset
Offset in PagePool that compactly represents the page address (unlike 8 bytes pointer).
Definition: memory_id.hpp:44
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72
uint32_t foedus::memory::PagePoolOffsetDynamicChunk::size ( ) const
inline

Definition at line 87 of file page_pool.hpp.

87 { return size_; }
uint32_t foedus::memory::PagePoolOffsetDynamicChunk::unused_dummy_func_padding ( ) const
inline

Definition at line 93 of file page_pool.hpp.

93 { return padding_; }

The documentation for this class was generated from the following files: