zstd-ruby 1.4.4.0 → 1.4.5.0

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.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/ext/zstdruby/libzstd/Makefile +123 -58
  4. data/ext/zstdruby/libzstd/README.md +34 -14
  5. data/ext/zstdruby/libzstd/common/bitstream.h +31 -37
  6. data/ext/zstdruby/libzstd/common/compiler.h +19 -3
  7. data/ext/zstdruby/libzstd/common/cpu.h +1 -1
  8. data/ext/zstdruby/libzstd/common/debug.c +11 -31
  9. data/ext/zstdruby/libzstd/common/debug.h +11 -31
  10. data/ext/zstdruby/libzstd/common/entropy_common.c +13 -33
  11. data/ext/zstdruby/libzstd/common/error_private.c +2 -1
  12. data/ext/zstdruby/libzstd/common/error_private.h +6 -2
  13. data/ext/zstdruby/libzstd/common/fse.h +11 -31
  14. data/ext/zstdruby/libzstd/common/fse_decompress.c +12 -37
  15. data/ext/zstdruby/libzstd/common/huf.h +15 -33
  16. data/ext/zstdruby/libzstd/common/mem.h +1 -1
  17. data/ext/zstdruby/libzstd/common/pool.c +1 -1
  18. data/ext/zstdruby/libzstd/common/pool.h +2 -2
  19. data/ext/zstdruby/libzstd/common/threading.c +4 -3
  20. data/ext/zstdruby/libzstd/common/threading.h +4 -3
  21. data/ext/zstdruby/libzstd/common/xxhash.c +15 -33
  22. data/ext/zstdruby/libzstd/common/xxhash.h +11 -31
  23. data/ext/zstdruby/libzstd/common/zstd_common.c +1 -1
  24. data/ext/zstdruby/libzstd/common/zstd_errors.h +2 -1
  25. data/ext/zstdruby/libzstd/common/zstd_internal.h +112 -15
  26. data/ext/zstdruby/libzstd/compress/fse_compress.c +17 -40
  27. data/ext/zstdruby/libzstd/compress/hist.c +15 -35
  28. data/ext/zstdruby/libzstd/compress/hist.h +12 -32
  29. data/ext/zstdruby/libzstd/compress/huf_compress.c +92 -92
  30. data/ext/zstdruby/libzstd/compress/zstd_compress.c +450 -275
  31. data/ext/zstdruby/libzstd/compress/zstd_compress_internal.h +136 -14
  32. data/ext/zstdruby/libzstd/compress/zstd_compress_literals.c +10 -6
  33. data/ext/zstdruby/libzstd/compress/zstd_compress_literals.h +1 -1
  34. data/ext/zstdruby/libzstd/compress/zstd_compress_sequences.c +24 -20
  35. data/ext/zstdruby/libzstd/compress/zstd_compress_sequences.h +10 -3
  36. data/ext/zstdruby/libzstd/compress/zstd_compress_superblock.c +845 -0
  37. data/ext/zstdruby/libzstd/compress/zstd_compress_superblock.h +32 -0
  38. data/ext/zstdruby/libzstd/compress/zstd_cwksp.h +3 -13
  39. data/ext/zstdruby/libzstd/compress/zstd_double_fast.c +11 -8
  40. data/ext/zstdruby/libzstd/compress/zstd_double_fast.h +2 -2
  41. data/ext/zstdruby/libzstd/compress/zstd_fast.c +36 -24
  42. data/ext/zstdruby/libzstd/compress/zstd_fast.h +2 -2
  43. data/ext/zstdruby/libzstd/compress/zstd_lazy.c +34 -11
  44. data/ext/zstdruby/libzstd/compress/zstd_lazy.h +1 -1
  45. data/ext/zstdruby/libzstd/compress/zstd_ldm.c +27 -5
  46. data/ext/zstdruby/libzstd/compress/zstd_ldm.h +7 -2
  47. data/ext/zstdruby/libzstd/compress/zstd_opt.c +38 -84
  48. data/ext/zstdruby/libzstd/compress/zstd_opt.h +1 -1
  49. data/ext/zstdruby/libzstd/compress/zstdmt_compress.c +48 -21
  50. data/ext/zstdruby/libzstd/compress/zstdmt_compress.h +2 -2
  51. data/ext/zstdruby/libzstd/decompress/huf_decompress.c +76 -62
  52. data/ext/zstdruby/libzstd/decompress/zstd_ddict.c +12 -8
  53. data/ext/zstdruby/libzstd/decompress/zstd_ddict.h +2 -2
  54. data/ext/zstdruby/libzstd/decompress/zstd_decompress.c +264 -148
  55. data/ext/zstdruby/libzstd/decompress/zstd_decompress_block.c +312 -203
  56. data/ext/zstdruby/libzstd/decompress/zstd_decompress_block.h +3 -3
  57. data/ext/zstdruby/libzstd/decompress/zstd_decompress_internal.h +18 -4
  58. data/ext/zstdruby/libzstd/deprecated/zbuff.h +3 -3
  59. data/ext/zstdruby/libzstd/deprecated/zbuff_common.c +2 -2
  60. data/ext/zstdruby/libzstd/deprecated/zbuff_compress.c +1 -1
  61. data/ext/zstdruby/libzstd/deprecated/zbuff_decompress.c +1 -1
  62. data/ext/zstdruby/libzstd/dictBuilder/cover.c +5 -5
  63. data/ext/zstdruby/libzstd/dictBuilder/cover.h +14 -4
  64. data/ext/zstdruby/libzstd/dictBuilder/fastcover.c +14 -4
  65. data/ext/zstdruby/libzstd/dictBuilder/zdict.c +33 -9
  66. data/ext/zstdruby/libzstd/dictBuilder/zdict.h +51 -28
  67. data/ext/zstdruby/libzstd/dll/example/Makefile +2 -1
  68. data/ext/zstdruby/libzstd/legacy/zstd_legacy.h +4 -4
  69. data/ext/zstdruby/libzstd/legacy/zstd_v01.c +18 -12
  70. data/ext/zstdruby/libzstd/legacy/zstd_v01.h +1 -1
  71. data/ext/zstdruby/libzstd/legacy/zstd_v02.c +10 -6
  72. data/ext/zstdruby/libzstd/legacy/zstd_v02.h +1 -1
  73. data/ext/zstdruby/libzstd/legacy/zstd_v03.c +10 -6
  74. data/ext/zstdruby/libzstd/legacy/zstd_v03.h +1 -1
  75. data/ext/zstdruby/libzstd/legacy/zstd_v04.c +13 -7
  76. data/ext/zstdruby/libzstd/legacy/zstd_v04.h +1 -1
  77. data/ext/zstdruby/libzstd/legacy/zstd_v05.c +17 -13
  78. data/ext/zstdruby/libzstd/legacy/zstd_v05.h +2 -2
  79. data/ext/zstdruby/libzstd/legacy/zstd_v06.c +17 -13
  80. data/ext/zstdruby/libzstd/legacy/zstd_v06.h +1 -1
  81. data/ext/zstdruby/libzstd/legacy/zstd_v07.c +22 -14
  82. data/ext/zstdruby/libzstd/legacy/zstd_v07.h +1 -1
  83. data/ext/zstdruby/libzstd/libzstd.pc.in +2 -2
  84. data/ext/zstdruby/libzstd/zstd.h +62 -21
  85. data/lib/zstd-ruby/version.rb +1 -1
  86. metadata +7 -5
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
2
+ * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under both the BSD-style license (found in the
@@ -4,8 +4,8 @@
4
4
 
5
5
  prefix=@PREFIX@
6
6
  exec_prefix=${prefix}
7
- includedir=${prefix}/include
8
- libdir=${exec_prefix}/lib
7
+ includedir=${prefix}/@INCLUDEDIR@
8
+ libdir=${exec_prefix}/@LIBDIR@
9
9
 
10
10
  Name: zstd
11
11
  Description: fast lossless compression algorithm library
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
2
+ * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under both the BSD-style license (found in the
@@ -72,7 +72,7 @@ extern "C" {
72
72
  /*------ Version ------*/
73
73
  #define ZSTD_VERSION_MAJOR 1
74
74
  #define ZSTD_VERSION_MINOR 4
75
- #define ZSTD_VERSION_RELEASE 4
75
+ #define ZSTD_VERSION_RELEASE 5
76
76
 
77
77
  #define ZSTD_VERSION_NUMBER (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE)
78
78
  ZSTDLIB_API unsigned ZSTD_versionNumber(void); /**< to check runtime library version */
@@ -274,7 +274,10 @@ typedef enum {
274
274
  * Default level is ZSTD_CLEVEL_DEFAULT==3.
275
275
  * Special: value 0 means default, which is controlled by ZSTD_CLEVEL_DEFAULT.
276
276
  * Note 1 : it's possible to pass a negative compression level.
277
- * Note 2 : setting a level resets all other compression parameters to default */
277
+ * Note 2 : setting a level does not automatically set all other compression parameters
278
+ * to default. Setting this will however eventually dynamically impact the compression
279
+ * parameters which have not been manually set. The manually set
280
+ * ones will 'stick'. */
278
281
  /* Advanced compression parameters :
279
282
  * It's possible to pin down compression parameters to some specific values.
280
283
  * In which case, these values are no longer dynamically selected by the compressor */
@@ -519,11 +522,13 @@ typedef enum {
519
522
  /* note : additional experimental parameters are also available
520
523
  * within the experimental section of the API.
521
524
  * At the time of this writing, they include :
522
- * ZSTD_c_format
525
+ * ZSTD_d_format
526
+ * ZSTD_d_stableOutBuffer
523
527
  * Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them.
524
528
  * note : never ever use experimentalParam? names directly
525
529
  */
526
- ZSTD_d_experimentalParam1=1000
530
+ ZSTD_d_experimentalParam1=1000,
531
+ ZSTD_d_experimentalParam2=1001
527
532
 
528
533
  } ZSTD_dParameter;
529
534
 
@@ -763,7 +768,7 @@ ZSTDLIB_API size_t ZSTD_freeDStream(ZSTD_DStream* zds);
763
768
 
764
769
  /* This function is redundant with the advanced API and equivalent to:
765
770
  *
766
- * ZSTD_DCtx_reset(zds);
771
+ * ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);
767
772
  * ZSTD_DCtx_refDDict(zds, NULL);
768
773
  */
769
774
  ZSTDLIB_API size_t ZSTD_initDStream(ZSTD_DStream* zds);
@@ -1263,23 +1268,28 @@ ZSTDLIB_API size_t ZSTD_getSequences(ZSTD_CCtx* zc, ZSTD_Sequence* outSeqs,
1263
1268
  ***************************************/
1264
1269
 
1265
1270
  /*! ZSTD_estimate*() :
1266
- * These functions make it possible to estimate memory usage of a future
1267
- * {D,C}Ctx, before its creation.
1271
+ * These functions make it possible to estimate memory usage
1272
+ * of a future {D,C}Ctx, before its creation.
1273
+ *
1274
+ * ZSTD_estimateCCtxSize() will provide a memory budget large enough
1275
+ * for any compression level up to selected one.
1276
+ * Note : Unlike ZSTD_estimateCStreamSize*(), this estimate
1277
+ * does not include space for a window buffer.
1278
+ * Therefore, the estimation is only guaranteed for single-shot compressions, not streaming.
1279
+ * The estimate will assume the input may be arbitrarily large,
1280
+ * which is the worst case.
1268
1281
  *
1269
- * ZSTD_estimateCCtxSize() will provide a budget large enough for any
1270
- * compression level up to selected one. Unlike ZSTD_estimateCStreamSize*(),
1271
- * this estimate does not include space for a window buffer, so this estimate
1272
- * is guaranteed to be enough for single-shot compressions, but not streaming
1273
- * compressions. It will however assume the input may be arbitrarily large,
1274
- * which is the worst case. If srcSize is known to always be small,
1275
- * ZSTD_estimateCCtxSize_usingCParams() can provide a tighter estimation.
1276
- * ZSTD_estimateCCtxSize_usingCParams() can be used in tandem with
1277
- * ZSTD_getCParams() to create cParams from compressionLevel.
1278
- * ZSTD_estimateCCtxSize_usingCCtxParams() can be used in tandem with
1279
- * ZSTD_CCtxParams_setParameter().
1282
+ * When srcSize can be bound by a known and rather "small" value,
1283
+ * this fact can be used to provide a tighter estimation
1284
+ * because the CCtx compression context will need less memory.
1285
+ * This tighter estimation can be provided by more advanced functions
1286
+ * ZSTD_estimateCCtxSize_usingCParams(), which can be used in tandem with ZSTD_getCParams(),
1287
+ * and ZSTD_estimateCCtxSize_usingCCtxParams(), which can be used in tandem with ZSTD_CCtxParams_setParameter().
1288
+ * Both can be used to estimate memory using custom compression parameters and arbitrary srcSize limits.
1280
1289
  *
1281
- * Note: only single-threaded compression is supported. This function will
1282
- * return an error code if ZSTD_c_nbWorkers is >= 1. */
1290
+ * Note 2 : only single-threaded compression is supported.
1291
+ * ZSTD_estimateCCtxSize_usingCCtxParams() will return an error code if ZSTD_c_nbWorkers is >= 1.
1292
+ */
1283
1293
  ZSTDLIB_API size_t ZSTD_estimateCCtxSize(int compressionLevel);
1284
1294
  ZSTDLIB_API size_t ZSTD_estimateCCtxSize_usingCParams(ZSTD_compressionParameters cParams);
1285
1295
  ZSTDLIB_API size_t ZSTD_estimateCCtxSize_usingCCtxParams(const ZSTD_CCtx_params* params);
@@ -1642,6 +1652,37 @@ ZSTDLIB_API size_t ZSTD_DCtx_setMaxWindowSize(ZSTD_DCtx* dctx, size_t maxWindowS
1642
1652
  * allowing selection between ZSTD_format_e input compression formats
1643
1653
  */
1644
1654
  #define ZSTD_d_format ZSTD_d_experimentalParam1
1655
+ /* ZSTD_d_stableOutBuffer
1656
+ * Experimental parameter.
1657
+ * Default is 0 == disabled. Set to 1 to enable.
1658
+ *
1659
+ * Tells the decompressor that the ZSTD_outBuffer will ALWAYS be the same
1660
+ * between calls, except for the modifications that zstd makes to pos (the
1661
+ * caller must not modify pos). This is checked by the decompressor, and
1662
+ * decompression will fail if it ever changes. Therefore the ZSTD_outBuffer
1663
+ * MUST be large enough to fit the entire decompressed frame. This will be
1664
+ * checked when the frame content size is known. The data in the ZSTD_outBuffer
1665
+ * in the range [dst, dst + pos) MUST not be modified during decompression
1666
+ * or you will get data corruption.
1667
+ *
1668
+ * When this flags is enabled zstd won't allocate an output buffer, because
1669
+ * it can write directly to the ZSTD_outBuffer, but it will still allocate
1670
+ * an input buffer large enough to fit any compressed block. This will also
1671
+ * avoid the memcpy() from the internal output buffer to the ZSTD_outBuffer.
1672
+ * If you need to avoid the input buffer allocation use the buffer-less
1673
+ * streaming API.
1674
+ *
1675
+ * NOTE: So long as the ZSTD_outBuffer always points to valid memory, using
1676
+ * this flag is ALWAYS memory safe, and will never access out-of-bounds
1677
+ * memory. However, decompression WILL fail if you violate the preconditions.
1678
+ *
1679
+ * WARNING: The data in the ZSTD_outBuffer in the range [dst, dst + pos) MUST
1680
+ * not be modified during decompression or you will get data corruption. This
1681
+ * is because zstd needs to reference data in the ZSTD_outBuffer to regenerate
1682
+ * matches. Normally zstd maintains its own buffer for this purpose, but passing
1683
+ * this flag tells zstd to use the user provided buffer.
1684
+ */
1685
+ #define ZSTD_d_stableOutBuffer ZSTD_d_experimentalParam2
1645
1686
 
1646
1687
  /*! ZSTD_DCtx_setFormat() :
1647
1688
  * Instruct the decoder context about what kind of data to decode next.
@@ -1,3 +1,3 @@
1
1
  module Zstd
2
- VERSION = "1.4.4.0"
2
+ VERSION = "1.4.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zstd-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4.0
4
+ version: 1.4.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SpringMT
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-06 00:00:00.000000000 Z
11
+ date: 2020-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -122,6 +122,8 @@ files:
122
122
  - ext/zstdruby/libzstd/compress/zstd_compress_literals.h
123
123
  - ext/zstdruby/libzstd/compress/zstd_compress_sequences.c
124
124
  - ext/zstdruby/libzstd/compress/zstd_compress_sequences.h
125
+ - ext/zstdruby/libzstd/compress/zstd_compress_superblock.c
126
+ - ext/zstdruby/libzstd/compress/zstd_compress_superblock.h
125
127
  - ext/zstdruby/libzstd/compress/zstd_cwksp.h
126
128
  - ext/zstdruby/libzstd/compress/zstd_double_fast.c
127
129
  - ext/zstdruby/libzstd/compress/zstd_double_fast.h
@@ -184,7 +186,7 @@ homepage: https://github.com/SpringMT/zstd-ruby
184
186
  licenses:
185
187
  - MIT
186
188
  metadata: {}
187
- post_install_message:
189
+ post_install_message:
188
190
  rdoc_options: []
189
191
  require_paths:
190
192
  - lib
@@ -200,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
202
  version: '0'
201
203
  requirements: []
202
204
  rubygems_version: 3.0.3
203
- signing_key:
205
+ signing_key:
204
206
  specification_version: 4
205
207
  summary: Ruby binding for zstd(Zstandard - Fast real-time compression algorithm)
206
208
  test_files: []