| 163 | } |
| 164 | |
| 165 | void ZstdDeflatingAppendableWriteBuffer::addEmptyBlock() |
| 166 | { |
| 167 | /// HACK: https://github.com/facebook/zstd/issues/2090#issuecomment-620158967 |
| 168 | if (out.buffer().size() - out.offset() < ZSTD_CORRECT_TERMINATION_LAST_BLOCK.size()) |
| 169 | out.next(); |
| 170 | |
| 171 | std::memcpy(out.buffer().begin() + out.offset(), ZSTD_CORRECT_TERMINATION_LAST_BLOCK.data(), ZSTD_CORRECT_TERMINATION_LAST_BLOCK.size()); |
| 172 | |
| 173 | out.position() = out.buffer().begin() + out.offset() + ZSTD_CORRECT_TERMINATION_LAST_BLOCK.size(); |
| 174 | } |
| 175 | |
| 176 | bool ZstdDeflatingAppendableWriteBuffer::isNeedToAddEmptyBlock() |
| 177 | { |