diff options
author | Yann Collet <cyan@fb.com> | 2020-11-06 18:26:13 -0800 |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2020-11-06 18:26:13 -0800 |
commit | 67e661a2ad39258bcb5c6fcc31c9239ff3aabc71 (patch) | |
tree | bc1565db96c5aeeb2030ca4b3a8b6caf440a75e4 | |
parent | 211d653ff866ee98a51ab135067369f52f6bdc7b (diff) | |
download | lz4-67e661a2ad39258bcb5c6fcc31c9239ff3aabc71.tar.gz lz4-67e661a2ad39258bcb5c6fcc31c9239ff3aabc71.tar.bz2 lz4-67e661a2ad39258bcb5c6fcc31c9239ff3aabc71.zip |
static state size
for better inter-version compatibility
-rw-r--r-- | lib/lz4.h | 4 | ||||
-rw-r--r-- | lib/lz4hc.h | 4 |
2 files changed, 4 insertions, 4 deletions
@@ -620,8 +620,8 @@ typedef struct { * note : only use this definition in association with static linking ! * this definition is not API/ABI safe, and may change in future versions. */ -#define LZ4_STREAMSIZE_VOIDP ((sizeof(LZ4_stream_t_internal) + sizeof(void*)-1) / sizeof(void*)) -#define LZ4_STREAMSIZE (LZ4_STREAMSIZE_VOIDP * sizeof(void*)) +#define LZ4_STREAMSIZE 16416 /* static size, for inter-version compatibility */ +#define LZ4_STREAMSIZE_VOIDP (LZ4_STREAMSIZE / sizeof(void*)) union LZ4_stream_u { void* table[LZ4_STREAMSIZE_VOIDP]; LZ4_stream_t_internal internal_donotuse; diff --git a/lib/lz4hc.h b/lib/lz4hc.h index 228bb11..3d441fb 100644 --- a/lib/lz4hc.h +++ b/lib/lz4hc.h @@ -220,8 +220,8 @@ struct LZ4HC_CCtx_internal /* Do not use these definitions directly ! * Declare or allocate an LZ4_streamHC_t instead. */ -#define LZ4_STREAMHCSIZE_VOIDP ((sizeof(LZ4HC_CCtx_internal) + sizeof(void*)-1) / sizeof(void*)) -#define LZ4_STREAMHCSIZE (LZ4_STREAMHCSIZE_VOIDP * sizeof(void*)) +#define LZ4_STREAMHCSIZE 262200 /* static size, for inter-version compatibility */ +#define LZ4_STREAMHCSIZE_VOIDP (LZ4_STREAMHCSIZE / sizeof(void*)) union LZ4_streamHC_u { void* table[LZ4_STREAMHCSIZE_VOIDP]; LZ4HC_CCtx_internal internal_donotuse; |