Add callsites to appropriate locations in ..opt_generic()

dev
senhuang42 2020-09-26 11:24:29 -04:00
parent aea61e3c91
commit db70761032
1 changed files with 4 additions and 1 deletions

View File

@ -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;