]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Merge pull request #1317 from felixhandte/split-logs
authorYann Collet <Cyan4973@users.noreply.github.com>
Tue, 2 Oct 2018 00:20:12 +0000 (17:20 -0700)
committerGitHub <noreply@github.com>
Tue, 2 Oct 2018 00:20:12 +0000 (17:20 -0700)
Independent Dictionary and Working Context Table Logs

1  2 
lib/compress/zstd_compress.c

index 5e0fb371c87d09d165a2223a90a8150bfc7fa780,6efffefbaf0e4c88fdaf54a20f92456deb7bc000..5f6280a8f7ccbb35bca34ed60538cd432e23c250
@@@ -2354,10 -2424,12 +2425,13 @@@ static size_t ZSTD_compressBlock_intern
                  dstCapacity, ms->window.dictLimit, ms->nextToUpdate);
      assert(srcSize <= ZSTD_BLOCKSIZE_MAX);
  
+     /* Assert that we have correctly flushed the ctx params into the ms's copy */
+     ZSTD_assertEqualCParams(zc->appliedParams.cParams, ms->cParams);
      if (srcSize < MIN_CBLOCK_SIZE+ZSTD_blockHeaderSize+1) {
          ZSTD_ldm_skipSequences(&zc->externSeqStore, srcSize, zc->appliedParams.cParams.searchLength);
 -        return 0;   /* don't even attempt compression below a certain srcSize */
 +        cSize = 0;
 +        goto out;  /* don't even attempt compression below a certain srcSize */
      }
      ZSTD_resetSeqStore(&(zc->seqStore));
      ms->opt.symbolCosts = &zc->blockState.prevCBlock->entropy;   /* required for optimal parser to read stats from dictionary */