From ef823e02996b25fcb4166b017d174ff788d95763 Mon Sep 17 00:00:00 2001 From: senhuang42 Date: Wed, 30 Sep 2020 17:20:47 -0400 Subject: [PATCH] Remove rawSeqStore.base and add rawSeqStore.posInSequence --- lib/compress/zstd_compress.c | 2 +- lib/compress/zstd_compress_internal.h | 2 +- lib/compress/zstdmt_compress.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 4958239cf..3a5ad0255 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -2354,7 +2354,7 @@ static size_t ZSTD_buildSeqStore(ZSTD_CCtx* zc, const void* src, size_t srcSize) src, srcSize); assert(zc->externSeqStore.pos <= zc->externSeqStore.size); } else if (zc->appliedParams.ldmParams.enableLdm) { - rawSeqStore_t ldmSeqStore = {NULL, NULL, 0, 0, 0}; + rawSeqStore_t ldmSeqStore = {NULL, 0, 0, 0, 0}; ldmSeqStore.seq = zc->ldmSequences; ldmSeqStore.capacity = zc->maxNbLdmSequences; diff --git a/lib/compress/zstd_compress_internal.h b/lib/compress/zstd_compress_internal.h index 9eba078b4..da5720e95 100644 --- a/lib/compress/zstd_compress_internal.h +++ b/lib/compress/zstd_compress_internal.h @@ -94,8 +94,8 @@ typedef struct { typedef struct { rawSeq* seq; /* The start of the sequences */ - BYTE const* base; /* The match state window base when LDMs were generated */ size_t pos; /* The position where reading stopped. <= size. */ + size_t posInSequence; /* The position to start at within the sequence when starting a new block */ size_t size; /* The number of sequences. <= capacity. */ size_t capacity; /* The capacity starting from `seq` pointer */ } rawSeqStore_t; diff --git a/lib/compress/zstdmt_compress.c b/lib/compress/zstdmt_compress.c index 6b3e8bee5..f789ae5bf 100644 --- a/lib/compress/zstdmt_compress.c +++ b/lib/compress/zstdmt_compress.c @@ -266,7 +266,7 @@ static void ZSTDMT_releaseBuffer(ZSTDMT_bufferPool* bufPool, buffer_t buf) /* ===== Seq Pool Wrapper ====== */ -static rawSeqStore_t kNullRawSeqStore = {NULL, NULL, 0, 0, 0}; +static rawSeqStore_t kNullRawSeqStore = {NULL, 0, 0, 0, 0}; typedef ZSTDMT_bufferPool ZSTDMT_seqPool; @@ -277,7 +277,7 @@ static size_t ZSTDMT_sizeof_seqPool(ZSTDMT_seqPool* seqPool) static rawSeqStore_t bufferToSeq(buffer_t buffer) { - rawSeqStore_t seq = {NULL, NULL, 0, 0, 0}; + rawSeqStore_t seq = {NULL, 0, 0, 0, 0}; seq.seq = (rawSeq*)buffer.start; seq.capacity = buffer.capacity / sizeof(rawSeq); return seq; -- 2.47.2