updated ZSTD_estimate?DictSize() to pass parameter byReference
resulting ?Dict object is smaller when created byReference. Seems better than a documentation note.
This commit is contained in:
@@ -2053,10 +2053,10 @@ size_t ZSTD_freeDDict(ZSTD_DDict* ddict)
|
||||
|
||||
/*! ZSTD_estimateDDictSize() :
|
||||
* Estimate amount of memory that will be needed to create a dictionary for decompression.
|
||||
* Note : if dictionary is created "byReference", reduce this amount by dictSize */
|
||||
size_t ZSTD_estimateDDictSize(size_t dictSize)
|
||||
* Note : dictionary created "byReference" are smaller */
|
||||
size_t ZSTD_estimateDDictSize(size_t dictSize, unsigned byReference)
|
||||
{
|
||||
return dictSize + sizeof(ZSTD_DDict);
|
||||
return sizeof(ZSTD_DDict) + (byReference ? 0 : dictSize);
|
||||
}
|
||||
|
||||
size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict)
|
||||
|
||||
Reference in New Issue
Block a user