]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[zstreamtest] Reduce memory of newapi tests
authorNick Terrell <terrelln@fb.com>
Thu, 27 Sep 2018 19:48:29 +0000 (12:48 -0700)
committerNick Terrell <terrelln@fb.com>
Thu, 27 Sep 2018 19:48:29 +0000 (12:48 -0700)
We could allocate up to 2^28 bytes of memory when using 2 threads with
window log = 24. Now, we limit it to 2^26 bytes of memory when not running
big tests.

I chose max window log = 22 since that is the maximum source size when
big tests are disabled. Hopefully this will be enough to reduce or
eliminate the test failures.

tests/zstreamtest.c

index 96136a6251e02a88017d6631ac0bf530313bd6ad..3959f5d7dcd6c0be38b5ed83c5a5557e015ff014 100644 (file)
@@ -1808,7 +1808,7 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest,
             }
             {   U64 const pledgedSrcSize = (FUZ_rand(&lseed) & 3) ? ZSTD_CONTENTSIZE_UNKNOWN : maxTestSize;
                 ZSTD_compressionParameters cParams = ZSTD_getCParams(cLevel, pledgedSrcSize, dictSize);
-                static const U32 windowLogMax = 24;
+                const U32 windowLogMax = bigTests ? 24 : 22;
                 if (dictSize)
                     DISPLAYLEVEL(5, "t%u: with dictionary of size : %zu \n", testNb, dictSize);