From: Yann Collet Date: Mon, 6 Jun 2016 23:40:49 +0000 (+0200) Subject: Integrated new dictionary API into bench module X-Git-Tag: v0.7.0^2~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee1a084852aba12b370a4214b72ccf0ca459e45f;p=thirdparty%2Fzstd.git Integrated new dictionary API into bench module --- diff --git a/programs/bench.c b/programs/bench.c index ecc609d83..51d47bde1 100644 --- a/programs/bench.c +++ b/programs/bench.c @@ -216,24 +216,21 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize, UTIL_getTime(&clockStart); { U32 nbLoops = 0; + ZSTD_CDict* cdict = ZSTD_createCDict(dictBuffer, dictBufferSize, cLevel); + if (cdict==NULL) EXM_THROW(1, "ZSTD_createCDict() allocation failure"); do { U32 blockNb; - { ZSTD_parameters params; - memset(¶ms, 0, sizeof(params)); - params.cParams = ZSTD_getCParams(cLevel, blockSize, dictBufferSize); - params.fParams.contentSizeFlag = 1; - { size_t const initResult = ZSTD_compressBegin_advanced(refCtx, dictBuffer, dictBufferSize, params, blockSize); - if (ZSTD_isError(initResult)) break; - } } for (blockNb=0; blockNb