mirror of
https://github.com/facebook/zstd.git
synced 2025-10-10 00:03:36 -04:00
Init CCtx's Local Dict with CCtxParams
This commit is contained in:
parent
db2aa25252
commit
914bfe7ee4
@ -875,8 +875,6 @@ static int ZSTD_dedicatedDictSearch_isSupported(int const compressionLevel, size
|
|||||||
static size_t ZSTD_initLocalDict(ZSTD_CCtx* cctx)
|
static size_t ZSTD_initLocalDict(ZSTD_CCtx* cctx)
|
||||||
{
|
{
|
||||||
ZSTD_localDict* const dl = &cctx->localDict;
|
ZSTD_localDict* const dl = &cctx->localDict;
|
||||||
ZSTD_compressionParameters const cParams = ZSTD_getCParamsFromCCtxParams(
|
|
||||||
&cctx->requestedParams, ZSTD_CONTENTSIZE_UNKNOWN, dl->dictSize);
|
|
||||||
if (dl->dict == NULL) {
|
if (dl->dict == NULL) {
|
||||||
/* No local dictionary. */
|
/* No local dictionary. */
|
||||||
assert(dl->dictBuffer == NULL);
|
assert(dl->dictBuffer == NULL);
|
||||||
@ -893,12 +891,12 @@ static size_t ZSTD_initLocalDict(ZSTD_CCtx* cctx)
|
|||||||
assert(cctx->cdict == NULL);
|
assert(cctx->cdict == NULL);
|
||||||
assert(cctx->prefixDict.dict == NULL);
|
assert(cctx->prefixDict.dict == NULL);
|
||||||
|
|
||||||
dl->cdict = ZSTD_createCDict_advanced(
|
dl->cdict = ZSTD_createCDict_advanced2(
|
||||||
dl->dict,
|
dl->dict,
|
||||||
dl->dictSize,
|
dl->dictSize,
|
||||||
ZSTD_dlm_byRef,
|
ZSTD_dlm_byRef,
|
||||||
dl->dictContentType,
|
dl->dictContentType,
|
||||||
cParams,
|
&cctx->requestedParams,
|
||||||
cctx->customMem);
|
cctx->customMem);
|
||||||
RETURN_ERROR_IF(!dl->cdict, memory_allocation, "ZSTD_createCDict_advanced failed");
|
RETURN_ERROR_IF(!dl->cdict, memory_allocation, "ZSTD_createCDict_advanced failed");
|
||||||
cctx->cdict = dl->cdict;
|
cctx->cdict = dl->cdict;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user