summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2022-07-13 08:58:01 (GMT)
committerGitHub <noreply@github.com>2022-07-13 08:58:01 (GMT)
commitf294fabef6bac63d6eb0e2f8cbbf9c7d9d47e485 (patch)
tree6ad43b5f2ec7966faddc9a9ac40f9646e0defc0c
parent702c5b092b37be6236d042d15c4f0a05ac91e3f2 (diff)
parent3da483c0e62af4da75005e9eef30bad00435cb20 (diff)
downloadlz4-f294fabef6bac63d6eb0e2f8cbbf9c7d9d47e485.zip
lz4-f294fabef6bac63d6eb0e2f8cbbf9c7d9d47e485.tar.gz
lz4-f294fabef6bac63d6eb0e2f8cbbf9c7d9d47e485.tar.bz2
Merge pull request #1110 from lz4/moreCompactStates
Re-organize state's internal to be more compact
-rw-r--r--lib/lz4.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/lz4.h b/lib/lz4.h
index a8c6d1e..7081e76 100644
--- a/lib/lz4.h
+++ b/lib/lz4.h
@@ -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;