added ZSTD_estimateDCtxSize()
This commit is contained in:
+9
-5
@@ -265,7 +265,7 @@ typedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; v
|
|||||||
/*! ZSTD_estimateCCtxSize() :
|
/*! ZSTD_estimateCCtxSize() :
|
||||||
* Gives the amount of memory allocated for a ZSTD_CCtx given a set of compression parameters.
|
* Gives the amount of memory allocated for a ZSTD_CCtx given a set of compression parameters.
|
||||||
* `frameContentSize` is an optional parameter, provide `0` if unknown */
|
* `frameContentSize` is an optional parameter, provide `0` if unknown */
|
||||||
size_t ZSTD_estimateCCtxSize(ZSTD_compressionParameters cParams, unsigned long long frameContentSize);
|
ZSTDLIB_API size_t ZSTD_estimateCCtxSize(ZSTD_compressionParameters cParams, unsigned long long frameContentSize);
|
||||||
|
|
||||||
/*! ZSTD_createCCtx_advanced() :
|
/*! ZSTD_createCCtx_advanced() :
|
||||||
* Create a ZSTD compression context using external alloc and free functions */
|
* Create a ZSTD compression context using external alloc and free functions */
|
||||||
@@ -278,7 +278,7 @@ ZSTDLIB_API ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictS
|
|||||||
|
|
||||||
/*! ZSTD_sizeofCCtx() :
|
/*! ZSTD_sizeofCCtx() :
|
||||||
* Gives the amount of memory used by a given ZSTD_CCtx */
|
* Gives the amount of memory used by a given ZSTD_CCtx */
|
||||||
size_t ZSTD_sizeofCCtx(const ZSTD_CCtx* cctx);
|
ZSTDLIB_API size_t ZSTD_sizeofCCtx(const ZSTD_CCtx* cctx);
|
||||||
|
|
||||||
ZSTDLIB_API unsigned ZSTD_maxCLevel (void);
|
ZSTDLIB_API unsigned ZSTD_maxCLevel (void);
|
||||||
|
|
||||||
@@ -312,13 +312,17 @@ ZSTDLIB_API size_t ZSTD_compress_advanced (ZSTD_CCtx* ctx,
|
|||||||
|
|
||||||
/*--- Advanced Decompression functions ---*/
|
/*--- Advanced Decompression functions ---*/
|
||||||
|
|
||||||
|
/*! ZSTD_estimateDCtxSize() :
|
||||||
|
* Gives the potential amount of memory allocated to create a ZSTD_DCtx */
|
||||||
|
ZSTDLIB_API size_t ZSTD_estimateDCtxSize(void);
|
||||||
|
|
||||||
/*! ZSTD_createDCtx_advanced() :
|
/*! ZSTD_createDCtx_advanced() :
|
||||||
* Create a ZSTD decompression context using external alloc and free functions */
|
* Create a ZSTD decompression context using external alloc and free functions */
|
||||||
ZSTDLIB_API ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem);
|
ZSTDLIB_API ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem);
|
||||||
|
|
||||||
/*! ZSTD_sizeofCCtx() :
|
/*! ZSTD_sizeofDCtx() :
|
||||||
* Gives the amount of memory used by a given ZSTD_CCtx */
|
* Gives the amount of memory used by a given ZSTD_DCtx */
|
||||||
size_t ZSTD_sizeofDCtx(const ZSTD_DCtx* dctx);
|
ZSTDLIB_API size_t ZSTD_sizeofDCtx(const ZSTD_DCtx* dctx);
|
||||||
|
|
||||||
|
|
||||||
/* ****************************************************************
|
/* ****************************************************************
|
||||||
|
|||||||
@@ -137,6 +137,8 @@ struct ZSTD_DCtx_s
|
|||||||
|
|
||||||
size_t ZSTD_sizeofDCtx (const ZSTD_DCtx* dctx) { return sizeof(*dctx); }
|
size_t ZSTD_sizeofDCtx (const ZSTD_DCtx* dctx) { return sizeof(*dctx); }
|
||||||
|
|
||||||
|
size_t ZSTD_estimateDCtxSize(void) { return sizeof(ZSTD_DCtx); }
|
||||||
|
|
||||||
size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx)
|
size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx)
|
||||||
{
|
{
|
||||||
dctx->expected = ZSTD_frameHeaderSize_min;
|
dctx->expected = ZSTD_frameHeaderSize_min;
|
||||||
|
|||||||
Reference in New Issue
Block a user