extlz4 0.3.3 → 0.3.5
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/README.md +1 -1
- data/Rakefile +43 -3
- data/contrib/lz4/CODING_STYLE +57 -0
- data/contrib/lz4/LICENSE +3 -2
- data/contrib/lz4/Makefile.inc +56 -30
- data/contrib/lz4/NEWS +46 -0
- data/contrib/lz4/README.md +17 -6
- data/contrib/lz4/SECURITY.md +17 -0
- data/contrib/lz4/build/README.md +4 -15
- data/contrib/lz4/build/VS2022/_build.bat +39 -0
- data/contrib/lz4/build/VS2022/_setup.bat +35 -0
- data/contrib/lz4/build/VS2022/_test.bat +38 -0
- data/contrib/lz4/build/VS2022/build-and-test-win32-debug.bat +26 -0
- data/contrib/lz4/build/VS2022/build-and-test-win32-release.bat +26 -0
- data/contrib/lz4/build/VS2022/build-and-test-x64-debug.bat +26 -0
- data/contrib/lz4/build/VS2022/build-and-test-x64-release.bat +26 -0
- data/contrib/lz4/build/{VS2017 → VS2022}/datagen/datagen.vcxproj +11 -7
- data/contrib/lz4/build/{VS2017 → VS2022}/frametest/frametest.vcxproj +4 -4
- data/contrib/lz4/build/{VS2017 → VS2022}/fullbench/fullbench.vcxproj +4 -4
- data/contrib/lz4/build/{VS2017 → VS2022}/fullbench-dll/fullbench-dll.vcxproj +4 -4
- data/contrib/lz4/build/{VS2017 → VS2022}/fuzzer/fuzzer.vcxproj +4 -4
- data/contrib/lz4/build/{VS2017 → VS2022}/liblz4/liblz4.vcxproj +4 -4
- data/contrib/lz4/build/{VS2010 → VS2022}/liblz4-dll/liblz4-dll.rc +1 -1
- data/contrib/lz4/build/{VS2017 → VS2022}/liblz4-dll/liblz4-dll.vcxproj +4 -4
- data/contrib/lz4/build/{VS2010 → VS2022}/lz4/lz4.rc +1 -1
- data/contrib/lz4/build/{VS2017 → VS2022}/lz4/lz4.vcxproj +33 -8
- data/contrib/lz4/build/{VS2017 → VS2022}/lz4.sln +5 -2
- data/contrib/lz4/build/cmake/CMakeLists.txt +133 -100
- data/contrib/lz4/build/cmake/lz4Config.cmake.in +2 -0
- data/contrib/lz4/build/meson/GetLz4LibraryVersion.py +39 -0
- data/contrib/lz4/build/meson/README.md +34 -0
- data/contrib/lz4/build/meson/meson/contrib/gen_manual/meson.build +42 -0
- data/contrib/lz4/build/meson/meson/contrib/meson.build +11 -0
- data/contrib/lz4/build/meson/meson/examples/meson.build +32 -0
- data/contrib/lz4/build/meson/meson/lib/meson.build +87 -0
- data/contrib/lz4/build/meson/meson/meson.build +135 -0
- data/contrib/lz4/build/meson/meson/ossfuzz/meson.build +35 -0
- data/contrib/lz4/build/meson/meson/programs/meson.build +91 -0
- data/contrib/lz4/build/meson/meson/tests/meson.build +162 -0
- data/contrib/lz4/build/meson/meson.build +31 -0
- data/contrib/lz4/build/meson/meson_options.txt +44 -0
- data/contrib/lz4/build/visual/README.md +5 -0
- data/contrib/lz4/build/visual/generate_solution.cmd +55 -0
- data/contrib/lz4/build/visual/generate_vs2015.cmd +3 -0
- data/contrib/lz4/build/visual/generate_vs2017.cmd +3 -0
- data/contrib/lz4/build/visual/generate_vs2019.cmd +3 -0
- data/contrib/lz4/build/visual/generate_vs2022.cmd +3 -0
- data/contrib/lz4/lib/LICENSE +1 -1
- data/contrib/lz4/lib/README.md +69 -13
- data/contrib/lz4/lib/liblz4-dll.rc.in +1 -1
- data/contrib/lz4/lib/liblz4.pc.in +3 -3
- data/contrib/lz4/lib/lz4.c +608 -274
- data/contrib/lz4/lib/lz4.h +212 -102
- data/contrib/lz4/lib/lz4file.c +341 -0
- data/contrib/lz4/lib/lz4file.h +93 -0
- data/contrib/lz4/lib/lz4frame.c +545 -308
- data/contrib/lz4/lib/lz4frame.h +252 -124
- data/contrib/lz4/lib/lz4frame_static.h +1 -1
- data/contrib/lz4/lib/lz4hc.c +1038 -461
- data/contrib/lz4/lib/lz4hc.h +57 -56
- data/contrib/lz4/lib/xxhash.c +21 -21
- data/contrib/lz4/ossfuzz/Makefile +1 -0
- data/contrib/lz4/ossfuzz/decompress_fuzzer.c +18 -2
- data/contrib/lz4/ossfuzz/fuzz_helpers.h +4 -3
- data/contrib/lz4/ossfuzz/round_trip_frame_uncompressed_fuzzer.c +134 -0
- data/contrib/lz4/ossfuzz/round_trip_fuzzer.c +66 -6
- data/ext/blockapi.c +19 -19
- data/ext/extlz4.h +12 -0
- data/ext/frameapi.c +26 -26
- data/ext/hashargs.c +7 -1
- metadata +47 -30
- data/contrib/lz4/build/VS2010/datagen/datagen.vcxproj +0 -169
- data/contrib/lz4/build/VS2010/frametest/frametest.vcxproj +0 -176
- data/contrib/lz4/build/VS2010/fullbench/fullbench.vcxproj +0 -176
- data/contrib/lz4/build/VS2010/fullbench-dll/fullbench-dll.vcxproj +0 -180
- data/contrib/lz4/build/VS2010/fuzzer/fuzzer.vcxproj +0 -173
- data/contrib/lz4/build/VS2010/liblz4/liblz4.vcxproj +0 -175
- data/contrib/lz4/build/VS2010/liblz4-dll/liblz4-dll.vcxproj +0 -179
- data/contrib/lz4/build/VS2010/lz4/lz4.vcxproj +0 -189
- data/contrib/lz4/build/VS2010/lz4.sln +0 -98
- data/contrib/lz4/build/VS2017/liblz4-dll/liblz4-dll.rc +0 -51
- data/contrib/lz4/build/VS2017/lz4/lz4.rc +0 -51
- data/contrib/lz4/tmp +0 -0
- data/contrib/lz4/tmpsparse +0 -0
data/contrib/lz4/lib/README.md
CHANGED
@@ -2,16 +2,20 @@ LZ4 - Library Files
|
|
2
2
|
================================
|
3
3
|
|
4
4
|
The `/lib` directory contains many files, but depending on project's objectives,
|
5
|
-
not all of them are
|
5
|
+
not all of them are required.
|
6
|
+
Limited systems may want to reduce the nb of source files to include
|
7
|
+
as a way to reduce binary size and dependencies.
|
6
8
|
|
7
|
-
|
9
|
+
Capabilities are added at the "level" granularity, detailed below.
|
10
|
+
|
11
|
+
#### Level 1 : Minimal LZ4 build
|
8
12
|
|
9
13
|
The minimum required is **`lz4.c`** and **`lz4.h`**,
|
10
14
|
which provides the fast compression and decompression algorithms.
|
11
15
|
They generate and decode data using the [LZ4 block format].
|
12
16
|
|
13
17
|
|
14
|
-
#### High Compression variant
|
18
|
+
#### Level 2 : High Compression variant
|
15
19
|
|
16
20
|
For more compression ratio at the cost of compression speed,
|
17
21
|
the High Compression variant called **lz4hc** is available.
|
@@ -20,7 +24,7 @@ This variant also compresses data using the [LZ4 block format],
|
|
20
24
|
and depends on regular `lib/lz4.*` source files.
|
21
25
|
|
22
26
|
|
23
|
-
#### Frame support, for interoperability
|
27
|
+
#### Level 3 : Frame support, for interoperability
|
24
28
|
|
25
29
|
In order to produce compressed data compatible with `lz4` command line utility,
|
26
30
|
it's necessary to use the [official interoperable frame format].
|
@@ -28,14 +32,29 @@ This format is generated and decoded automatically by the **lz4frame** library.
|
|
28
32
|
Its public API is described in `lib/lz4frame.h`.
|
29
33
|
In order to work properly, lz4frame needs all other modules present in `/lib`,
|
30
34
|
including, lz4 and lz4hc, and also **xxhash**.
|
31
|
-
So it's necessary to include
|
35
|
+
So it's necessary to also include `xxhash.c` and `xxhash.h`.
|
36
|
+
|
37
|
+
|
38
|
+
#### Level 4 : File compression operations
|
39
|
+
|
40
|
+
As a helper around file operations,
|
41
|
+
the library has been recently extended with `lz4file.c` and `lz4file.h`
|
42
|
+
(still considered experimental at the time of this writing).
|
43
|
+
These helpers allow opening, reading, writing, and closing files
|
44
|
+
using transparent LZ4 compression / decompression.
|
45
|
+
As a consequence, using `lz4file` adds a dependency on `<stdio.h>`.
|
46
|
+
|
47
|
+
`lz4file` relies on `lz4frame` in order to produce compressed data
|
48
|
+
conformant to the [LZ4 Frame format] specification.
|
49
|
+
Consequently, to enable this capability,
|
50
|
+
it's necessary to include all `*.c` and `*.h` files from `lib/` directory.
|
32
51
|
|
33
52
|
|
34
53
|
#### Advanced / Experimental API
|
35
54
|
|
36
55
|
Definitions which are not guaranteed to remain stable in future versions,
|
37
56
|
are protected behind macros, such as `LZ4_STATIC_LINKING_ONLY`.
|
38
|
-
As the name
|
57
|
+
As the name suggests, these definitions should only be invoked
|
39
58
|
in the context of static linking ***only***.
|
40
59
|
Otherwise, dependent application may fail on API or ABI break in the future.
|
41
60
|
The associated symbols are also not exposed by the dynamic library by default.
|
@@ -58,7 +77,7 @@ The following build macro can be selected to adjust source code behavior at comp
|
|
58
77
|
Set to 65535 by default, which is the maximum value supported by lz4 format.
|
59
78
|
Reducing maximum distance will reduce opportunities for LZ4 to find matches,
|
60
79
|
hence will produce a worse compression ratio.
|
61
|
-
|
80
|
+
Setting a smaller max distance could allow compatibility with specific decoders with limited memory budget.
|
62
81
|
This build macro only influences the compressed output of the compressor.
|
63
82
|
|
64
83
|
- `LZ4_DISABLE_DEPRECATE_WARNINGS` : invoking a deprecated function will make the compiler generate a warning.
|
@@ -69,15 +88,11 @@ The following build macro can be selected to adjust source code behavior at comp
|
|
69
88
|
This build macro offers another project-specific method
|
70
89
|
by defining `LZ4_DISABLE_DEPRECATE_WARNINGS` before including the LZ4 header files.
|
71
90
|
|
72
|
-
- `LZ4_USER_MEMORY_FUNCTIONS` : replace calls to <stdlib>'s `malloc`, `calloc` and `free`
|
73
|
-
by user-defined functions, which must be called `LZ4_malloc()`, `LZ4_calloc()` and `LZ4_free()`.
|
74
|
-
User functions must be available at link time.
|
75
|
-
|
76
91
|
- `LZ4_FORCE_SW_BITCOUNT` : by default, the compression algorithm tries to determine lengths
|
77
92
|
by using bitcount instructions, generally implemented as fast single instructions in many cpus.
|
78
93
|
In case the target cpus doesn't support it, or compiler intrinsic doesn't work, or feature bad performance,
|
79
94
|
it's possible to use an optimized software path instead.
|
80
|
-
This is achieved by setting this build macros
|
95
|
+
This is achieved by setting this build macros.
|
81
96
|
In most cases, it's not expected to be necessary,
|
82
97
|
but it can be legitimately considered for less common platforms.
|
83
98
|
|
@@ -85,6 +100,46 @@ The following build macro can be selected to adjust source code behavior at comp
|
|
85
100
|
passed as argument to become a compression state is suitably aligned.
|
86
101
|
This test can be disabled if it proves flaky, by setting this value to 0.
|
87
102
|
|
103
|
+
- `LZ4_USER_MEMORY_FUNCTIONS` : replace calls to `<stdlib.h>`'s `malloc()`, `calloc()` and `free()`
|
104
|
+
by user-defined functions, which must be named `LZ4_malloc()`, `LZ4_calloc()` and `LZ4_free()`.
|
105
|
+
User functions must be available at link time.
|
106
|
+
|
107
|
+
- `LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION` :
|
108
|
+
Remove support of dynamic memory allocation.
|
109
|
+
For more details, see description of this macro in `lib/lz4.c`.
|
110
|
+
|
111
|
+
- `LZ4_STATIC_LINKING_ONLY_ENDIANNESS_INDEPENDENT_OUTPUT` : experimental feature aimed at producing the same
|
112
|
+
compressed output on platforms of different endianness (i.e. little-endian and big-endian).
|
113
|
+
Output on little-endian platforms shall remain unchanged, while big-endian platforms will start producing
|
114
|
+
the same output as little-endian ones. This isn't expected to impact backward- and forward-compatibility
|
115
|
+
in any way.
|
116
|
+
|
117
|
+
- `LZ4_FREESTANDING` : by setting this build macro to 1,
|
118
|
+
LZ4/HC removes dependencies on the C standard library,
|
119
|
+
including allocation functions and `memmove()`, `memcpy()`, and `memset()`.
|
120
|
+
This build macro is designed to help use LZ4/HC in restricted environments
|
121
|
+
(embedded, bootloader, etc).
|
122
|
+
For more details, see description of this macro in `lib/lz4.h`.
|
123
|
+
|
124
|
+
- `LZ4_HEAPMODE` : Select how stateless compression functions like `LZ4_compress_default()`
|
125
|
+
allocate memory for their hash table,
|
126
|
+
in memory stack (0:default, fastest), or in memory heap (1:requires malloc()).
|
127
|
+
|
128
|
+
- `LZ4HC_HEAPMODE` : Select how stateless HC compression functions like `LZ4_compress_HC()`
|
129
|
+
allocate memory for their workspace:
|
130
|
+
in stack (0), or in heap (1:default).
|
131
|
+
Since workspace is rather large, stack can be inconvenient, hence heap mode is recommended.
|
132
|
+
|
133
|
+
- `LZ4F_HEAPMODE` : selects how `LZ4F_compressFrame()` allocates the compression state,
|
134
|
+
either on stack (default, value 0) or using heap memory (value 1).
|
135
|
+
|
136
|
+
|
137
|
+
#### Makefile variables
|
138
|
+
|
139
|
+
The following `Makefile` variables can be selected to alter the profile of produced binaries :
|
140
|
+
- `BUILD_SHARED` : generate `liblz4` dynamic library (enabled by default)
|
141
|
+
- `BUILD_STATIC` : generate `liblz4` static library (enabled by default)
|
142
|
+
|
88
143
|
|
89
144
|
#### Amalgamation
|
90
145
|
|
@@ -101,7 +156,7 @@ All `*.h` files present in `/lib` remain necessary to compile `lz4_all.c`.
|
|
101
156
|
|
102
157
|
DLL can be created using MinGW+MSYS with the `make liblz4` command.
|
103
158
|
This command creates `dll\liblz4.dll` and the import library `dll\liblz4.lib`.
|
104
|
-
To override the `dlltool` command
|
159
|
+
To override the `dlltool` command when cross-compiling on Linux, just set the `DLLTOOL` variable. Example of cross compilation on Linux with mingw-w64 64 bits:
|
105
160
|
```
|
106
161
|
make BUILD_STATIC=no CC=x86_64-w64-mingw32-gcc DLLTOOL=x86_64-w64-mingw32-dlltool OS=Windows_NT
|
107
162
|
```
|
@@ -127,6 +182,7 @@ Other files present in the directory are not source code. They are :
|
|
127
182
|
- `README.md` : this file
|
128
183
|
|
129
184
|
[official interoperable frame format]: ../doc/lz4_Frame_format.md
|
185
|
+
[LZ4 Frame format]: ../doc/lz4_Frame_format.md
|
130
186
|
[LZ4 block format]: ../doc/lz4_Block_format.md
|
131
187
|
|
132
188
|
|
@@ -22,7 +22,7 @@ BEGIN
|
|
22
22
|
VALUE "FileDescription", "Extremely fast compression"
|
23
23
|
VALUE "FileVersion", "@LIBVER_MAJOR@.@LIBVER_MINOR@.@LIBVER_PATCH@.0"
|
24
24
|
VALUE "InternalName", "@LIBLZ4@"
|
25
|
-
VALUE "LegalCopyright", "Copyright (C) 2013-
|
25
|
+
VALUE "LegalCopyright", "Copyright (C) 2013-2020, Yann Collet"
|
26
26
|
VALUE "OriginalFilename", "@LIBLZ4@.dll"
|
27
27
|
VALUE "ProductName", "LZ4"
|
28
28
|
VALUE "ProductVersion", "@LIBVER_MAJOR@.@LIBVER_MINOR@.@LIBVER_PATCH@.0"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# LZ4 - Fast LZ compression algorithm
|
2
|
-
# Copyright (C) 2011-
|
2
|
+
# Copyright (C) 2011-2020, Yann Collet.
|
3
3
|
# BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
|
4
4
|
|
5
5
|
prefix=@PREFIX@
|
@@ -10,5 +10,5 @@ Name: lz4
|
|
10
10
|
Description: extremely fast lossless compression algorithm library
|
11
11
|
URL: http://www.lz4.org/
|
12
12
|
Version: @VERSION@
|
13
|
-
Libs: -L
|
14
|
-
Cflags: -I
|
13
|
+
Libs: -L${libdir} -llz4
|
14
|
+
Cflags: -I${includedir}
|