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

Method append

bolt/common/memory/Allocation.cpp:46–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void Allocation::append(uint8_t* address, MachinePageCount numPages) {
47 BOLT_CHECK(
48 runs_.empty() || address != runs_.back().data(),
49 "Appending a duplicate address into a PageRun");
50 if (FOLLY_UNLIKELY(numPages > Allocation::PageRun::kMaxPagesInRun)) {
51 BOLT_MEM_ALLOC_ERROR(fmt::format(
52 "The number of pages to append {} exceeds the PageRun limit {}",
53 numPages,
54 Allocation::PageRun::kMaxPagesInRun));
55 }
56 numPages_ += numPages;
57 runs_.emplace_back(address, numPages);
58}
59
60void Allocation::appendMove(Allocation& other) {
61 for (auto& run : other.runs_) {

Callers 8

ensureAvailableMethod · 0.45
freeBytesMethod · 0.45
allocateAnyMethod · 0.45
createStreamMethod · 0.45
TEST_FFunction · 0.45
TEST_PFunction · 0.45

Calls 3

backMethod · 0.80
emptyMethod · 0.45
dataMethod · 0.45

Tested by 3

createStreamMethod · 0.36
TEST_FFunction · 0.36
TEST_PFunction · 0.36