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'.
| 61 | /// last 4 bytes of the block. Sets kPreviousFree flag in the next block's |
| 62 | /// 'header'. |
| 63 | void 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 | |
| 73 | std::string HashStringAllocator::Header::toString() { |
no test coverage detected