From: Sean Purcell Date: Thu, 2 Mar 2017 23:15:31 +0000 (-0800) Subject: Remove 'generic' inline strategy X-Git-Tag: v1.1.4~1^2~23^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F582%2Fhead;p=thirdparty%2Fzstd.git Remove 'generic' inline strategy Seems to avoid performance loss for compression. Same strategy tested on decompression side, did not appear to improve speed. --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 5d81f8a38..6b8047206 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -576,11 +576,11 @@ void ZSTD_seqToCodes(const seqStore_t* seqStorePtr) mlCodeTable[seqStorePtr->longLengthPos] = MaxML; } - -FORCE_INLINE size_t ZSTD_compressSequences_generic (ZSTD_CCtx* zc, +MEM_STATIC size_t ZSTD_compressSequences (ZSTD_CCtx* zc, void* dst, size_t dstCapacity, - size_t srcSize, int const longOffsets) + size_t srcSize) { + const int longOffsets = zc->params.cParams.windowLog > STREAM_ACCUMULATOR_MIN; const seqStore_t* seqStorePtr = &(zc->seqStore); U32 count[MaxSeq+1]; S16 norm[MaxSeq+1]; @@ -782,17 +782,6 @@ _check_compressibility: return op - ostart; } -FORCE_INLINE size_t ZSTD_compressSequences (ZSTD_CCtx* zc, - void* dst, size_t dstCapacity, - size_t srcSize) -{ - if (zc->params.cParams.windowLog > STREAM_ACCUMULATOR_MIN) { - return ZSTD_compressSequences_generic(zc, dst, dstCapacity, srcSize, 1); - } else { - return ZSTD_compressSequences_generic(zc, dst, dstCapacity, srcSize, 0); - } -} - #if 0 /* for debug */ # define STORESEQ_DEBUG #include /* fprintf */