diff --git a/lib/compress/zstdmt_compress.h b/lib/compress/zstdmt_compress.h index 91b489b9cb4..acd4d12438c 100644 --- a/lib/compress/zstdmt_compress.h +++ b/lib/compress/zstdmt_compress.h @@ -32,8 +32,8 @@ #ifndef ZSTDMT_JOBSIZE_MIN /* a different value can be selected at compile time */ # define ZSTDMT_JOBSIZE_MIN (512 KB) #endif -#define ZSTDMT_JOBLOG_MAX (MEM_32bits() ? 29 : 30) -#define ZSTDMT_JOBSIZE_MAX (MEM_32bits() ? (512 MB) : (1024 MB)) +#define ZSTDMT_JOBLOG_MAX (MEM_32bits() ? 28 : 30) +#define ZSTDMT_JOBSIZE_MAX (MEM_32bits() ? (256 MB) : (1024 MB)) /* ======================================================== diff --git a/tests/fuzzer.c b/tests/fuzzer.c index 7b7c9d66631..dc587bb2c74 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -3907,6 +3907,19 @@ static int basicUnitTests(U32 const seed, double compressibility) } } + DISPLAYLEVEL(3, "test%3i : job size bounds match architecture : ", testNb++); + { ZSTD_bounds const bounds = ZSTD_cParam_getBounds(ZSTD_c_jobSize); +#ifdef ZSTD_MULTITHREAD + int const expectedJobSizeMax = MEM_32bits() ? (256 MB) : (1024 MB); +#else + int const expectedJobSizeMax = 0; +#endif + CHECK_Z(bounds.error); + if (bounds.lowerBound != 0) goto _output_error; + if (bounds.upperBound != expectedJobSizeMax) goto _output_error; + } + DISPLAYLEVEL(3, "OK \n"); + /* advanced parameters for decompression */ { ZSTD_DCtx* const dctx = ZSTD_createDCtx(); assert(dctx != NULL);