From: Yann Collet Date: Fri, 21 Apr 2017 06:09:39 +0000 (-0700) Subject: made some room for entropy scratch space X-Git-Tag: v1.2.0^2~26^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a408645f500078c903bf0c73ec760bffc866ef0b;p=thirdparty%2Fzstd.git made some room for entropy scratch space --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 783d2661f..63266df93 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -32,6 +32,7 @@ static size_t const hufCTable_size = HUF_CTABLE_SIZE(255); static size_t const litlengthCTable_size = FSE_CTABLE_SIZE_U32(LLFSELog, MaxLL) * sizeof(FSE_CTable); static size_t const offcodeCTable_size = FSE_CTABLE_SIZE_U32(OffFSELog, MaxOff) * sizeof(FSE_CTable); static size_t const matchlengthCTable_size = FSE_CTABLE_SIZE_U32(MLFSELog, MaxML) * sizeof(FSE_CTable); +static size_t const entropyScratchSpace = HUF_WORKSPACE_SIZE; /*-************************************* @@ -223,7 +224,8 @@ size_t ZSTD_estimateCCtxSize(ZSTD_compressionParameters cParams) U32 const hashLog3 = (cParams.searchLength>3) ? 0 : MIN(ZSTD_HASHLOG3_MAX, cParams.windowLog); size_t const h3Size = ((size_t)1) << hashLog3; size_t const entropySpace = hufCTable_size + litlengthCTable_size - + offcodeCTable_size + matchlengthCTable_size; + + offcodeCTable_size + matchlengthCTable_size + + entropyScratchSpace; size_t const tableSpace = (chainSize + hSize + h3Size) * sizeof(U32); size_t const optSpace = ((MaxML+1) + (MaxLL+1) + (MaxOff+1) + (1<