Permalink
Browse files

fixed ZSTD_sizeof_?Dict()

  • Loading branch information...
1 parent 63fcb87 commit aca113f4f58791ace39e1d9e733f78ed60449eb7 @Cyan4973 Cyan4973 committed Dec 23, 2016
Showing with 5 additions and 5 deletions.
  1. +1 −0 NEWS
  2. +2 −3 lib/compress/zstd_compress.c
  3. +1 −1 lib/decompress/zstd_decompress.c
  4. +1 −1 lib/dictBuilder/zdict.c
View
@@ -1,5 +1,6 @@
v1.1.3
cli : new : advanced commands for detailed parameters, by Przemyslaw Skibinski
+cli : fix zstdless on Mac OS-X, by Andrew Janke
API : fix : all symbols properly exposed in libzstd, by Nick Terrell
API : new : ZSTD_create?Dict_byReference(), requested by Bartosz Taudul
API : new : ZDICT_finalizeDictionary()
@@ -51,8 +51,7 @@ static void ZSTD_resetSeqStore(seqStore_t* ssPtr)
/*-*************************************
* Context memory management
***************************************/
-struct ZSTD_CCtx_s
-{
+struct ZSTD_CCtx_s {
const BYTE* nextSrc; /* next block here to continue on current prefix */
const BYTE* base; /* All regular indexes relative to this position */
const BYTE* dictBase; /* extDict indexes relative to this position */
@@ -2742,7 +2741,7 @@ struct ZSTD_CDict_s {
size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict)
{
if (cdict==NULL) return 0; /* support sizeof on NULL */
- return ZSTD_sizeof_CCtx(cdict->refContext) + cdict->dictContentSize;
+ return ZSTD_sizeof_CCtx(cdict->refContext) + (cdict->dictBuffer ? cdict->dictContentSize : 0) + sizeof(*cdict);
}
ZSTD_CDict* ZSTD_createCDict_advanced(const void* dictBuffer, size_t dictSize, unsigned byReference,
@@ -1792,7 +1792,7 @@ size_t ZSTD_freeDDict(ZSTD_DDict* ddict)
size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict)
{
if (ddict==NULL) return 0; /* support sizeof on NULL */
- return sizeof(*ddict) + sizeof(ddict->refContext) + ddict->dictSize;
+ return sizeof(*ddict) + ZSTD_sizeof_DCtx(ddict->refContext) + (ddict->dictBuffer ? ddict->dictSize : 0) ;
}
/*! ZSTD_getDictID_fromDict() :
@@ -60,7 +60,7 @@
#define NOISELENGTH 32
#define MINRATIO 4
-static const int g_compressionLevel_default = 5;
+static const int g_compressionLevel_default = 6;
static const U32 g_selectivity_default = 9;
static const size_t g_provision_entropySize = 200;
static const size_t g_min_fast_dictContent = 192;

0 comments on commit aca113f

Please sign in to comment.