BrotliDecompressorImpl::BrotliDecompressorImpl(Stats::Scope& scope, const std::string& stats_prefix,
                                               const uint32_t chunk_size,
                                               const bool disable_ring_buffer_reallocation)
    : chunk_size_{chunk_size},
      state_(BrotliDecoderCreateInstance(nullptr, nullptr, nullptr), &BrotliDecoderDestroyInstance),
      stats_(generateStats(stats_prefix, scope)) {
  BROTLI_BOOL result =
      BrotliDecoderSetParameter(state_.get(), BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION,
                                disable_ring_buffer_reallocation ? BROTLI_TRUE : BROTLI_FALSE);
  RELEASE_ASSERT(result == BROTLI_TRUE, "");
}
BrotliDecompressorImpl::BrotliDecompressorImpl(Stats::Scope& scope, const std::string& stats_prefix,
                                               const uint32_t chunk_size,
                                               const bool disable_ring_buffer_reallocation)
    : chunk_size_{chunk_size},
      state_(BrotliDecoderCreateInstance(nullptr, nullptr, nullptr), &BrotliDecoderDestroyInstance),
      stats_(generateStats(stats_prefix, scope)) {
  BROTLI_BOOL result =
      BrotliDecoderSetParameter(state_.get(), BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION,
                                disable_ring_buffer_reallocation ? BROTLI_TRUE : BROTLI_FALSE);
  RELEASE_ASSERT(result == BROTLI_TRUE, "");
}