MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / getAPIdxAndOffsetInAP

Function getAPIdxAndOffsetInAP

src/storage/disk_array.cpp:19–26  ·  view source on GitHub ↗

Header can be read or write since it just needs the sizes

Source from the content-addressed store, hash-verified

17
18// Header can be read or write since it just needs the sizes
19static PageCursor getAPIdxAndOffsetInAP(const PageStorageInfo& info, uint64_t idx) {
20 // We assume that `numElementsPerPageLog2`, `elementPageOffsetMask`,
21 // `alignedElementSizeLog2` are never modified throughout transactional updates, thus, we
22 // directly use them from header here.
23 const page_idx_t apIdx = idx / info.numElementsPerPage;
24 const uint32_t byteOffsetInAP = (idx % info.numElementsPerPage) * info.alignedElementSize;
25 return PageCursor{apIdx, byteOffsetInAP};
26}
27
28PageStorageInfo::PageStorageInfo(uint64_t elementSize)
29 : alignedElementSize{std::bit_ceil(elementSize)},

Callers 7

updateLastPageOnDiskMethod · 0.85
getMethod · 0.85
updateMethod · 0.85
disk_array.cppFile · 0.85
pushBackMethod · 0.85
getAPIdxMethod · 0.85
operator[]Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected