Header can be read or write since it just needs the sizes
| 17 | |
| 18 | // Header can be read or write since it just needs the sizes |
| 19 | static 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 | |
| 28 | PageStorageInfo::PageStorageInfo(uint64_t elementSize) |
| 29 | : alignedElementSize{std::bit_ceil(elementSize)}, |
no outgoing calls
no test coverage detected