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

Function markAsFree

bolt/common/memory/HashStringAllocator.cpp:63–70  ·  view source on GitHub ↗

Sets kFree flag in the 'header' and writes the size of the block to the last 4 bytes of the block. Sets kPreviousFree flag in the next block's 'header'.

Source from the content-addressed store, hash-verified

61/// last 4 bytes of the block. Sets kPreviousFree flag in the next block's
62/// 'header'.
63void markAsFree(HashStringAllocator::Header* FOLLY_NONNULL header) {
64 header->setFree();
65 auto nextHeader = header->next();
66 if (nextHeader) {
67 nextHeader->setPreviousFree();
68 *previousFreeSize(nextHeader) = header->size();
69 }
70}
71} // namespace
72
73std::string HashStringAllocator::Header::toString() {

Callers 1

freeMethod · 0.85

Calls 5

previousFreeSizeFunction · 0.85
setFreeMethod · 0.80
setPreviousFreeMethod · 0.80
nextMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected