diff options
author | Yann Collet <cyan@fb.com> | 2022-07-13 07:57:42 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2022-07-13 07:57:42 (GMT) |
commit | 3da483c0e62af4da75005e9eef30bad00435cb20 (patch) | |
tree | 6ad43b5f2ec7966faddc9a9ac40f9646e0defc0c | |
parent | 702c5b092b37be6236d042d15c4f0a05ac91e3f2 (diff) | |
download | lz4-3da483c0e62af4da75005e9eef30bad00435cb20.zip lz4-3da483c0e62af4da75005e9eef30bad00435cb20.tar.gz lz4-3da483c0e62af4da75005e9eef30bad00435cb20.tar.bz2 |
Re-organize state's internal to be more compact
produces less padding, notably on OS400
following #1070 by @jonrumsey
-rw-r--r-- | lib/lz4.h | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -613,11 +613,12 @@ LZ4LIB_STATIC_API void LZ4_attach_dictionary(LZ4_stream_t* workingStream, const typedef struct LZ4_stream_t_internal LZ4_stream_t_internal; struct LZ4_stream_t_internal { LZ4_u32 hashTable[LZ4_HASH_SIZE_U32]; - LZ4_u32 currentOffset; - LZ4_u32 tableType; const LZ4_byte* dictionary; const LZ4_stream_t_internal* dictCtx; + LZ4_u32 currentOffset; + LZ4_u32 tableType; LZ4_u32 dictSize; + /* Implicit padding to ensure structure is aligned */ }; #define LZ4_STREAM_MINSIZE ((1UL << LZ4_MEMORY_USAGE) + 32) /* static size, for inter-version compatibility */ @@ -640,7 +641,7 @@ union LZ4_stream_u { * In which case, the function will @return NULL. * Note2: An LZ4_stream_t structure guarantees correct alignment and size. * Note3: Before v1.9.0, use LZ4_resetStream() instead - */ +**/ LZ4LIB_API LZ4_stream_t* LZ4_initStream (void* buffer, size_t size); @@ -651,8 +652,8 @@ LZ4LIB_API LZ4_stream_t* LZ4_initStream (void* buffer, size_t size); **/ typedef struct { const LZ4_byte* externalDict; - size_t extDictSize; const LZ4_byte* prefixEnd; + size_t extDictSize; size_t prefixSize; } LZ4_streamDecode_t_internal; |