Commit db777d6b authored by Nick Terrell's avatar Nick Terrell Committed by Facebook Github Bot

Replace deprecated LZ4 functions

Summary:
Replace deprecated functions with their functionally equivalent counterparts.

See https://github.com/lz4/lz4/blob/dev/lib/lz4.c#L1405 and https://github.com/lz4/lz4/blob/dev/lib/lz4hc.c#L634

Reviewed By: Cyan4973

Differential Revision: D4194834

fbshipit-source-id: aa4f934c46fe764fcec8ea29221e3882da2b5cdf
parent b981b9f2
......@@ -260,13 +260,18 @@ std::unique_ptr<IOBuf> LZ4Codec::doCompress(const IOBuf* data) {
int n;
if (highCompression_) {
n = LZ4_compressHC(reinterpret_cast<const char*>(data->data()),
reinterpret_cast<char*>(out->writableTail()),
data->length());
n = LZ4_compress_HC(
reinterpret_cast<const char*>(data->data()),
reinterpret_cast<char*>(out->writableTail()),
data->length(),
out->tailroom(),
0);
} else {
n = LZ4_compress(reinterpret_cast<const char*>(data->data()),
reinterpret_cast<char*>(out->writableTail()),
data->length());
n = LZ4_compress_default(
reinterpret_cast<const char*>(data->data()),
reinterpret_cast<char*>(out->writableTail()),
data->length(),
out->tailroom());
}
CHECK_GE(n, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment