]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
added comment about minimum size of FSE tables 1310/head
authorYann Collet <cyan@fb.com>
Mon, 10 Sep 2018 18:24:17 +0000 (11:24 -0700)
committerYann Collet <cyan@fb.com>
Mon, 10 Sep 2018 18:24:17 +0000 (11:24 -0700)
required for DDict creation,
which use this space as workspace during Hufman table building stage.

lib/decompress/zstd_decompress.c

index 35ed7c59a8e326efcbfc9117b4d4dd3c89e92415..d78a286f692e3d5a47e1da9744285b84866695ab 100644 (file)
@@ -110,9 +110,9 @@ typedef struct {
 #define SEQSYMBOL_TABLE_SIZE(log)   (1 + (1 << (log)))
 
 typedef struct {
-    ZSTD_seqSymbol LLTable[SEQSYMBOL_TABLE_SIZE(LLFSELog)];
-    ZSTD_seqSymbol OFTable[SEQSYMBOL_TABLE_SIZE(OffFSELog)];
-    ZSTD_seqSymbol MLTable[SEQSYMBOL_TABLE_SIZE(MLFSELog)];
+    ZSTD_seqSymbol LLTable[SEQSYMBOL_TABLE_SIZE(LLFSELog)];    /* Note : Space reserved for FSE Tables */
+    ZSTD_seqSymbol OFTable[SEQSYMBOL_TABLE_SIZE(OffFSELog)];   /* is also used as temporary workspace while building hufTable during DDict creation */
+    ZSTD_seqSymbol MLTable[SEQSYMBOL_TABLE_SIZE(MLFSELog)];    /* and therefore must be at least HUF_DECOMPRESS_WORKSPACE_SIZE large */
     HUF_DTable hufTable[HUF_DTABLE_SIZE(HufLog)];  /* can accommodate HUF_decompress4X */
     U32 rep[ZSTD_REP_NUM];
 } ZSTD_entropyDTables_t;