PageStack.h
Go to the documentation of this file.
basic IdSet storage parameters, extracted here to keep them constant
Definition: PageStack.h:31
uint32_t size_type
we need to fit two size_type counters into one 64-bit lockless atomic
Definition: PageStack.h:34
size_type capacity
the maximum number of pages our tree is allowed to store
Definition: PageStack.h:39
IdSetMeasurements(size_type capacity)
Definition: PageStack.cc:113
size_type requestedLeafNodeCount
the number of leaf nodes that satisfy capacity requirements
Definition: PageStack.h:42
Definition: PageStack.cc:54
a shareable set of positive uint32_t IDs with O(1) insertion/removal ops
Definition: PageStack.h:54
size_type leafPop(Position)
extracts and returns an ID from the leaf node at the given position
Definition: PageStack.cc:320
void leafTruncate(Position pos, size_type idsToKeep)
fill the leaf node at a given position with 0s, leaving only idsToKeep IDs
Definition: PageStack.cc:222
FlexibleArray< StoredNode > nodes_
the entire binary tree flattened into an array
Definition: PageStack.h:101
void truncateExtras()
effectively removes IDs that exceed the requested capacity after makeFull()
Definition: PageStack.cc:197
size_type innerTruncate(Position pos, NavigationDirection dir, size_type toSubtract)
Definition: PageStack.cc:235
void innerPush(Position, NavigationDirection)
accounts for an ID added to subtree in the given dir from the given position
Definition: PageStack.cc:258
static size_t MemorySize(size_type capacity)
memory size required to store a tree with the given capacity
Definition: PageStack.cc:419
void leafPush(Position, size_type id)
adds the given ID to the leaf node at the given position
Definition: PageStack.cc:296
PageStack construction and SharedMemorySize calculation parameters.
Definition: PageStack.h:123
bool createFull
whether a newly created PageStack should be prefilled with PageIds
Definition: PageStack.h:130
Definition: PageStack.h:109
static PoolId IdForMultipurposePool()
multipurpose PagePool of shared memory pages
Definition: PageStack.h:169
static size_t LevelsPaddingSize(const PageCount capacity)
Definition: PageStack.cc:519
static size_t SharedMemorySize(const Config &)
total shared memory size required to share
Definition: PageStack.cc:496
bool pageIdIsValid(const PageId &page) const
Definition: PageStack.cc:483
std::atomic< PageCount > size_
a lower bound for the number of free pages (for debugging purposes)
Definition: PageStack.h:176
static PoolId IdForSwapDirSpace(const int dirIdx)
stack of free rock cache_dir slot numbers
Definition: PageStack.h:171
static size_t StackSize(const PageCount capacity)
Definition: PageStack.cc:504
bool pop(PageId &page)
sets value and returns true unless no free page numbers are found
Definition: PageStack.cc:442
void push(PageId &page)
makes value available as a free page number to future pop() callers
Definition: PageStack.cc:465
Definition: IpcIoFile.h:24