ZSTD_CCtx_params params,
unsigned long long pledgedSrcSize);
+/* INTERNAL */
+ZSTD_CDict* ZSTD_createCDict_advanced_opaque(
+ const void* dictBuffer, size_t dictSize,
+ ZSTD_CCtx_params params, ZSTD_customMem customMem);
+
/*! ZSTD_compressStream_generic() :
* Private use only. To be called from zstdmt_compress.c in single-thread mode. */
size_t ZSTD_compressStream_generic(ZSTD_CStream* zcs,
}
#endif
-static ZSTD_CDict* ZSTD_createCDict_advanced_opaque(
+/* Internal only */
+ZSTD_CDict* ZSTD_createCDict_advanced_opaque(
const void* dictBuffer, size_t dictSize,
ZSTD_CCtx_params params, ZSTD_customMem customMem)
{
}
cdict->refContext = cctx;
+ /* TODO: What should be zero? */
if (ZSTD_isError( ZSTD_initCDict_internal_opaque(
cdict,
dictBuffer, dictSize,
return ERROR(memory_allocation);
}
ZSTD_freeCDict(zcs->cdictLocal);
- zcs->cdictLocal = ZSTD_createCDict_advanced(dict, dictSize,
- params.dictContentByRef,
- params.dictMode,
- params.cParams, zcs->customMem);
+ /* TODO opaque version: what needs to be zero? */
+ zcs->cdictLocal = ZSTD_createCDict_advanced_opaque(
+ dict, dictSize,
+ params, zcs->customMem);
zcs->cdict = zcs->cdictLocal;
if (zcs->cdictLocal == NULL) return ERROR(memory_allocation);
} else {
{
params->forceWindow = 0;
params->dictMode = (ZSTD_dictMode_e)(0);
+ params->dictContentByRef = 0;
params->nbThreads = 0;
params->jobSize = 0;
params->overlapSizeLog = 0;
const ZSTD_CDict* cdict, ZSTD_CCtx_params cctxParams,
unsigned long long pledgedSrcSize)
{
- ZSTD_parameters params;
- params.cParams = cctxParams.cParams;
- params.fParams = cctxParams.fParams;
-
DEBUGLOG(4, "ZSTDMT_initCStream_internal");
/* params are supposed to be fully validated at this point */
- assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams)));
+ assert(!ZSTD_isError(ZSTD_checkCParams(cctxParams.cParams)));
assert(!((dict) && (cdict))); /* either dict or cdict, not both */
/* TODO: Set stuff to 0 to preserve old semantics. */
if (dict) {
DEBUGLOG(4,"cdictLocal: %08X", (U32)(size_t)zcs->cdictLocal);
ZSTD_freeCDict(zcs->cdictLocal);
- /* TODO: This will need a cctxParam version? */
- zcs->cdictLocal = ZSTD_createCDict_advanced(dict, dictSize,
- 0 /* byRef */, ZSTD_dm_auto, /* note : a loadPrefix becomes an internal CDict */
- params.cParams, zcs->cMem);
+ /* TODO: cctxParam version? Is this correct?
+ * by reference should be zero, mode should be ZSTD_dm_auto */
+ zcs->cdictLocal = ZSTD_createCDict_advanced_opaque(
+ dict, dictSize,
+ cctxParams, zcs->cMem);
zcs->cdict = zcs->cdictLocal;
if (zcs->cdictLocal == NULL) return ERROR(memory_allocation);
} else {
zcs->nextJobID = 0;
zcs->frameEnded = 0;
zcs->allJobsCompleted = 0;
- if (params.fParams.checksumFlag) XXH64_reset(&zcs->xxhState, 0);
+ if (cctxParams.fParams.checksumFlag) XXH64_reset(&zcs->xxhState, 0);
return 0;
}