PageStack.cc
Go to the documentation of this file.
129 debugs(54, 5, "rounded capacity up from " << capacity << " to " << (leafNodeCount*BitsPerLeaf));
235Ipc::Mem::IdSet::innerTruncate(const Position pos, const NavigationDirection dir, const size_type toSubtract)
static int trailingZeros(uint64_t x)
a temporary C++20 countr_zero() replacement
Definition: PageStack.cc:308
a helper class to perform inner node manipulation for IdSet
Definition: PageStack.cc:75
IdSetInnerNode()=default
Packed pack() const
returns a serializes value suitable for shared memory storage
Definition: PageStack.cc:87
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
IdSetMeasurements(size_type capacity)
Definition: PageStack.cc:113
Definition: PageStack.cc:54
IdSetNavigationDirection ascendDirection() const
which direction is this position from our parent node
Definition: PageStack.cc:106
IdSet::size_type level
the number of levels above us (e.g., zero for the root node)
Definition: PageStack.cc:68
IdSet::size_type offset
the number of nodes (at our level) to the left of us
Definition: PageStack.cc:70
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
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 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 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
static const IdSet::size_type BitsPerLeaf
the maximum number of pages that a leaf node can store
Definition: PageStack.cc:51
Definition: IpcIoFile.h:24
Definition: parse.c:104