bench.c without dict uses ZSTD_compressCCtx

This commit is contained in:
Przemyslaw Skibinski 2016-11-18 11:46:30 +01:00
parent 3d18088b38
commit 2558b4cdbc
2 changed files with 10 additions and 1 deletions

2
.gitignore vendored
View File

@ -33,3 +33,5 @@ _zstdbench/
.DS_Store
googletest/
*.d
build/VS2010/zwrapbench/zwrapbench.vcxproj

View File

@ -213,11 +213,18 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
if (cdict==NULL) EXM_THROW(1, "ZSTD_createCDict_advanced() allocation failure");
do {
U32 blockNb;
size_t rSize;
for (blockNb=0; blockNb<nbBlocks; blockNb++) {
size_t const rSize = ZSTD_compress_usingCDict(ctx,
if (dictBufferSize) {
rSize = ZSTD_compress_usingCDict(ctx,
blockTable[blockNb].cPtr, blockTable[blockNb].cRoom,
blockTable[blockNb].srcPtr,blockTable[blockNb].srcSize,
cdict);
} else {
rSize = ZSTD_compressCCtx (ctx,
blockTable[blockNb].cPtr, blockTable[blockNb].cRoom,
blockTable[blockNb].srcPtr,blockTable[blockNb].srcSize, cLevel);
}
if (ZSTD_isError(rSize)) EXM_THROW(1, "ZSTD_compress_usingCDict() failed : %s", ZSTD_getErrorName(rSize));
blockTable[blockNb].cSize = rSize;
}