summaryrefslogtreecommitdiffstats
path: root/lib/lz4hc.h
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2018-09-18 00:22:07 (GMT)
committerYann Collet <cyan@fb.com>2018-09-18 00:31:57 (GMT)
commit6381d828fda08f9eb621265e6904d0b0dd400c31 (patch)
tree548cdca6c7632621c5bbc9c85c0e04c1d5d40202 /lib/lz4hc.h
parent7b9edd60a06072f3c69f800e59e97f788d639934 (diff)
downloadlz4-6381d828fda08f9eb621265e6904d0b0dd400c31.zip
lz4-6381d828fda08f9eb621265e6904d0b0dd400c31.tar.gz
lz4-6381d828fda08f9eb621265e6904d0b0dd400c31.tar.bz2
increase size of LZ4 contexts for 128-bit systems
Diffstat (limited to 'lib/lz4hc.h')
-rw-r--r--lib/lz4hc.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/lib/lz4hc.h b/lib/lz4hc.h
index ab796ae..4c7ba5a 100644
--- a/lib/lz4hc.h
+++ b/lib/lz4hc.h
@@ -123,12 +123,20 @@ LZ4LIB_API int LZ4_saveDictHC (LZ4_streamHC_t* streamHCPtr, char* safeBuffer, in
*/
+
+
+/*^**********************************************
+ * !!!!!! STATIC LINKING ONLY !!!!!!
+ ***********************************************/
+
/*-******************************************************************
* PRIVATE DEFINITIONS :
* Do not use these definitions directly.
* They are merely exposed to allow static allocation of `LZ4_streamHC_t`.
- * Using these definitions makes the code vulnerable to potential API/ABI break when upgrading LZ4.
+ * Declare an `LZ4_streamHC_t` directly, rather than any type below.
+ * Even then, only do so in the context of static linking, as definitions may change between versions.
********************************************************************/
+
#define LZ4HC_DICTIONARY_LOGSIZE 16
#define LZ4HC_MAXD (1<<LZ4HC_DICTIONARY_LOGSIZE)
#define LZ4HC_MAXD_MASK (LZ4HC_MAXD - 1)
@@ -177,20 +185,22 @@ struct LZ4HC_CCtx_internal
#endif
+
+/* do not use these definitions directly.
+ * allocate an LZ4_streamHC_t instead. */
#define LZ4_STREAMHCSIZE (4*LZ4HC_HASHTABLESIZE + 2*LZ4HC_MAXD + 56 + ((sizeof(void*)==16) ? 56 : 0) /* AS400*/ ) /* 262200 or 262256*/
#define LZ4_STREAMHCSIZE_SIZET (LZ4_STREAMHCSIZE / sizeof(size_t))
union LZ4_streamHC_u {
size_t table[LZ4_STREAMHCSIZE_SIZET];
LZ4HC_CCtx_internal internal_donotuse;
-}; /* previously typedef'd to LZ4_streamHC_t */
-/*
- LZ4_streamHC_t :
- This structure allows static allocation of LZ4 HC streaming state.
- State must be initialized using LZ4_resetStreamHC() before first use.
-
- Static allocation shall only be used in combination with static linking.
- When invoking LZ4 from a DLL, use create/free functions instead, which are API and ABI stable.
-*/
+}; /* previously typedef'd to LZ4_streamHC_t */
+/* LZ4_streamHC_t :
+ * This structure allows static allocation of LZ4 HC streaming state.
+ * State must be initialized using LZ4_resetStreamHC() before first use.
+ *
+ * Static allocation shall only be used in combination with static linking.
+ * When invoking LZ4 from a DLL, use create/free functions instead, which are API and ABI stable.
+ */
/*-************************************