| 49 | size_t size{0}; |
| 50 | |
| 51 | void append(char* row, HashStringAllocator& allocator) { |
| 52 | ByteOutputStream stream(&allocator); |
| 53 | if (firstBlock == nullptr) { |
| 54 | // Allocate first block. |
| 55 | currentBlock = allocator.newWrite(stream); |
| 56 | firstBlock = currentBlock.header; |
| 57 | } else { |
| 58 | allocator.extendWrite(currentBlock, stream); |
| 59 | } |
| 60 | |
| 61 | stream.appendOne(reinterpret_cast<uintptr_t>(row)); |
| 62 | currentBlock = allocator.finishWrite(stream, 1024).second; |
| 63 | |
| 64 | ++size; |
| 65 | } |
| 66 | |
| 67 | void free(HashStringAllocator& allocator) { |
| 68 | if (firstBlock != nullptr) { |
no test coverage detected