zstdlib 0.10.0-x86_64-darwin → 0.11.0-x86_64-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +8 -0
- data/ext/zstdlib_c/extconf.rb +2 -2
- data/ext/zstdlib_c/ruby/zlib-3.2/zstdlib.c +5090 -0
- data/ext/zstdlib_c/zstd-1.5.5/lib/common/allocations.h +55 -0
- data/ext/zstdlib_c/zstd-1.5.5/lib/common/bits.h +200 -0
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/bitstream.h +19 -60
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/compiler.h +26 -3
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/cpu.h +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/debug.c +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/debug.h +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/entropy_common.c +12 -40
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/error_private.c +9 -2
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/error_private.h +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/fse.h +5 -83
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/fse_decompress.c +7 -99
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/huf.h +65 -156
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/mem.h +39 -46
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/pool.c +26 -10
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/pool.h +7 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/portability_macros.h +22 -3
- data/ext/zstdlib_c/zstd-1.5.5/lib/common/threading.c +176 -0
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/threading.h +5 -10
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/xxhash.c +2 -2
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/xxhash.h +8 -8
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/zstd_common.c +1 -36
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/zstd_deps.h +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/zstd_internal.h +17 -118
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/common/zstd_trace.h +3 -3
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/clevels.h +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/fse_compress.c +7 -124
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/hist.c +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/hist.h +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/huf_compress.c +234 -169
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_compress.c +1243 -538
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_compress_internal.h +225 -151
- data/ext/zstdlib_c/zstd-1.5.5/lib/compress/zstd_compress_literals.c +235 -0
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_compress_literals.h +16 -8
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_compress_sequences.c +3 -3
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_compress_sequences.h +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_compress_superblock.c +25 -21
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_compress_superblock.h +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_cwksp.h +128 -62
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_double_fast.c +95 -33
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_double_fast.h +3 -2
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_fast.c +433 -148
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_fast.h +3 -2
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_lazy.c +398 -345
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_lazy.h +4 -2
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_ldm.c +5 -5
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_ldm.h +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_ldm_geartab.h +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_opt.c +106 -80
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstd_opt.h +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstdmt_compress.c +17 -9
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/compress/zstdmt_compress.h +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/decompress/huf_decompress.c +434 -441
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/decompress/huf_decompress_amd64.S +30 -39
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/decompress/zstd_ddict.c +4 -4
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/decompress/zstd_ddict.h +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/decompress/zstd_decompress.c +205 -80
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/decompress/zstd_decompress_block.c +201 -81
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/decompress/zstd_decompress_block.h +6 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/decompress/zstd_decompress_internal.h +4 -2
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/zdict.h +53 -31
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/zstd.h +580 -135
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/lib/zstd_errors.h +27 -8
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/zlibWrapper/gzclose.c +1 -1
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/zlibWrapper/gzcompatibility.h +8 -8
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/zlibWrapper/gzguts.h +10 -10
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/zlibWrapper/gzlib.c +3 -3
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/zlibWrapper/gzread.c +10 -10
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/zlibWrapper/gzwrite.c +5 -5
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/zlibWrapper/zstd_zlibwrapper.c +46 -44
- data/ext/zstdlib_c/{zstd-1.5.2 → zstd-1.5.5}/zlibWrapper/zstd_zlibwrapper.h +4 -1
- data/lib/2.4/zstdlib_c.bundle +0 -0
- data/lib/2.5/zstdlib_c.bundle +0 -0
- data/lib/2.6/zstdlib_c.bundle +0 -0
- data/lib/2.7/zstdlib_c.bundle +0 -0
- data/lib/3.0/zstdlib_c.bundle +0 -0
- data/lib/3.1/zstdlib_c.bundle +0 -0
- data/lib/3.2/zstdlib_c.bundle +0 -0
- metadata +82 -78
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/threading.c +0 -122
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_compress_literals.c +0 -159
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
* All rights reserved.
|
4
4
|
*
|
5
5
|
* This source code is licensed under both the BSD-style license (found in the
|
@@ -8,32 +8,43 @@
|
|
8
8
|
* You may select, at your option, one of the above-listed licenses.
|
9
9
|
*/
|
10
10
|
|
11
|
-
#ifndef DICTBUILDER_H_001
|
12
|
-
#define DICTBUILDER_H_001
|
13
|
-
|
14
11
|
#if defined (__cplusplus)
|
15
12
|
extern "C" {
|
16
13
|
#endif
|
17
14
|
|
15
|
+
#ifndef ZSTD_ZDICT_H
|
16
|
+
#define ZSTD_ZDICT_H
|
18
17
|
|
19
18
|
/*====== Dependencies ======*/
|
20
19
|
#include <stddef.h> /* size_t */
|
21
20
|
|
22
21
|
|
23
22
|
/* ===== ZDICTLIB_API : control library symbols visibility ===== */
|
24
|
-
#ifndef
|
25
|
-
|
26
|
-
#
|
23
|
+
#ifndef ZDICTLIB_VISIBLE
|
24
|
+
/* Backwards compatibility with old macro name */
|
25
|
+
# ifdef ZDICTLIB_VISIBILITY
|
26
|
+
# define ZDICTLIB_VISIBLE ZDICTLIB_VISIBILITY
|
27
|
+
# elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
|
28
|
+
# define ZDICTLIB_VISIBLE __attribute__ ((visibility ("default")))
|
29
|
+
# else
|
30
|
+
# define ZDICTLIB_VISIBLE
|
31
|
+
# endif
|
32
|
+
#endif
|
33
|
+
|
34
|
+
#ifndef ZDICTLIB_HIDDEN
|
35
|
+
# if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
|
36
|
+
# define ZDICTLIB_HIDDEN __attribute__ ((visibility ("hidden")))
|
27
37
|
# else
|
28
|
-
# define
|
38
|
+
# define ZDICTLIB_HIDDEN
|
29
39
|
# endif
|
30
40
|
#endif
|
41
|
+
|
31
42
|
#if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)
|
32
|
-
# define ZDICTLIB_API __declspec(dllexport)
|
43
|
+
# define ZDICTLIB_API __declspec(dllexport) ZDICTLIB_VISIBLE
|
33
44
|
#elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)
|
34
|
-
# define ZDICTLIB_API __declspec(dllimport)
|
45
|
+
# define ZDICTLIB_API __declspec(dllimport) ZDICTLIB_VISIBLE /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
|
35
46
|
#else
|
36
|
-
# define ZDICTLIB_API
|
47
|
+
# define ZDICTLIB_API ZDICTLIB_VISIBLE
|
37
48
|
#endif
|
38
49
|
|
39
50
|
/*******************************************************************************
|
@@ -110,8 +121,8 @@ extern "C" {
|
|
110
121
|
* The zstd CLI defaults to a 110KB dictionary. You likely don't need a
|
111
122
|
* dictionary larger than that. But, most use cases can get away with a
|
112
123
|
* smaller dictionary. The advanced dictionary builders can automatically
|
113
|
-
* shrink the dictionary for you, and select
|
114
|
-
*
|
124
|
+
* shrink the dictionary for you, and select the smallest size that doesn't
|
125
|
+
* hurt compression ratio too much. See the `shrinkDict` parameter.
|
115
126
|
* A smaller dictionary can save memory, and potentially speed up
|
116
127
|
* compression.
|
117
128
|
*
|
@@ -201,9 +212,9 @@ ZDICTLIB_API size_t ZDICT_trainFromBuffer(void* dictBuffer, size_t dictBufferCap
|
|
201
212
|
const size_t* samplesSizes, unsigned nbSamples);
|
202
213
|
|
203
214
|
typedef struct {
|
204
|
-
int compressionLevel;
|
205
|
-
unsigned notificationLevel;
|
206
|
-
unsigned dictID;
|
215
|
+
int compressionLevel; /**< optimize for a specific zstd compression level; 0 means default */
|
216
|
+
unsigned notificationLevel; /**< Write log to stderr; 0 = none (default); 1 = errors; 2 = progression; 3 = details; 4 = debug; */
|
217
|
+
unsigned dictID; /**< force dictID value; 0 means auto mode (32-bits random value)
|
207
218
|
* NOTE: The zstd format reserves some dictionary IDs for future use.
|
208
219
|
* You may use them in private settings, but be warned that they
|
209
220
|
* may be used by zstd in a public dictionary registry in the future.
|
@@ -260,9 +271,21 @@ ZDICTLIB_API size_t ZDICT_getDictHeaderSize(const void* dictBuffer, size_t dictS
|
|
260
271
|
ZDICTLIB_API unsigned ZDICT_isError(size_t errorCode);
|
261
272
|
ZDICTLIB_API const char* ZDICT_getErrorName(size_t errorCode);
|
262
273
|
|
274
|
+
#endif /* ZSTD_ZDICT_H */
|
263
275
|
|
276
|
+
#if defined(ZDICT_STATIC_LINKING_ONLY) && !defined(ZSTD_ZDICT_H_STATIC)
|
277
|
+
#define ZSTD_ZDICT_H_STATIC
|
264
278
|
|
265
|
-
|
279
|
+
/* This can be overridden externally to hide static symbols. */
|
280
|
+
#ifndef ZDICTLIB_STATIC_API
|
281
|
+
# if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)
|
282
|
+
# define ZDICTLIB_STATIC_API __declspec(dllexport) ZDICTLIB_VISIBLE
|
283
|
+
# elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)
|
284
|
+
# define ZDICTLIB_STATIC_API __declspec(dllimport) ZDICTLIB_VISIBLE
|
285
|
+
# else
|
286
|
+
# define ZDICTLIB_STATIC_API ZDICTLIB_VISIBLE
|
287
|
+
# endif
|
288
|
+
#endif
|
266
289
|
|
267
290
|
/* ====================================================================================
|
268
291
|
* The definitions in this section are considered experimental.
|
@@ -318,7 +341,7 @@ typedef struct {
|
|
318
341
|
* In general, it's recommended to provide a few thousands samples, though this can vary a lot.
|
319
342
|
* It's recommended that total size of all samples be about ~x100 times the target size of dictionary.
|
320
343
|
*/
|
321
|
-
|
344
|
+
ZDICTLIB_STATIC_API size_t ZDICT_trainFromBuffer_cover(
|
322
345
|
void *dictBuffer, size_t dictBufferCapacity,
|
323
346
|
const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples,
|
324
347
|
ZDICT_cover_params_t parameters);
|
@@ -340,7 +363,7 @@ ZDICTLIB_API size_t ZDICT_trainFromBuffer_cover(
|
|
340
363
|
* See ZDICT_trainFromBuffer() for details on failure modes.
|
341
364
|
* Note: ZDICT_optimizeTrainFromBuffer_cover() requires about 8 bytes of memory for each input byte and additionally another 5 bytes of memory for each byte of memory for each thread.
|
342
365
|
*/
|
343
|
-
|
366
|
+
ZDICTLIB_STATIC_API size_t ZDICT_optimizeTrainFromBuffer_cover(
|
344
367
|
void* dictBuffer, size_t dictBufferCapacity,
|
345
368
|
const void* samplesBuffer, const size_t* samplesSizes, unsigned nbSamples,
|
346
369
|
ZDICT_cover_params_t* parameters);
|
@@ -361,7 +384,7 @@ ZDICTLIB_API size_t ZDICT_optimizeTrainFromBuffer_cover(
|
|
361
384
|
* In general, it's recommended to provide a few thousands samples, though this can vary a lot.
|
362
385
|
* It's recommended that total size of all samples be about ~x100 times the target size of dictionary.
|
363
386
|
*/
|
364
|
-
|
387
|
+
ZDICTLIB_STATIC_API size_t ZDICT_trainFromBuffer_fastCover(void *dictBuffer,
|
365
388
|
size_t dictBufferCapacity, const void *samplesBuffer,
|
366
389
|
const size_t *samplesSizes, unsigned nbSamples,
|
367
390
|
ZDICT_fastCover_params_t parameters);
|
@@ -384,7 +407,7 @@ ZDICTLIB_API size_t ZDICT_trainFromBuffer_fastCover(void *dictBuffer,
|
|
384
407
|
* See ZDICT_trainFromBuffer() for details on failure modes.
|
385
408
|
* Note: ZDICT_optimizeTrainFromBuffer_fastCover() requires about 6 * 2^f bytes of memory for each thread.
|
386
409
|
*/
|
387
|
-
|
410
|
+
ZDICTLIB_STATIC_API size_t ZDICT_optimizeTrainFromBuffer_fastCover(void* dictBuffer,
|
388
411
|
size_t dictBufferCapacity, const void* samplesBuffer,
|
389
412
|
const size_t* samplesSizes, unsigned nbSamples,
|
390
413
|
ZDICT_fastCover_params_t* parameters);
|
@@ -409,7 +432,7 @@ typedef struct {
|
|
409
432
|
* It's recommended that total size of all samples be about ~x100 times the target size of dictionary.
|
410
433
|
* Note: ZDICT_trainFromBuffer_legacy() will send notifications into stderr if instructed to, using notificationLevel>0.
|
411
434
|
*/
|
412
|
-
|
435
|
+
ZDICTLIB_STATIC_API size_t ZDICT_trainFromBuffer_legacy(
|
413
436
|
void* dictBuffer, size_t dictBufferCapacity,
|
414
437
|
const void* samplesBuffer, const size_t* samplesSizes, unsigned nbSamples,
|
415
438
|
ZDICT_legacy_params_t parameters);
|
@@ -421,32 +444,31 @@ ZDICTLIB_API size_t ZDICT_trainFromBuffer_legacy(
|
|
421
444
|
or _CRT_SECURE_NO_WARNINGS in Visual.
|
422
445
|
Otherwise, it's also possible to manually define ZDICT_DISABLE_DEPRECATE_WARNINGS */
|
423
446
|
#ifdef ZDICT_DISABLE_DEPRECATE_WARNINGS
|
424
|
-
# define ZDICT_DEPRECATED(message)
|
447
|
+
# define ZDICT_DEPRECATED(message) /* disable deprecation warnings */
|
425
448
|
#else
|
426
449
|
# define ZDICT_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
|
427
450
|
# if defined (__cplusplus) && (__cplusplus >= 201402) /* C++14 or greater */
|
428
|
-
# define ZDICT_DEPRECATED(message) [[deprecated(message)]]
|
451
|
+
# define ZDICT_DEPRECATED(message) [[deprecated(message)]]
|
429
452
|
# elif defined(__clang__) || (ZDICT_GCC_VERSION >= 405)
|
430
|
-
# define ZDICT_DEPRECATED(message)
|
453
|
+
# define ZDICT_DEPRECATED(message) __attribute__((deprecated(message)))
|
431
454
|
# elif (ZDICT_GCC_VERSION >= 301)
|
432
|
-
# define ZDICT_DEPRECATED(message)
|
455
|
+
# define ZDICT_DEPRECATED(message) __attribute__((deprecated))
|
433
456
|
# elif defined(_MSC_VER)
|
434
|
-
# define ZDICT_DEPRECATED(message)
|
457
|
+
# define ZDICT_DEPRECATED(message) __declspec(deprecated(message))
|
435
458
|
# else
|
436
459
|
# pragma message("WARNING: You need to implement ZDICT_DEPRECATED for this compiler")
|
437
|
-
# define ZDICT_DEPRECATED(message)
|
460
|
+
# define ZDICT_DEPRECATED(message)
|
438
461
|
# endif
|
439
462
|
#endif /* ZDICT_DISABLE_DEPRECATE_WARNINGS */
|
440
463
|
|
441
464
|
ZDICT_DEPRECATED("use ZDICT_finalizeDictionary() instead")
|
465
|
+
ZDICTLIB_STATIC_API
|
442
466
|
size_t ZDICT_addEntropyTablesFromBuffer(void* dictBuffer, size_t dictContentSize, size_t dictBufferCapacity,
|
443
467
|
const void* samplesBuffer, const size_t* samplesSizes, unsigned nbSamples);
|
444
468
|
|
445
469
|
|
446
|
-
#endif /*
|
470
|
+
#endif /* ZSTD_ZDICT_H_STATIC */
|
447
471
|
|
448
472
|
#if defined (__cplusplus)
|
449
473
|
}
|
450
474
|
#endif
|
451
|
-
|
452
|
-
#endif /* DICTBUILDER_H_001 */
|