summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorW. Felix Handte <w@felixhandte.com>2020-08-06 20:06:40 (GMT)
committerW. Felix Handte <w@felixhandte.com>2020-08-06 20:06:40 (GMT)
commit9af86f084101b08e87e7c1509e19aa05d27271ed (patch)
tree0e6a1296ad6242f872396fb4872254ea3b3d8978 /lib
parentd7399232a4d547d7183c193997e17d534d000f52 (diff)
downloadlz4-9af86f084101b08e87e7c1509e19aa05d27271ed.zip
lz4-9af86f084101b08e87e7c1509e19aa05d27271ed.tar.gz
lz4-9af86f084101b08e87e7c1509e19aa05d27271ed.tar.bz2
Remove dirty Field From LZ4_stream_t
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4.c10
-rw-r--r--lib/lz4.h6
2 files changed, 2 insertions, 14 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 46c8e11..148827e 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -758,15 +758,6 @@ LZ4_FORCE_INLINE void
LZ4_prepareTable(LZ4_stream_t_internal* const cctx,
const int inputSize,
const tableType_t tableType) {
- /* If compression failed during the previous step, then the context
- * is marked as dirty, therefore, it has to be fully reset.
- */
- if (cctx->dirty) {
- DEBUGLOG(5, "LZ4_prepareTable: Full reset for %p", cctx);
- MEM_INIT(cctx, 0, sizeof(LZ4_stream_t_internal));
- return;
- }
-
/* If the table hasn't been used, it's guaranteed to be zeroed out, and is
* therefore safe to use no matter what mode we're in. Otherwise, we figure
* out if it's safe to leave as is or whether it needs to be reset.
@@ -1506,7 +1497,6 @@ int LZ4_compress_fast_continue (LZ4_stream_t* LZ4_stream,
DEBUGLOG(5, "LZ4_compress_fast_continue (inputSize=%i)", inputSize);
- if (streamPtr->dirty) { return 0; } /* Uninitialized structure detected */
LZ4_renormDictT(streamPtr, inputSize); /* avoid index overflow */
if (acceleration < 1) acceleration = ACCELERATION_DEFAULT;
diff --git a/lib/lz4.h b/lib/lz4.h
index 32108e2..9b3d758 100644
--- a/lib/lz4.h
+++ b/lib/lz4.h
@@ -564,8 +564,7 @@ typedef struct LZ4_stream_t_internal LZ4_stream_t_internal;
struct LZ4_stream_t_internal {
uint32_t hashTable[LZ4_HASH_SIZE_U32];
uint32_t currentOffset;
- uint16_t dirty;
- uint16_t tableType;
+ uint32_t tableType;
const uint8_t* dictionary;
const LZ4_stream_t_internal* dictCtx;
uint32_t dictSize;
@@ -584,8 +583,7 @@ typedef struct LZ4_stream_t_internal LZ4_stream_t_internal;
struct LZ4_stream_t_internal {
unsigned int hashTable[LZ4_HASH_SIZE_U32];
unsigned int currentOffset;
- unsigned short dirty;
- unsigned short tableType;
+ unsigned int tableType;
const unsigned char* dictionary;
const LZ4_stream_t_internal* dictCtx;
unsigned int dictSize;