zstdlib 0.9.0-x64-mingw-ucrt
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +6 -0
- data/CHANGES.md +78 -0
- data/Gemfile +3 -0
- data/README.md +107 -0
- data/Rakefile +59 -0
- data/ext/zstdlib_c/extconf.rb +54 -0
- data/ext/zstdlib_c/ruby/zlib-2.2/zstdlib.c +4675 -0
- data/ext/zstdlib_c/ruby/zlib-2.3/zstdlib.c +4702 -0
- data/ext/zstdlib_c/ruby/zlib-2.4/zstdlib.c +4859 -0
- data/ext/zstdlib_c/ruby/zlib-2.5/zstdlib.c +4864 -0
- data/ext/zstdlib_c/ruby/zlib-2.6/zstdlib.c +4906 -0
- data/ext/zstdlib_c/ruby/zlib-2.7/zstdlib.c +4895 -0
- data/ext/zstdlib_c/ruby/zlib-3.0/zstdlib.c +4994 -0
- data/ext/zstdlib_c/ruby/zlib-3.1/zstdlib.c +5076 -0
- data/ext/zstdlib_c/zlib-1.2.11/adler32.c +186 -0
- data/ext/zstdlib_c/zlib-1.2.11/compress.c +86 -0
- data/ext/zstdlib_c/zlib-1.2.11/crc32.c +442 -0
- data/ext/zstdlib_c/zlib-1.2.11/crc32.h +441 -0
- data/ext/zstdlib_c/zlib-1.2.11/deflate.c +2163 -0
- data/ext/zstdlib_c/zlib-1.2.11/deflate.h +349 -0
- data/ext/zstdlib_c/zlib-1.2.11/gzclose.c +25 -0
- data/ext/zstdlib_c/zlib-1.2.11/gzguts.h +218 -0
- data/ext/zstdlib_c/zlib-1.2.11/gzlib.c +637 -0
- data/ext/zstdlib_c/zlib-1.2.11/gzread.c +654 -0
- data/ext/zstdlib_c/zlib-1.2.11/gzwrite.c +665 -0
- data/ext/zstdlib_c/zlib-1.2.11/infback.c +640 -0
- data/ext/zstdlib_c/zlib-1.2.11/inffast.c +323 -0
- data/ext/zstdlib_c/zlib-1.2.11/inffast.h +11 -0
- data/ext/zstdlib_c/zlib-1.2.11/inffixed.h +94 -0
- data/ext/zstdlib_c/zlib-1.2.11/inflate.c +1561 -0
- data/ext/zstdlib_c/zlib-1.2.11/inflate.h +125 -0
- data/ext/zstdlib_c/zlib-1.2.11/inftrees.c +304 -0
- data/ext/zstdlib_c/zlib-1.2.11/inftrees.h +62 -0
- data/ext/zstdlib_c/zlib-1.2.11/trees.c +1203 -0
- data/ext/zstdlib_c/zlib-1.2.11/trees.h +128 -0
- data/ext/zstdlib_c/zlib-1.2.11/uncompr.c +93 -0
- data/ext/zstdlib_c/zlib-1.2.11/zconf.h +534 -0
- data/ext/zstdlib_c/zlib-1.2.11/zlib.h +1912 -0
- data/ext/zstdlib_c/zlib-1.2.11/zutil.c +325 -0
- data/ext/zstdlib_c/zlib-1.2.11/zutil.h +271 -0
- data/ext/zstdlib_c/zlib.mk +14 -0
- data/ext/zstdlib_c/zlibwrapper/zlibwrapper.c +10 -0
- data/ext/zstdlib_c/zlibwrapper.mk +14 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/bitstream.h +478 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/compiler.h +335 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/cpu.h +213 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/debug.c +24 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/debug.h +107 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/entropy_common.c +368 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/error_private.c +56 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/error_private.h +159 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/fse.h +717 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/fse_decompress.c +403 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/huf.h +364 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/mem.h +442 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/pool.c +355 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/pool.h +84 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/portability_macros.h +137 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/threading.c +122 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/threading.h +155 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/xxhash.c +24 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/xxhash.h +5686 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/zstd_common.c +83 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/zstd_deps.h +111 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/zstd_internal.h +493 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/common/zstd_trace.h +163 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/clevels.h +134 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/fse_compress.c +741 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/hist.c +181 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/hist.h +75 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/huf_compress.c +1370 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_compress.c +6327 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_compress_internal.h +1458 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_compress_literals.c +159 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_compress_literals.h +31 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_compress_sequences.c +442 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_compress_sequences.h +54 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_compress_superblock.c +573 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_compress_superblock.h +32 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_cwksp.h +676 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_double_fast.c +696 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_double_fast.h +38 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_fast.c +675 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_fast.h +37 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_lazy.c +2104 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_lazy.h +125 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_ldm.c +724 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_ldm.h +117 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_ldm_geartab.h +106 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_opt.c +1446 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstd_opt.h +56 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstdmt_compress.c +1859 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/compress/zstdmt_compress.h +113 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/decompress/huf_decompress.c +1889 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/decompress/huf_decompress_amd64.S +585 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/decompress/zstd_ddict.c +244 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/decompress/zstd_ddict.h +44 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/decompress/zstd_decompress.c +2230 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/decompress/zstd_decompress_block.c +2072 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/decompress/zstd_decompress_block.h +68 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/decompress/zstd_decompress_internal.h +236 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/zdict.h +452 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/zstd.h +2575 -0
- data/ext/zstdlib_c/zstd-1.5.2/lib/zstd_errors.h +95 -0
- data/ext/zstdlib_c/zstd-1.5.2/zlibWrapper/gzclose.c +28 -0
- data/ext/zstdlib_c/zstd-1.5.2/zlibWrapper/gzcompatibility.h +68 -0
- data/ext/zstdlib_c/zstd-1.5.2/zlibWrapper/gzguts.h +229 -0
- data/ext/zstdlib_c/zstd-1.5.2/zlibWrapper/gzlib.c +640 -0
- data/ext/zstdlib_c/zstd-1.5.2/zlibWrapper/gzread.c +678 -0
- data/ext/zstdlib_c/zstd-1.5.2/zlibWrapper/gzwrite.c +671 -0
- data/ext/zstdlib_c/zstd-1.5.2/zlibWrapper/zstd_zlibwrapper.c +1198 -0
- data/ext/zstdlib_c/zstd-1.5.2/zlibWrapper/zstd_zlibwrapper.h +88 -0
- data/ext/zstdlib_c/zstd.mk +15 -0
- data/lib/3.1/zstdlib_c.so +0 -0
- data/lib/zstdlib.rb +6 -0
- data/test/zstdlib_test.rb +21 -0
- metadata +232 -0
@@ -0,0 +1,113 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Yann Collet, Facebook, Inc.
|
3
|
+
* All rights reserved.
|
4
|
+
*
|
5
|
+
* This source code is licensed under both the BSD-style license (found in the
|
6
|
+
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
7
|
+
* in the COPYING file in the root directory of this source tree).
|
8
|
+
* You may select, at your option, one of the above-listed licenses.
|
9
|
+
*/
|
10
|
+
|
11
|
+
#ifndef ZSTDMT_COMPRESS_H
|
12
|
+
#define ZSTDMT_COMPRESS_H
|
13
|
+
|
14
|
+
#if defined (__cplusplus)
|
15
|
+
extern "C" {
|
16
|
+
#endif
|
17
|
+
|
18
|
+
|
19
|
+
/* Note : This is an internal API.
|
20
|
+
* These APIs used to be exposed with ZSTDLIB_API,
|
21
|
+
* because it used to be the only way to invoke MT compression.
|
22
|
+
* Now, you must use ZSTD_compress2 and ZSTD_compressStream2() instead.
|
23
|
+
*
|
24
|
+
* This API requires ZSTD_MULTITHREAD to be defined during compilation,
|
25
|
+
* otherwise ZSTDMT_createCCtx*() will fail.
|
26
|
+
*/
|
27
|
+
|
28
|
+
/* === Dependencies === */
|
29
|
+
#include "../common/zstd_deps.h" /* size_t */
|
30
|
+
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_parameters */
|
31
|
+
#include "../zstd.h" /* ZSTD_inBuffer, ZSTD_outBuffer, ZSTDLIB_API */
|
32
|
+
|
33
|
+
|
34
|
+
/* === Constants === */
|
35
|
+
#ifndef ZSTDMT_NBWORKERS_MAX /* a different value can be selected at compile time */
|
36
|
+
# define ZSTDMT_NBWORKERS_MAX ((sizeof(void*)==4) /*32-bit*/ ? 64 : 256)
|
37
|
+
#endif
|
38
|
+
#ifndef ZSTDMT_JOBSIZE_MIN /* a different value can be selected at compile time */
|
39
|
+
# define ZSTDMT_JOBSIZE_MIN (512 KB)
|
40
|
+
#endif
|
41
|
+
#define ZSTDMT_JOBLOG_MAX (MEM_32bits() ? 29 : 30)
|
42
|
+
#define ZSTDMT_JOBSIZE_MAX (MEM_32bits() ? (512 MB) : (1024 MB))
|
43
|
+
|
44
|
+
|
45
|
+
/* ========================================================
|
46
|
+
* === Private interface, for use by ZSTD_compress.c ===
|
47
|
+
* === Not exposed in libzstd. Never invoke directly ===
|
48
|
+
* ======================================================== */
|
49
|
+
|
50
|
+
/* === Memory management === */
|
51
|
+
typedef struct ZSTDMT_CCtx_s ZSTDMT_CCtx;
|
52
|
+
/* Requires ZSTD_MULTITHREAD to be defined during compilation, otherwise it will return NULL. */
|
53
|
+
ZSTDMT_CCtx* ZSTDMT_createCCtx_advanced(unsigned nbWorkers,
|
54
|
+
ZSTD_customMem cMem,
|
55
|
+
ZSTD_threadPool *pool);
|
56
|
+
size_t ZSTDMT_freeCCtx(ZSTDMT_CCtx* mtctx);
|
57
|
+
|
58
|
+
size_t ZSTDMT_sizeof_CCtx(ZSTDMT_CCtx* mtctx);
|
59
|
+
|
60
|
+
/* === Streaming functions === */
|
61
|
+
|
62
|
+
size_t ZSTDMT_nextInputSizeHint(const ZSTDMT_CCtx* mtctx);
|
63
|
+
|
64
|
+
/*! ZSTDMT_initCStream_internal() :
|
65
|
+
* Private use only. Init streaming operation.
|
66
|
+
* expects params to be valid.
|
67
|
+
* must receive dict, or cdict, or none, but not both.
|
68
|
+
* mtctx can be freshly constructed or reused from a prior compression.
|
69
|
+
* If mtctx is reused, memory allocations from the prior compression may not be freed,
|
70
|
+
* even if they are not needed for the current compression.
|
71
|
+
* @return : 0, or an error code */
|
72
|
+
size_t ZSTDMT_initCStream_internal(ZSTDMT_CCtx* mtctx,
|
73
|
+
const void* dict, size_t dictSize, ZSTD_dictContentType_e dictContentType,
|
74
|
+
const ZSTD_CDict* cdict,
|
75
|
+
ZSTD_CCtx_params params, unsigned long long pledgedSrcSize);
|
76
|
+
|
77
|
+
/*! ZSTDMT_compressStream_generic() :
|
78
|
+
* Combines ZSTDMT_compressStream() with optional ZSTDMT_flushStream() or ZSTDMT_endStream()
|
79
|
+
* depending on flush directive.
|
80
|
+
* @return : minimum amount of data still to be flushed
|
81
|
+
* 0 if fully flushed
|
82
|
+
* or an error code
|
83
|
+
* note : needs to be init using any ZSTD_initCStream*() variant */
|
84
|
+
size_t ZSTDMT_compressStream_generic(ZSTDMT_CCtx* mtctx,
|
85
|
+
ZSTD_outBuffer* output,
|
86
|
+
ZSTD_inBuffer* input,
|
87
|
+
ZSTD_EndDirective endOp);
|
88
|
+
|
89
|
+
/*! ZSTDMT_toFlushNow()
|
90
|
+
* Tell how many bytes are ready to be flushed immediately.
|
91
|
+
* Probe the oldest active job (not yet entirely flushed) and check its output buffer.
|
92
|
+
* If return 0, it means there is no active job,
|
93
|
+
* or, it means oldest job is still active, but everything produced has been flushed so far,
|
94
|
+
* therefore flushing is limited by speed of oldest job. */
|
95
|
+
size_t ZSTDMT_toFlushNow(ZSTDMT_CCtx* mtctx);
|
96
|
+
|
97
|
+
/*! ZSTDMT_updateCParams_whileCompressing() :
|
98
|
+
* Updates only a selected set of compression parameters, to remain compatible with current frame.
|
99
|
+
* New parameters will be applied to next compression job. */
|
100
|
+
void ZSTDMT_updateCParams_whileCompressing(ZSTDMT_CCtx* mtctx, const ZSTD_CCtx_params* cctxParams);
|
101
|
+
|
102
|
+
/*! ZSTDMT_getFrameProgression():
|
103
|
+
* tells how much data has been consumed (input) and produced (output) for current frame.
|
104
|
+
* able to count progression inside worker threads.
|
105
|
+
*/
|
106
|
+
ZSTD_frameProgression ZSTDMT_getFrameProgression(ZSTDMT_CCtx* mtctx);
|
107
|
+
|
108
|
+
|
109
|
+
#if defined (__cplusplus)
|
110
|
+
}
|
111
|
+
#endif
|
112
|
+
|
113
|
+
#endif /* ZSTDMT_COMPRESS_H */
|