mirror of
https://github.com/facebook/zstd.git
synced 2025-08-07 06:23:00 +03:00
renamed to ZWRAP_deflateReset_keepDict
This commit is contained in:
@@ -298,14 +298,14 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
|
|||||||
U32 blockNb;
|
U32 blockNb;
|
||||||
for (blockNb=0; blockNb<nbBlocks; blockNb++) {
|
for (blockNb=0; blockNb<nbBlocks; blockNb++) {
|
||||||
if (ZWRAP_isUsingZSTDcompression())
|
if (ZWRAP_isUsingZSTDcompression())
|
||||||
ret = ZWRAP_deflateResetWithoutDict(&def); /* reuse dictionary to make compression faster */
|
ret = ZWRAP_deflateReset_keepDict(&def); /* reuse dictionary to make compression faster */
|
||||||
else
|
else
|
||||||
ret = deflateReset(&def);
|
ret = deflateReset(&def);
|
||||||
if (ret != Z_OK) EXM_THROW(1, "deflateReset failure");
|
if (ret != Z_OK) EXM_THROW(1, "deflateReset failure");
|
||||||
if (useSetDict) {
|
if (useSetDict) {
|
||||||
ret = deflateSetDictionary(&def, dictBuffer, dictBufferSize);
|
ret = deflateSetDictionary(&def, dictBuffer, dictBufferSize);
|
||||||
if (ret != Z_OK) EXM_THROW(1, "deflateSetDictionary failure");
|
if (ret != Z_OK) EXM_THROW(1, "deflateSetDictionary failure");
|
||||||
if (ZWRAP_isUsingZSTDcompression()) useSetDict = 0; /* zstd doesn't require deflateSetDictionary after ZWRAP_deflateResetWithoutDict */
|
if (ZWRAP_isUsingZSTDcompression()) useSetDict = 0; /* zstd doesn't require deflateSetDictionary after ZWRAP_deflateReset_keepDict */
|
||||||
}
|
}
|
||||||
def.next_in = (const void*) blockTable[blockNb].srcPtr;
|
def.next_in = (const void*) blockTable[blockNb].srcPtr;
|
||||||
def.avail_in = blockTable[blockNb].srcSize;
|
def.avail_in = blockTable[blockNb].srcSize;
|
||||||
@@ -439,7 +439,7 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
|
|||||||
U32 blockNb;
|
U32 blockNb;
|
||||||
for (blockNb=0; blockNb<nbBlocks; blockNb++) {
|
for (blockNb=0; blockNb<nbBlocks; blockNb++) {
|
||||||
if (ZWRAP_isUsingZSTDdecompression(&inf))
|
if (ZWRAP_isUsingZSTDdecompression(&inf))
|
||||||
ret = ZWRAP_inflateResetWithoutDict(&inf); /* reuse dictionary to make decompression faster; inflate will return Z_NEED_DICT only for the first time */
|
ret = ZWRAP_inflateReset_keepDict(&inf); /* reuse dictionary to make decompression faster; inflate will return Z_NEED_DICT only for the first time */
|
||||||
else
|
else
|
||||||
ret = inflateReset(&inf);
|
ret = inflateReset(&inf);
|
||||||
if (ret != Z_OK) EXM_THROW(1, "inflateReset failure");
|
if (ret != Z_OK) EXM_THROW(1, "inflateReset failure");
|
||||||
|
@@ -203,9 +203,9 @@ ZEXTERN int ZEXPORT z_deflateInit2_ OF((z_streamp strm, int level, int method,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ZWRAP_deflateResetWithoutDict(z_streamp strm)
|
int ZWRAP_deflateReset_keepDict(z_streamp strm)
|
||||||
{
|
{
|
||||||
LOG_WRAPPERC("- ZWRAP_deflateResetWithoutDict\n");
|
LOG_WRAPPERC("- ZWRAP_deflateReset_keepDict\n");
|
||||||
if (!g_ZWRAP_useZSTDcompression)
|
if (!g_ZWRAP_useZSTDcompression)
|
||||||
return deflateReset(strm);
|
return deflateReset(strm);
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ ZEXTERN int ZEXPORT z_deflateReset OF((z_streamp strm))
|
|||||||
if (!g_ZWRAP_useZSTDcompression)
|
if (!g_ZWRAP_useZSTDcompression)
|
||||||
return deflateReset(strm);
|
return deflateReset(strm);
|
||||||
|
|
||||||
ZWRAP_deflateResetWithoutDict(strm);
|
ZWRAP_deflateReset_keepDict(strm);
|
||||||
|
|
||||||
{ ZWRAP_CCtx* zwc = (ZWRAP_CCtx*) strm->state;
|
{ ZWRAP_CCtx* zwc = (ZWRAP_CCtx*) strm->state;
|
||||||
if (zwc) zwc->comprState = 0;
|
if (zwc) zwc->comprState = 0;
|
||||||
@@ -522,9 +522,9 @@ ZEXTERN int ZEXPORT z_inflateInit2_ OF((z_streamp strm, int windowBits,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int ZWRAP_inflateResetWithoutDict(z_streamp strm)
|
int ZWRAP_inflateReset_keepDict(z_streamp strm)
|
||||||
{
|
{
|
||||||
LOG_WRAPPERD("- ZWRAP_inflateResetWithoutDict\n");
|
LOG_WRAPPERD("- ZWRAP_inflateReset_keepDict\n");
|
||||||
if (g_ZWRAPdecompressionType == ZWRAP_FORCE_ZLIB || !strm->reserved)
|
if (g_ZWRAPdecompressionType == ZWRAP_FORCE_ZLIB || !strm->reserved)
|
||||||
return inflateReset(strm);
|
return inflateReset(strm);
|
||||||
|
|
||||||
@@ -550,7 +550,7 @@ ZEXTERN int ZEXPORT z_inflateReset OF((z_streamp strm))
|
|||||||
if (g_ZWRAPdecompressionType == ZWRAP_FORCE_ZLIB || !strm->reserved)
|
if (g_ZWRAPdecompressionType == ZWRAP_FORCE_ZLIB || !strm->reserved)
|
||||||
return inflateReset(strm);
|
return inflateReset(strm);
|
||||||
|
|
||||||
{ int ret = ZWRAP_inflateResetWithoutDict(strm);
|
{ int ret = ZWRAP_inflateReset_keepDict(strm);
|
||||||
if (ret != Z_OK) return ret; }
|
if (ret != Z_OK) return ret; }
|
||||||
|
|
||||||
{ ZWRAP_DCtx* zwd = (ZWRAP_DCtx*) strm->state;
|
{ ZWRAP_DCtx* zwd = (ZWRAP_DCtx*) strm->state;
|
||||||
|
@@ -48,7 +48,7 @@ int ZWRAP_setPledgedSrcSize(z_streamp strm, unsigned long long pledgedSrcSize);
|
|||||||
/* Similar to deflateReset but preserves dictionary set using deflateSetDictionary.
|
/* Similar to deflateReset but preserves dictionary set using deflateSetDictionary.
|
||||||
It should improve compression speed because there will be less calls to deflateSetDictionary
|
It should improve compression speed because there will be less calls to deflateSetDictionary
|
||||||
When using zlib compression this method redirects to deflateReset. */
|
When using zlib compression this method redirects to deflateReset. */
|
||||||
int ZWRAP_deflateResetWithoutDict(z_streamp strm);
|
int ZWRAP_deflateReset_keepDict(z_streamp strm);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ int ZWRAP_isUsingZSTDdecompression(z_streamp strm);
|
|||||||
/* Similar to inflateReset but preserves dictionary set using inflateSetDictionary.
|
/* Similar to inflateReset but preserves dictionary set using inflateSetDictionary.
|
||||||
inflate() will return Z_NEED_DICT only for the first time what will improve decompression speed.
|
inflate() will return Z_NEED_DICT only for the first time what will improve decompression speed.
|
||||||
For zlib streams this method redirects to inflateReset. */
|
For zlib streams this method redirects to inflateReset. */
|
||||||
int ZWRAP_inflateResetWithoutDict(z_streamp strm);
|
int ZWRAP_inflateReset_keepDict(z_streamp strm);
|
||||||
|
|
||||||
|
|
||||||
#if defined (__cplusplus)
|
#if defined (__cplusplus)
|
||||||
|
Reference in New Issue
Block a user