Merge pull request #3209 from zhuhan0/dev

[largeNbDicts] Second try at fixing decompression segfault to always create compressInstructions
This commit is contained in:
Elliot Gorokhovsky 2022-07-26 13:19:38 -04:00 committed by GitHub
commit bef1d9a831
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -582,6 +582,7 @@ compressInstructions createCompressInstructions(cdict_collection_t dictionaries,
compressInstructions ci; compressInstructions ci;
ci.cctx = ZSTD_createCCtx(); ci.cctx = ZSTD_createCCtx();
CONTROL(ci.cctx != NULL); CONTROL(ci.cctx != NULL);
if (cctxParams)
ZSTD_CCtx_setParametersUsingCCtxParams(ci.cctx, cctxParams); ZSTD_CCtx_setParametersUsingCCtxParams(ci.cctx, cctxParams);
ci.nbDicts = dictionaries.nbCDict; ci.nbDicts = dictionaries.nbCDict;
ci.dictNb = 0; ci.dictNb = 0;
@ -697,9 +698,8 @@ static int benchMem(slice_collection_t dstBlocks, slice_collection_t srcBlocks,
BMK_createTimedFnState(total_time_ms, ms_per_round); BMK_createTimedFnState(total_time_ms, ms_per_round);
decompressInstructions di = createDecompressInstructions(ddictionaries); decompressInstructions di = createDecompressInstructions(ddictionaries);
compressInstructions ci; compressInstructions ci =
if (benchCompression) createCompressInstructions(cdictionaries, cctxParams);
ci = createCompressInstructions(cdictionaries, cctxParams);
void* payload = benchCompression ? (void*)&ci : (void*)&di; void* payload = benchCompression ? (void*)&ci : (void*)&di;
BMK_benchParams_t const bp = { BMK_benchParams_t const bp = {
.benchFn = benchCompression ? compress : decompress, .benchFn = benchCompression ? compress : decompress,