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

Method toString

bolt/common/memory/HashStringAllocator.cpp:73–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71} // namespace
72
73std::string HashStringAllocator::Header::toString() {
74 std::ostringstream out;
75 if (isFree()) {
76 out << "|free| ";
77 }
78 if (isContinued()) {
79 out << "|multipart| ";
80 }
81 out << "size: " << size();
82 if (isContinued()) {
83 auto next = nextContinued();
84 out << " [" << next->size();
85 while (next->isContinued()) {
86 next = next->nextContinued();
87 out << ", " << next->size();
88 }
89 out << "]";
90 }
91 if (isPreviousFree()) {
92 out << ", previous is free (" << *previousFreeSize(this) << " bytes)";
93 }
94 if (next() == nullptr) {
95 out << ", at end";
96 }
97 return out.str();
98}
99
100HashStringAllocator::~HashStringAllocator() {
101 clear();

Callers

nothing calls this directly

Calls 10

sizeFunction · 0.85
previousFreeSizeFunction · 0.85
isContinuedMethod · 0.80
nextContinuedMethod · 0.80
strMethod · 0.80
numRangesMethod · 0.80
rangeAtMethod · 0.80
sizeMethod · 0.45
dataMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected