zstdlib 0.1.2-x86-mingw32 → 0.2.0-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +6 -0
- data/CHANGES.md +7 -0
- data/README.md +4 -3
- data/ext/zstdlib/extconf.rb +1 -1
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/bitstream.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/compiler.h +1 -1
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/cpu.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/debug.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/debug.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/entropy_common.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/error_private.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/error_private.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/fse.h +1 -1
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/fse_decompress.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/huf.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/mem.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/pool.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/pool.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/threading.c +2 -2
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/threading.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/xxhash.c +2 -2
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/xxhash.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/zstd_common.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/zstd_errors.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/common/zstd_internal.h +55 -2
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/fse_compress.c +2 -2
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/hist.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/hist.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/huf_compress.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/zstd_compress.c +423 -296
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/zstd_compress_internal.h +14 -11
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/zstd_double_fast.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/zstd_double_fast.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/zstd_fast.c +203 -124
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/zstd_fast.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/zstd_lazy.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/zstd_lazy.h +1 -1
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/zstd_ldm.c +1 -1
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/zstd_ldm.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/zstd_opt.c +27 -11
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/zstd_opt.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/zstdmt_compress.c +41 -49
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/compress/zstdmt_compress.h +43 -26
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/decompress/huf_decompress.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/decompress/zstd_ddict.c +4 -4
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/decompress/zstd_ddict.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/decompress/zstd_decompress.c +257 -164
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/decompress/zstd_decompress_block.c +51 -47
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/decompress/zstd_decompress_block.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/decompress/zstd_decompress_internal.h +7 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/lib/zstd.h +689 -542
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/zlibWrapper/gzclose.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/zlibWrapper/gzcompatibility.h +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/zlibWrapper/gzguts.h +2 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/zlibWrapper/gzlib.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/zlibWrapper/gzread.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/zlibWrapper/gzwrite.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/zlibWrapper/zstd_zlibwrapper.c +0 -0
- data/ext/zstdlib/{zstd-1.3.8 → zstd-1.4.0}/zlibWrapper/zstd_zlibwrapper.h +0 -0
- data/lib/2.2/zstdlib.so +0 -0
- data/lib/2.3/zstdlib.so +0 -0
- data/lib/2.4/zstdlib.so +0 -0
- data/lib/2.5/zstdlib.so +0 -0
- data/lib/2.6/zstdlib.so +0 -0
- metadata +58 -57
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02e64a9bac079fe88a08517eb7fb7918018080685b527e99b1ba7412999110f4
|
4
|
+
data.tar.gz: 9345621416bedf6903d028289c4e86c7e056e7d343dbb8f32d0cfa8f76257681
|
5
5
|
SHA512:
|
6
|
-
metadata.gz: '
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0128b7581a37600bb1b010c05169dbd888fe53b67b825be6d64dc5804cd41975b69131926276e45cbced625fd65d78e49aab75d87513fcefbe7c506b8df6bae8'
|
7
|
+
data.tar.gz: 818a5cf8bc94e5794e986c445fd412ee9076c1fa4c33d693a19a5acb6c87e3b9f168f0343a265a975c17d8773706a65303b1ab48ead15199010563dd885c7bc5
|
data/.yardopts
ADDED
data/CHANGES.md
CHANGED
data/README.md
CHANGED
@@ -10,7 +10,8 @@ Unlike the other Zstd bindings available for Ruby, *Zstdlib* utilizes Zstd's nat
|
|
10
10
|
|
11
11
|
This specifically means that `Zstdlib` module is and will be (mostly) API-compatible with standard Ruby `Zlib` module and thus _zstdlib_ can be used as a drop-in replacement for _zlib_: just replace `Zlib` with `Zstdlib` throughout the source code and you're in!
|
12
12
|
|
13
|
-
Streams produced by `Zstdlib::Deflate` can be decompressed with standard _zstd_ utility and hence can be written to _.zst_ or _.zstd_ files.
|
13
|
+
Streams produced by `Zstdlib::Deflate` class can be decompressed with standard _zstd_ utility and hence can be written to _.zst_ or _.zstd_ files.
|
14
|
+
Conversely, the `Zstdlib::Inflate` class can handle data from such files.
|
14
15
|
|
15
16
|
## Use cases
|
16
17
|
|
@@ -80,7 +81,7 @@ Source code and Windows-specific multi-versioned binary gems can be obtained fro
|
|
80
81
|
|
81
82
|
## Release history
|
82
83
|
|
83
|
-
For user-visible changes refer to [change log](
|
84
|
+
For user-visible changes refer to [change log](CHANGES.md).
|
84
85
|
|
85
86
|
## Caveats
|
86
87
|
|
@@ -89,7 +90,7 @@ This module is in testing phase so things beyond basic interface might not work
|
|
89
90
|
Documentation extracted from _zstdlib_ still contains traces of old zlib-related pieces.
|
90
91
|
Just keep this in mind and substitute *zlib* with *zstdlib* upon browsing.
|
91
92
|
|
92
|
-
Gzip support, although available in Zstd's Zlib compatibility layer, is currently disabled.
|
93
|
+
Gzip _.gz_ file support, although available in Zstd's Zlib compatibility layer, is currently disabled.
|
93
94
|
|
94
95
|
Zstd's external compression dictionaries capability is not (yet) implemented.
|
95
96
|
|
data/ext/zstdlib/extconf.rb
CHANGED
@@ -6,7 +6,7 @@ require 'fileutils'
|
|
6
6
|
include RbConfig
|
7
7
|
include FileUtils
|
8
8
|
|
9
|
-
ZSTD_VERSION = '1.
|
9
|
+
ZSTD_VERSION = '1.4.0'
|
10
10
|
ZLIB_VERSION = '1.2.11'
|
11
11
|
RB_VERSION = CONFIG['MAJOR']+'.'+CONFIG['MINOR']
|
12
12
|
ZMOD_VERSION = RB_VERSION >= '2.3' ? '2.6' : RB_VERSION # Review requirements with every new zlib module release!
|
File without changes
|
@@ -40,7 +40,7 @@
|
|
40
40
|
|
41
41
|
/**
|
42
42
|
* FORCE_INLINE_TEMPLATE is used to define C "templates", which take constant
|
43
|
-
* parameters. They must be inlined for the compiler to
|
43
|
+
* parameters. They must be inlined for the compiler to eliminate the constant
|
44
44
|
* branches.
|
45
45
|
*/
|
46
46
|
#define FORCE_INLINE_TEMPLATE static INLINE_KEYWORD FORCE_INLINE_ATTR
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -358,7 +358,7 @@ size_t FSE_decompress_wksp(void* dst, size_t dstCapacity, const void* cSrc, size
|
|
358
358
|
typedef enum {
|
359
359
|
FSE_repeat_none, /**< Cannot use the previous table */
|
360
360
|
FSE_repeat_check, /**< Can use the previous table but it must be checked */
|
361
|
-
FSE_repeat_valid /**< Can use the previous table and it is
|
361
|
+
FSE_repeat_valid /**< Can use the previous table and it is assumed to be valid */
|
362
362
|
} FSE_repeat;
|
363
363
|
|
364
364
|
/* *****************************************
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -14,8 +14,8 @@
|
|
14
14
|
* This file will hold wrapper for systems, which do not support pthreads
|
15
15
|
*/
|
16
16
|
|
17
|
-
/* create fake symbol to avoid empty
|
18
|
-
int
|
17
|
+
/* create fake symbol to avoid empty translation unit warning */
|
18
|
+
int g_ZSTD_threading_useless_symbol;
|
19
19
|
|
20
20
|
#if defined(ZSTD_MULTITHREAD) && defined(_WIN32)
|
21
21
|
|
File without changes
|
@@ -66,10 +66,10 @@
|
|
66
66
|
/* #define XXH_ACCEPT_NULL_INPUT_POINTER 1 */
|
67
67
|
|
68
68
|
/*!XXH_FORCE_NATIVE_FORMAT :
|
69
|
-
* By default, xxHash library provides endian-
|
69
|
+
* By default, xxHash library provides endian-independent Hash values, based on little-endian convention.
|
70
70
|
* Results are therefore identical for little-endian and big-endian CPU.
|
71
71
|
* This comes at a performance cost for big-endian CPU, since some swapping is required to emulate little-endian format.
|
72
|
-
* Should endian-
|
72
|
+
* Should endian-independence be of no importance for your application, you may set the #define below to 1,
|
73
73
|
* to improve speed for Big-endian CPU.
|
74
74
|
* This option has no impact on Little_Endian CPU.
|
75
75
|
*/
|
File without changes
|
File without changes
|
File without changes
|
@@ -53,8 +53,50 @@ extern "C" {
|
|
53
53
|
#undef MAX
|
54
54
|
#define MIN(a,b) ((a)<(b) ? (a) : (b))
|
55
55
|
#define MAX(a,b) ((a)>(b) ? (a) : (b))
|
56
|
-
|
57
|
-
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Return the specified error if the condition evaluates to true.
|
59
|
+
*
|
60
|
+
* In debug modes, prints additional information. In order to do that
|
61
|
+
* (particularly, printing the conditional that failed), this can't just wrap
|
62
|
+
* RETURN_ERROR().
|
63
|
+
*/
|
64
|
+
#define RETURN_ERROR_IF(cond, err, ...) \
|
65
|
+
if (cond) { \
|
66
|
+
RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s", __FILE__, __LINE__, ZSTD_QUOTE(cond), ZSTD_QUOTE(ERROR(err))); \
|
67
|
+
RAWLOG(3, ": " __VA_ARGS__); \
|
68
|
+
RAWLOG(3, "\n"); \
|
69
|
+
return ERROR(err); \
|
70
|
+
}
|
71
|
+
|
72
|
+
/**
|
73
|
+
* Unconditionally return the specified error.
|
74
|
+
*
|
75
|
+
* In debug modes, prints additional information.
|
76
|
+
*/
|
77
|
+
#define RETURN_ERROR(err, ...) \
|
78
|
+
do { \
|
79
|
+
RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", __FILE__, __LINE__, ZSTD_QUOTE(ERROR(err))); \
|
80
|
+
RAWLOG(3, ": " __VA_ARGS__); \
|
81
|
+
RAWLOG(3, "\n"); \
|
82
|
+
return ERROR(err); \
|
83
|
+
} while(0);
|
84
|
+
|
85
|
+
/**
|
86
|
+
* If the provided expression evaluates to an error code, returns that error code.
|
87
|
+
*
|
88
|
+
* In debug modes, prints additional information.
|
89
|
+
*/
|
90
|
+
#define FORWARD_IF_ERROR(err, ...) \
|
91
|
+
do { \
|
92
|
+
size_t const err_code = (err); \
|
93
|
+
if (ERR_isError(err_code)) { \
|
94
|
+
RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s", __FILE__, __LINE__, ZSTD_QUOTE(err), ERR_getErrorName(err_code)); \
|
95
|
+
RAWLOG(3, ": " __VA_ARGS__); \
|
96
|
+
RAWLOG(3, "\n"); \
|
97
|
+
return err_code; \
|
98
|
+
} \
|
99
|
+
} while(0);
|
58
100
|
|
59
101
|
|
60
102
|
/*-*************************************
|
@@ -200,6 +242,17 @@ typedef struct {
|
|
200
242
|
U32 longLengthPos;
|
201
243
|
} seqStore_t;
|
202
244
|
|
245
|
+
/**
|
246
|
+
* Contains the compressed frame size and an upper-bound for the decompressed frame size.
|
247
|
+
* Note: before using `compressedSize`, check for errors using ZSTD_isError().
|
248
|
+
* similarly, before using `decompressedBound`, check for errors using:
|
249
|
+
* `decompressedBound != ZSTD_CONTENTSIZE_ERROR`
|
250
|
+
*/
|
251
|
+
typedef struct {
|
252
|
+
size_t compressedSize;
|
253
|
+
unsigned long long decompressedBound;
|
254
|
+
} ZSTD_frameSizeInfo; /* decompress & legacy */
|
255
|
+
|
203
256
|
const seqStore_t* ZSTD_getSeqStore(const ZSTD_CCtx* ctx); /* compress & dictBuilder */
|
204
257
|
void ZSTD_seqToCodes(const seqStore_t* seqStorePtr); /* compress, dictBuilder, decodeCorpus (shouldn't get its definition from here) */
|
205
258
|
|
@@ -129,9 +129,9 @@ size_t FSE_buildCTable_wksp(FSE_CTable* ct,
|
|
129
129
|
{ U32 position = 0;
|
130
130
|
U32 symbol;
|
131
131
|
for (symbol=0; symbol<=maxSymbolValue; symbol++) {
|
132
|
-
int
|
132
|
+
int nbOccurrences;
|
133
133
|
int const freq = normalizedCounter[symbol];
|
134
|
-
for (
|
134
|
+
for (nbOccurrences=0; nbOccurrences<freq; nbOccurrences++) {
|
135
135
|
tableSymbol[position] = (FSE_FUNCTION_TYPE)symbol;
|
136
136
|
position = (position + step) & tableMask;
|
137
137
|
while (position > highThreshold)
|
File without changes
|
File without changes
|
File without changes
|