Skip to content

Commit

Permalink
Define LZ4_STREAMSIZE in terms of LZ4_MEMORY_USAGE
Browse files Browse the repository at this point in the history
This is required to correctly size a static member
to hold the hash table, whose size is derived from
LZ4_MEMORY_USAGE.
  • Loading branch information
eloj committed Jul 31, 2021
1 parent 4de56b3 commit 80e3e70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/lz4.h
Expand Up @@ -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];
Expand Down

0 comments on commit 80e3e70

Please sign in to comment.