zstd-ruby 1.5.0.0 → 1.5.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +2 -2
- data/README.md +1 -1
- data/ext/zstdruby/extconf.rb +2 -1
- data/ext/zstdruby/libzstd/Makefile +50 -175
- data/ext/zstdruby/libzstd/README.md +7 -1
- data/ext/zstdruby/libzstd/common/bitstream.h +24 -9
- data/ext/zstdruby/libzstd/common/compiler.h +89 -43
- data/ext/zstdruby/libzstd/common/entropy_common.c +11 -5
- data/ext/zstdruby/libzstd/common/error_private.h +79 -0
- data/ext/zstdruby/libzstd/common/fse.h +2 -1
- data/ext/zstdruby/libzstd/common/fse_decompress.c +1 -1
- data/ext/zstdruby/libzstd/common/huf.h +24 -22
- data/ext/zstdruby/libzstd/common/mem.h +18 -0
- data/ext/zstdruby/libzstd/common/pool.c +11 -6
- data/ext/zstdruby/libzstd/common/pool.h +2 -2
- data/ext/zstdruby/libzstd/common/portability_macros.h +137 -0
- data/ext/zstdruby/libzstd/common/xxhash.c +5 -805
- data/ext/zstdruby/libzstd/common/xxhash.h +5568 -167
- data/ext/zstdruby/libzstd/common/zstd_internal.h +95 -92
- data/ext/zstdruby/libzstd/common/zstd_trace.h +12 -3
- data/ext/zstdruby/libzstd/compress/clevels.h +134 -0
- data/ext/zstdruby/libzstd/compress/fse_compress.c +63 -27
- data/ext/zstdruby/libzstd/compress/huf_compress.c +537 -104
- data/ext/zstdruby/libzstd/compress/zstd_compress.c +307 -373
- data/ext/zstdruby/libzstd/compress/zstd_compress_internal.h +174 -83
- data/ext/zstdruby/libzstd/compress/zstd_compress_literals.c +4 -3
- data/ext/zstdruby/libzstd/compress/zstd_compress_literals.h +3 -1
- data/ext/zstdruby/libzstd/compress/zstd_compress_sequences.c +15 -14
- data/ext/zstdruby/libzstd/compress/zstd_compress_superblock.c +4 -3
- data/ext/zstdruby/libzstd/compress/zstd_cwksp.h +41 -27
- data/ext/zstdruby/libzstd/compress/zstd_double_fast.c +295 -120
- data/ext/zstdruby/libzstd/compress/zstd_fast.c +309 -130
- data/ext/zstdruby/libzstd/compress/zstd_lazy.c +482 -562
- data/ext/zstdruby/libzstd/compress/zstd_ldm.c +9 -7
- data/ext/zstdruby/libzstd/compress/zstd_ldm.h +1 -1
- data/ext/zstdruby/libzstd/compress/zstd_ldm_geartab.h +4 -1
- data/ext/zstdruby/libzstd/compress/zstd_opt.c +249 -148
- data/ext/zstdruby/libzstd/compress/zstdmt_compress.c +76 -38
- data/ext/zstdruby/libzstd/compress/zstdmt_compress.h +4 -1
- data/ext/zstdruby/libzstd/decompress/huf_decompress.c +727 -189
- data/ext/zstdruby/libzstd/decompress/huf_decompress_amd64.S +585 -0
- data/ext/zstdruby/libzstd/decompress/zstd_decompress.c +85 -22
- data/ext/zstdruby/libzstd/decompress/zstd_decompress_block.c +744 -220
- data/ext/zstdruby/libzstd/decompress/zstd_decompress_block.h +8 -2
- data/ext/zstdruby/libzstd/decompress/zstd_decompress_internal.h +34 -3
- data/ext/zstdruby/libzstd/deprecated/zbuff_compress.c +23 -3
- data/ext/zstdruby/libzstd/dictBuilder/cover.c +9 -2
- data/ext/zstdruby/libzstd/dictBuilder/fastcover.c +11 -4
- data/ext/zstdruby/libzstd/dictBuilder/zdict.c +101 -30
- data/ext/zstdruby/libzstd/legacy/zstd_v01.c +2 -6
- data/ext/zstdruby/libzstd/legacy/zstd_v02.c +3 -7
- data/ext/zstdruby/libzstd/legacy/zstd_v03.c +3 -7
- data/ext/zstdruby/libzstd/legacy/zstd_v04.c +3 -7
- data/ext/zstdruby/libzstd/legacy/zstd_v05.c +3 -7
- data/ext/zstdruby/libzstd/legacy/zstd_v06.c +3 -7
- data/ext/zstdruby/libzstd/legacy/zstd_v07.c +3 -7
- data/ext/zstdruby/libzstd/libzstd.mk +203 -0
- data/ext/zstdruby/libzstd/libzstd.pc.in +1 -0
- data/ext/zstdruby/libzstd/module.modulemap +25 -0
- data/ext/zstdruby/libzstd/zdict.h +4 -4
- data/ext/zstdruby/libzstd/zstd.h +179 -136
- data/ext/zstdruby/zstdruby.c +2 -2
- data/lib/zstd-ruby/version.rb +1 -1
- metadata +11 -6
@@ -159,12 +159,12 @@ size_t ZSTD_ldm_getTableSize(ldmParams_t params)
|
|
159
159
|
size_t const ldmBucketSize = ((size_t)1) << (params.hashLog - ldmBucketSizeLog);
|
160
160
|
size_t const totalSize = ZSTD_cwksp_alloc_size(ldmBucketSize)
|
161
161
|
+ ZSTD_cwksp_alloc_size(ldmHSize * sizeof(ldmEntry_t));
|
162
|
-
return params.enableLdm ? totalSize : 0;
|
162
|
+
return params.enableLdm == ZSTD_ps_enable ? totalSize : 0;
|
163
163
|
}
|
164
164
|
|
165
165
|
size_t ZSTD_ldm_getMaxNbSeq(ldmParams_t params, size_t maxChunkSize)
|
166
166
|
{
|
167
|
-
return params.enableLdm ? (maxChunkSize / params.minMatchLength) : 0;
|
167
|
+
return params.enableLdm == ZSTD_ps_enable ? (maxChunkSize / params.minMatchLength) : 0;
|
168
168
|
}
|
169
169
|
|
170
170
|
/** ZSTD_ldm_getBucket() :
|
@@ -478,7 +478,7 @@ static size_t ZSTD_ldm_generateSequences_internal(
|
|
478
478
|
*/
|
479
479
|
if (anchor > ip + hashed) {
|
480
480
|
ZSTD_ldm_gear_reset(&hashState, anchor - minMatchLength, minMatchLength);
|
481
|
-
/* Continue the
|
481
|
+
/* Continue the outer loop at anchor (ip + hashed == anchor). */
|
482
482
|
ip = anchor - hashed;
|
483
483
|
break;
|
484
484
|
}
|
@@ -579,7 +579,9 @@ size_t ZSTD_ldm_generateSequences(
|
|
579
579
|
return 0;
|
580
580
|
}
|
581
581
|
|
582
|
-
void
|
582
|
+
void
|
583
|
+
ZSTD_ldm_skipSequences(rawSeqStore_t* rawSeqStore, size_t srcSize, U32 const minMatch)
|
584
|
+
{
|
583
585
|
while (srcSize > 0 && rawSeqStore->pos < rawSeqStore->size) {
|
584
586
|
rawSeq* seq = rawSeqStore->seq + rawSeqStore->pos;
|
585
587
|
if (srcSize <= seq->litLength) {
|
@@ -657,7 +659,7 @@ void ZSTD_ldm_skipRawSeqStoreBytes(rawSeqStore_t* rawSeqStore, size_t nbBytes) {
|
|
657
659
|
|
658
660
|
size_t ZSTD_ldm_blockCompress(rawSeqStore_t* rawSeqStore,
|
659
661
|
ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
660
|
-
|
662
|
+
ZSTD_paramSwitch_e useRowMatchFinder,
|
661
663
|
void const* src, size_t srcSize)
|
662
664
|
{
|
663
665
|
const ZSTD_compressionParameters* const cParams = &ms->cParams;
|
@@ -709,8 +711,8 @@ size_t ZSTD_ldm_blockCompress(rawSeqStore_t* rawSeqStore,
|
|
709
711
|
rep[0] = sequence.offset;
|
710
712
|
/* Store the sequence */
|
711
713
|
ZSTD_storeSeq(seqStore, newLitLength, ip - newLitLength, iend,
|
712
|
-
sequence.offset
|
713
|
-
sequence.matchLength
|
714
|
+
STORE_OFFSET(sequence.offset),
|
715
|
+
sequence.matchLength);
|
714
716
|
ip += sequence.matchLength;
|
715
717
|
}
|
716
718
|
}
|
@@ -66,7 +66,7 @@ size_t ZSTD_ldm_generateSequences(
|
|
66
66
|
*/
|
67
67
|
size_t ZSTD_ldm_blockCompress(rawSeqStore_t* rawSeqStore,
|
68
68
|
ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
69
|
-
|
69
|
+
ZSTD_paramSwitch_e useRowMatchFinder,
|
70
70
|
void const* src, size_t srcSize);
|
71
71
|
|
72
72
|
/**
|
@@ -11,7 +11,10 @@
|
|
11
11
|
#ifndef ZSTD_LDM_GEARTAB_H
|
12
12
|
#define ZSTD_LDM_GEARTAB_H
|
13
13
|
|
14
|
-
|
14
|
+
#include "../common/compiler.h" /* UNUSED_ATTR */
|
15
|
+
#include "../common/mem.h" /* U64 */
|
16
|
+
|
17
|
+
static UNUSED_ATTR const U64 ZSTD_ldm_gearTab[256] = {
|
15
18
|
0xf5b8f72c5f77775c, 0x84935f266b7ac412, 0xb647ada9ca730ccc,
|
16
19
|
0xb065bb4b114fb1de, 0x34584e7e8c3a9fd0, 0x4e97e17c6ae26b05,
|
17
20
|
0x3a03d743bc99a604, 0xcecd042422c4044f, 0x76de76c58524259e,
|