From: senhuang42 Date: Sat, 26 Sep 2020 15:24:29 +0000 (-0400) Subject: Add callsites to appropriate locations in ..opt_generic() X-Git-Tag: v1.4.7~57^2~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db7076103295969c53e42c4af964dde2a0b61613;p=thirdparty%2Fzstd.git Add callsites to appropriate locations in ..opt_generic() --- diff --git a/lib/compress/zstd_opt.c b/lib/compress/zstd_opt.c index 240b94cfa..3c3f22313 100644 --- a/lib/compress/zstd_opt.c +++ b/lib/compress/zstd_opt.c @@ -788,7 +788,7 @@ static void ldm_maybeUpdateSeqStoreReadPos() { } /* Wrapper function to call ldm functions as needed */ -static void ldm_handleLdm() { +static void ldm_handleLdm(int* nbMatches) { int noMoreLdms = getNextMatch(); } @@ -861,6 +861,7 @@ ZSTD_compressBlock_opt_generic(ZSTD_matchState_t* ms, { U32 const litlen = (U32)(ip - anchor); U32 const ll0 = !litlen; U32 const nbMatches = ZSTD_BtGetAllMatches(matches, ms, &nextToUpdate3, ip, iend, dictMode, rep, ll0, minMatch); + ldm_handleLdm(&nbMatches); if (!nbMatches) { ip++; continue; } /* initialize opt[0] */ @@ -975,6 +976,8 @@ ZSTD_compressBlock_opt_generic(ZSTD_matchState_t* ms, U32 const basePrice = previousPrice + ZSTD_litLengthPrice(0, optStatePtr, optLevel); U32 const nbMatches = ZSTD_BtGetAllMatches(matches, ms, &nextToUpdate3, inr, iend, dictMode, opt[cur].rep, ll0, minMatch); U32 matchNb; + + ldm_handleLdm(&nbMatches); if (!nbMatches) { DEBUGLOG(7, "rPos:%u : no match found", cur); continue;