From 31e581bf653516089f79b0fdbe268fc8392fd3fe Mon Sep 17 00:00:00 2001 From: Bimba Shrestha Date: Thu, 11 Jun 2020 18:34:14 -0700 Subject: [PATCH] adding enableDedicatedDictSearch to matchState_t --- lib/compress/zstd_compress.c | 4 +++- lib/compress/zstd_compress_internal.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 00a31e85..31c49a9c 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -3491,8 +3491,10 @@ ZSTDLIB_API ZSTD_CDict* ZSTD_createCDict_advanced2(const void* dict, size_t dict { ZSTD_compressionParameters const cParams = ZSTD_dedicatedDictSearch_getCParams( cctxParams.compressionLevel, dictSize); - return ZSTD_createCDict_advanced(dict, dictSize, + ZSTD_CDict* const cdict = ZSTD_createCDict_advanced(dict, dictSize, dictLoadMethod, dictContentType, cParams, customMem); + cdict->matchState.enableDedicatedDictSearch = enableDedicatedDictSearch; + return cdict; } } diff --git a/lib/compress/zstd_compress_internal.h b/lib/compress/zstd_compress_internal.h index fe5b0f2d..812dd7ac 100644 --- a/lib/compress/zstd_compress_internal.h +++ b/lib/compress/zstd_compress_internal.h @@ -153,6 +153,7 @@ struct ZSTD_matchState_t { U32* hashTable; U32* hashTable3; U32* chainTable; + int enableDedicatedDictSearch; optState_t opt; /* optimal parser state */ const ZSTD_matchState_t* dictMatchState; ZSTD_compressionParameters cParams;