| 162 | const auto windowBits = |
| 163 | kind == common::CompressionKind_GZIP ? MAX_WBITS + 16 : MAX_WBITS; |
| 164 | z_stream stream{}; |
| 165 | BOLT_CHECK_EQ(inflateInit2(&stream, windowBits), Z_OK); |
| 166 | auto cleanup = folly::makeGuard([&]() { inflateEnd(&stream); }); |
| 167 | stream.next_in = reinterpret_cast<Bytef*>(const_cast<char*>(input)); |
| 168 | stream.avail_in = inputSize; |
| 169 | stream.next_out = reinterpret_cast<Bytef*>(output); |
| 170 | stream.avail_out = outputSize; |
| 171 | BOLT_CHECK_EQ(inflate(&stream, Z_FINISH), Z_STREAM_END); |
| 172 | BOLT_CHECK_EQ(stream.total_out, outputSize); |
no outgoing calls