From 0002563be823ed65149ea7aa64654f3ce13c0e5b Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Fri, 21 Aug 2020 19:23:49 -0700 Subject: removed LZ4_compress_fast_force() which serves no more purpose. The comment implies that the simple presence of this unused function was affecting performance, and that's the reason why it was not removed earlier. This is likely another side effect of instruction alignment. It's obviously unreliable to rely on it in this way, meaning that the impact will be different, positive of negative, with any minor code change, and any minor compiler version change, even parameter change. --- lib/lz4.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/lz4.c b/lib/lz4.c index 1cd7322..70324e2 100644 --- a/lib/lz4.c +++ b/lib/lz4.c @@ -1288,22 +1288,6 @@ int LZ4_compress_default(const char* src, char* dst, int srcSize, int maxOutputS } -/* hidden debug function */ -/* strangely enough, gcc generates faster code when this function is uncommented, even if unused */ -int LZ4_compress_fast_force(const char* src, char* dst, int srcSize, int dstCapacity, int acceleration) -{ - LZ4_stream_t ctx; - LZ4_initStream(&ctx, sizeof(ctx)); - - if (srcSize < LZ4_64Klimit) { - return LZ4_compress_generic(&ctx.internal_donotuse, src, dst, srcSize, NULL, dstCapacity, limitedOutput, byU16, noDict, noDictIssue, acceleration); - } else { - tableType_t const addrMode = (sizeof(void*) > 4) ? byU32 : byPtr; - return LZ4_compress_generic(&ctx.internal_donotuse, src, dst, srcSize, NULL, dstCapacity, limitedOutput, addrMode, noDict, noDictIssue, acceleration); - } -} - - /* Note!: This function leaves the stream in an unclean/broken state! * It is not safe to subsequently use the same state with a _fastReset() or * _continue() call without resetting it. */ -- cgit v0.12