From 4444256ab79876bf33500ad4907c45b7b4d57137 Mon Sep 17 00:00:00 2001 From: Nick Terrell Date: Mon, 21 Nov 2016 12:17:06 -0800 Subject: [PATCH] Remove use of deprecated LZ4 function Summary: LZ4 1.7.3 emits warnings when calling the deprecated function `LZ4_compress_limitedOutput_continue()`. Starting in r129, LZ4 introduces `LZ4_compress_fast_continue()` as a replacement, and the two functions calls are [exactly equivalent](https://github.com/lz4/lz4/blob/dev/lib/lz4.c#L1408). Closes https://github.com/facebook/rocksdb/pull/1532 Differential Revision: D4199240 Pulled By: siying fbshipit-source-id: 138c2bc --- util/compression.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util/compression.h b/util/compression.h index 6c233e0f2..c3c3d79ff 100644 --- a/util/compression.h +++ b/util/compression.h @@ -553,9 +553,15 @@ inline bool LZ4_Compress(const CompressionOptions& opts, LZ4_loadDict(stream, compression_dict.data(), static_cast(compression_dict.size())); } +#if LZ4_VERSION_NUMBER >= 10700 // r129+ + outlen = LZ4_compress_fast_continue( + stream, input, &(*output)[output_header_len], static_cast(length), + compress_bound, 1); +#else // up to r128 outlen = LZ4_compress_limitedOutput_continue( stream, input, &(*output)[output_header_len], static_cast(length), compress_bound); +#endif LZ4_freeStream(stream); #else // up to r123 outlen = LZ4_compress_limitedOutput(input, &(*output)[output_header_len],