summaryrefslogtreecommitdiffstats
path: root/lib/lz4hc.h
diff options
context:
space:
mode:
authorW. Felix Handte <w@felixhandte.com>2018-03-19 17:16:05 (GMT)
committerW. Felix Handte <w@felixhandte.com>2018-04-20 00:54:35 (GMT)
commitf895b9a6c69a059e62de8baca39b878ed1031418 (patch)
treeb9e3025104982a5293562f11aaf7e1b1ab9fe8b9 /lib/lz4hc.h
parente75153f508073d87e7087e8ef472879773f116f8 (diff)
downloadlz4-f895b9a6c69a059e62de8baca39b878ed1031418.zip
lz4-f895b9a6c69a059e62de8baca39b878ed1031418.tar.gz
lz4-f895b9a6c69a059e62de8baca39b878ed1031418.tar.bz2
Add a Dictionary Context Pointer to the HC Context
Diffstat (limited to 'lib/lz4hc.h')
-rw-r--r--lib/lz4hc.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/lz4hc.h b/lib/lz4hc.h
index 7a25bee..1b08425 100644
--- a/lib/lz4hc.h
+++ b/lib/lz4hc.h
@@ -141,7 +141,8 @@ LZ4LIB_API int LZ4_saveDictHC (LZ4_streamHC_t* streamHCPtr, char* safeBuffer, in
#if defined(__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)
#include <stdint.h>
-typedef struct
+typedef struct LZ4HC_CCtx_internal LZ4HC_CCtx_internal;
+struct LZ4HC_CCtx_internal
{
uint32_t hashTable[LZ4HC_HASHTABLESIZE];
uint16_t chainTable[LZ4HC_MAXD];
@@ -153,11 +154,13 @@ typedef struct
uint32_t lowLimit; /* below that point, no more dict */
uint32_t nextToUpdate; /* index from which to continue dictionary update */
int compressionLevel;
-} LZ4HC_CCtx_internal;
+ const LZ4HC_CCtx_internal* dictCtx;
+};
#else
-typedef struct
+typedef struct LZ4HC_CCtx_internal LZ4HC_CCtx_internal;
+struct LZ4HC_CCtx_internal
{
unsigned int hashTable[LZ4HC_HASHTABLESIZE];
unsigned short chainTable[LZ4HC_MAXD];
@@ -169,11 +172,12 @@ typedef struct
unsigned int lowLimit; /* below that point, no more dict */
unsigned int nextToUpdate; /* index from which to continue dictionary update */
int compressionLevel;
-} LZ4HC_CCtx_internal;
+ const LZ4HC_CCtx_internal* dictCtx;
+};
#endif
-#define LZ4_STREAMHCSIZE (4*LZ4HC_HASHTABLESIZE + 2*LZ4HC_MAXD + 56) /* 262200 */
+#define LZ4_STREAMHCSIZE (4*LZ4HC_HASHTABLESIZE + 2*LZ4HC_MAXD + 64) /* 262200 */
#define LZ4_STREAMHCSIZE_SIZET (LZ4_STREAMHCSIZE / sizeof(size_t))
union LZ4_streamHC_u {
size_t table[LZ4_STREAMHCSIZE_SIZET];