disable shortcut for LZ4_decompress_fast()

improving speed
This commit is contained in:
Cyan4973 2018-04-23 15:47:08 -07:00
parent bd06fde104
commit cd0663456f

View File

@ -1536,9 +1536,10 @@ LZ4_FORCE_INLINE int LZ4_decompress_generic(
* this shortcut was tested on x86 and x64, where it improves decoding speed. * this shortcut was tested on x86 and x64, where it improves decoding speed.
* it has not yet been benchmarked on ARM, Power, mips, etc. * it has not yet been benchmarked on ARM, Power, mips, etc.
* NOTE: The loop begins with a read, so we must have one byte left at the end. */ * NOTE: The loop begins with a read, so we must have one byte left at the end. */
if (((ip + 14 /*maxLL*/ + 2 /*offset*/ < iend) if (endOnInput
& (op + 14 /*maxLL*/ + 18 /*maxML*/ <= oend)) && ((ip + 14 /*maxLL*/ + 2 /*offset*/ < iend)
& ((token < (15<<ML_BITS)) & ((token & ML_MASK) != 15)) ) { & (op + 14 /*maxLL*/ + 18 /*maxML*/ <= oend))
& ((token < (15<<ML_BITS)) & ((token & ML_MASK) != 15)) ) {
size_t const ll = token >> ML_BITS; size_t const ll = token >> ML_BITS;
size_t const off = LZ4_readLE16(ip+ll); size_t const off = LZ4_readLE16(ip+ll);
const BYTE* const matchPtr = op + ll - off; /* pointer underflow risk ? */ const BYTE* const matchPtr = op + ll - off; /* pointer underflow risk ? */