| 71 | } // namespace |
| 72 | |
| 73 | std::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 | |
| 100 | HashStringAllocator::~HashStringAllocator() { |
| 101 | clear(); |
nothing calls this directly
no test coverage detected