MCPcopy Create free account
hub / github.com/bytedance/bolt / findRun

Method findRun

bolt/common/memory/Allocation.cpp:69–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void Allocation::findRun(uint64_t offset, int32_t* index, int32_t* offsetInRun)
70 const {
71 uint64_t skipped = 0;
72 for (int32_t i = 0; i < runs_.size(); ++i) {
73 uint64_t size = AllocationTraits::pageBytes(runs_[i].numPages());
74 if (offset - skipped < size) {
75 *index = i;
76 *offsetInRun = static_cast<int32_t>(offset - skipped);
77 return;
78 }
79 skipped += size;
80 }
81 BOLT_UNREACHABLE(
82 "Seeking to an out of range offset {} in Allocation with {} pages and {} runs",
83 offset,
84 numPages_,
85 runs_.size());
86}
87
88std::string Allocation::toString() const {
89 return fmt::format(

Callers 5

loadPositionMethod · 0.80
loadPositionMethod · 0.80
listPartitionRowsMethod · 0.80
appendPartitionsMethod · 0.80
TEST_PFunction · 0.80

Calls 2

sizeMethod · 0.45
numPagesMethod · 0.45

Tested by 1

TEST_PFunction · 0.64