Remove rawSeqStore.base and add rawSeqStore.posInSequence

This commit is contained in:
senhuang42 2020-09-30 17:20:47 -04:00
parent cfd2aec1b7
commit ef823e0299
3 changed files with 4 additions and 4 deletions

View File

@ -2354,7 +2354,7 @@ static size_t ZSTD_buildSeqStore(ZSTD_CCtx* zc, const void* src, size_t srcSize)
src, srcSize); src, srcSize);
assert(zc->externSeqStore.pos <= zc->externSeqStore.size); assert(zc->externSeqStore.pos <= zc->externSeqStore.size);
} else if (zc->appliedParams.ldmParams.enableLdm) { } 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.seq = zc->ldmSequences;
ldmSeqStore.capacity = zc->maxNbLdmSequences; ldmSeqStore.capacity = zc->maxNbLdmSequences;

View File

@ -94,8 +94,8 @@ typedef struct {
typedef struct { typedef struct {
rawSeq* seq; /* The start of the sequences */ 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 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 size; /* The number of sequences. <= capacity. */
size_t capacity; /* The capacity starting from `seq` pointer */ size_t capacity; /* The capacity starting from `seq` pointer */
} rawSeqStore_t; } rawSeqStore_t;

View File

@ -266,7 +266,7 @@ static void ZSTDMT_releaseBuffer(ZSTDMT_bufferPool* bufPool, buffer_t buf)
/* ===== Seq Pool Wrapper ====== */ /* ===== 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; 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) 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.seq = (rawSeq*)buffer.start;
seq.capacity = buffer.capacity / sizeof(rawSeq); seq.capacity = buffer.capacity / sizeof(rawSeq);
return seq; return seq;