diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-03-15 09:11:31 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-03-15 09:11:31 +0100 |
commit | 82b361dc4463b13ebda30090e239db487f5aa308 (patch) | |
tree | fdc6fd06e695188735d636da57b02b6c7e0c1c5f /mfbt/Compression.cpp | |
parent | 4bb98e2b61ce75d7f5d19398b658441a7ceed04b (diff) | |
parent | 71429dc7ecc496c5924c770746e8c28449ecb7a2 (diff) | |
download | UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar.gz UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar.lz UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar.xz UXP-82b361dc4463b13ebda30090e239db487f5aa308.zip |
Merge branch 'ported-upstream'
Diffstat (limited to 'mfbt/Compression.cpp')
-rw-r--r-- | mfbt/Compression.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mfbt/Compression.cpp b/mfbt/Compression.cpp index c114c6c0f..6be8020a9 100644 --- a/mfbt/Compression.cpp +++ b/mfbt/Compression.cpp @@ -16,8 +16,12 @@ using namespace mozilla::Compression; namespace { +extern "C" { + #include "lz4.c" +} + }/* anonymous namespace */ /* Our wrappers */ @@ -27,7 +31,8 @@ LZ4::compress(const char* aSource, size_t aInputSize, char* aDest) { CheckedInt<int> inputSizeChecked = aInputSize; MOZ_ASSERT(inputSizeChecked.isValid()); - return LZ4_compress(aSource, aDest, inputSizeChecked.value()); + return LZ4_compress_default(aSource, aDest, inputSizeChecked.value(), + LZ4_compressBound(inputSizeChecked.value())); } size_t @@ -38,8 +43,8 @@ LZ4::compressLimitedOutput(const char* aSource, size_t aInputSize, char* aDest, MOZ_ASSERT(inputSizeChecked.isValid()); CheckedInt<int> maxOutputSizeChecked = aMaxOutputSize; MOZ_ASSERT(maxOutputSizeChecked.isValid()); - return LZ4_compress_limitedOutput(aSource, aDest, inputSizeChecked.value(), - maxOutputSizeChecked.value()); + return LZ4_compress_default(aSource, aDest, inputSizeChecked.value(), + maxOutputSizeChecked.value()); } bool |