From 80e3e7034e84e7ff250d7f992ac7337551f800e8 Mon Sep 17 00:00:00 2001 From: Eddy Jansson Date: Sat, 31 Jul 2021 18:59:15 +0200 Subject: [PATCH] Define LZ4_STREAMSIZE in terms of LZ4_MEMORY_USAGE This is required to correctly size a static member to hold the hash table, whose size is derived from LZ4_MEMORY_USAGE. --- lib/lz4.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lz4.h b/lib/lz4.h index 0b11eab02..a520adc78 100644 --- a/lib/lz4.h +++ b/lib/lz4.h @@ -620,7 +620,7 @@ 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 16416 /* static size, for inter-version compatibility */ +#define LZ4_STREAMSIZE ((1UL << LZ4_MEMORY_USAGE) + 32) /* static size, for inter-version compatibility */ #define LZ4_STREAMSIZE_VOIDP (LZ4_STREAMSIZE / sizeof(void*)) union LZ4_stream_u { void* table[LZ4_STREAMSIZE_VOIDP];