Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
New upstream version 1.4.2+dfsg
· b87d277c
Justin Aplin
authored
Jul 29, 2019
b87d277c
Merge branch 'upstream' into 'upstream'
· 8567a728
Alexandre Mestiashvili
authored
Aug 19, 2019
New upstream version 1.4.2+dfsg See merge request
!1
8567a728
Show whitespace changes
Inline
Side-by-side
.gitignore
View file @
8567a728
...
...
@@ -14,7 +14,7 @@
*.dylib
# Executables
zstd
/
zstd
zstdmt
*.exe
*.out
...
...
@@ -22,7 +22,7 @@ zstdmt
# Test artefacts
tmp*
dictionary
*
dictionary
.
NUL
# Build artefacts
...
...
@@ -41,3 +41,4 @@ _zstdbench/
.DS_Store
googletest/
*.d
*.vscode
CHANGELOG
View file @
8567a728
v1.4.2
bug: Fix bug in zstd-0.5 decoder by @terrelln (#1696)
bug: Fix seekable decompression in-memory API by @iburinoc (#1695)
misc: Validate blocks are smaller than size limit by @vivekmg (#1685)
misc: Restructure source files by @ephiepark (#1679)
v1.4.1
bug: Fix data corruption in niche use cases by @terrelln (#1659)
bug: Fuzz legacy modes, fix uncovered bugs by @terrelln (#1593, #1594, #1595)
bug: Fix out of bounds read by @terrelln (#1590)
perf: Improve decode speed by ~7% @mgrice (#1668)
perf: Slightly improved compression ratio of level 3 and 4 (ZSTD_dfast) by @cyan4973 (#1681)
perf: Slightly faster compression speed when re-using a context by @cyan4973 (#1658)
perf: Improve compression ratio for small windowLog by @cyan4973 (#1624)
perf: Faster compression speed in high compression mode for repetitive data by @terrelln (#1635)
api: Add parameter to generate smaller dictionaries by @tyler-tran (#1656)
cli: Recognize symlinks when built in C99 mode by @felixhandte (#1640)
cli: Expose cpu load indicator for each file on -vv mode by @ephiepark (#1631)
cli: Restrict read permissions on destination files by @chungy (#1644)
cli: zstdgrep: handle -f flag by @felixhandte (#1618)
cli: zstdcat: follow symlinks by @vejnar (#1604)
doc: Remove extra size limit on compressed blocks by @felixhandte (#1689)
doc: Fix typo by @yk-tanigawa (#1633)
doc: Improve documentation on streaming buffer sizes by @cyan4973 (#1629)
build: CMake: support building with LZ4 @leeyoung624 (#1626)
build: CMake: install zstdless and zstdgrep by @leeyoung624 (#1647)
build: CMake: respect existing uninstall target by @j301scott (#1619)
build: Make: skip multithread tests when built without support by @michaelforney (#1620)
build: Make: Fix examples/ test target by @sjnam (#1603)
build: Meson: rename options out of deprecated namespace by @lzutao (#1665)
build: Meson: fix build by @lzutao (#1602)
build: Visual Studio: don't export symbols in static lib by @scharan (#1650)
build: Visual Studio: fix linking by @absotively (#1639)
build: Fix MinGW-W64 build by @myzhang1029 (#1600)
misc: Expand decodecorpus coverage by @ephiepark (#1664)
v1.4.0
perf: Improve level 1 compression speed in most scenarios by 6% by @gbtucker and @terrelln
api: Move the advanced API, including all functions in the staging section, to the stable section
api: Make ZSTD_e_flush and ZSTD_e_end block for maximum forward progress
api: Rename ZSTD_CCtxParam_getParameter to ZSTD_CCtxParams_getParameter
api: Rename ZSTD_CCtxParam_setParameter to ZSTD_CCtxParams_setParameter
api: Don't export ZSTDMT functions from the shared library by default
api: Require ZSTD_MULTITHREAD to be defined to use ZSTDMT
api: Add ZSTD_decompressBound() to provide an upper bound on decompressed size by @shakeelrao
api: Fix ZSTD_decompressDCtx() corner cases with a dictionary
api: Move ZSTD_getDictID_*() functions to the stable section
api: Add ZSTD_c_literalCompressionMode flag to enable or disable literal compression by @terrelln
api: Allow compression parameters to be set when a dictionary is used
api: Allow setting parameters before or after ZSTD_CCtx_loadDictionary() is called
api: Fix ZSTD_estimateCStreamSize_usingCCtxParams()
api: Setting ZSTD_d_maxWindowLog to 0 means use the default
cli: Ensure that a dictionary is not used to compress itself by @shakeelrao
cli: Add --[no-]compress-literals flag to enable or disable literal compression
doc: Update the examples to use the advanced API
doc: Explain how to transition from old streaming functions to the advanced API in the header
build: Improve the Windows release packages
build: Improve CMake build by @hjmjohnson
build: Build fixes for FreeBSD by @lwhsu
build: Remove redundant warnings by @thatsafunnyname
build: Fix tests on OpenBSD by @bket
build: Extend fuzzer build system to work with the new clang engine
build: CMake now creates the libzstd.so.1 symlink
build: Improve Menson build by @lzutao
misc: Fix symbolic link detection on FreeBSD
misc: Use physical core count for -T0 on FreeBSD by @cemeyer
misc: Fix zstd --list on truncated files by @kostmo
misc: Improve logging in debug mode by @felixhandte
misc: Add CirrusCI tests by @lwhsu
misc: Optimize dictionary memory usage in corner cases
misc: Improve the dictionary builder on small or homogeneous data
misc: Fix spelling across the repo by @jsoref
v1.3.8
perf: better decompression speed on large files (+7%) and cold dictionaries (+15%)
perf: slightly better compression ratio at high compression modes
...
...
@@ -239,7 +312,7 @@ v1.0.0
Change Licensing, all project is now BSD, Copyright Facebook
Small decompression speed improvement
API : Streaming API supports legacy format
API : ZDICT_getDictID(), ZSTD_sizeof_{CCtx, DCtx, CStream, DStream}(), ZSTD_setDStreamParamter()
API : ZDICT_getDictID(), ZSTD_sizeof_{CCtx, DCtx, CStream, DStream}(), ZSTD_setDStreamParam
e
ter()
CLI supports legacy formats v0.4+
Fixed : compression fails on certain huge files, reported by Jesse McGrew
Enhanced documentation, by Przemyslaw Skibinski
...
...
Makefile
View file @
8567a728
...
...
@@ -156,7 +156,7 @@ list:
done
\
}
| column
-t
-s
$$
'\t'
.PHONY
:
install
clangtest
armtest usan asan uasan
.PHONY
:
install armtest usan asan uasan
install
:
@$(
MAKE
)
-C
$(
ZSTDDIR
)
$@
@$(
MAKE
)
-C
$(
PRGDIR
)
$@
...
...
@@ -188,7 +188,7 @@ gcc7build: clean
.PHONY
:
clangbuild
clangbuild
:
clean
clang
-v
CXX
=
clang++
CC
=
clang
$(
MAKE
)
all
MORE
FLAGS
=
"-Werror -Wconversion -Wno-sign-conversion -Wdocumentation"
CXX
=
clang++
CC
=
clang
C
FLAGS
=
"-Werror -Wconversion -Wno-sign-conversion -Wdocumentation"
$(
MAKE
)
all
m32build
:
clean
gcc
-v
...
...
@@ -232,10 +232,6 @@ gcc6test: clean
gcc-6
-v
$(
MAKE
)
all
CC
=
gcc-6
MOREFLAGS
=
"-Werror"
clangtest
:
clean
clang
-v
$(
MAKE
)
all
CXX
=
clang++
CC
=
clang
MOREFLAGS
=
"-Werror -Wconversion -Wno-sign-conversion -Wdocumentation"
armtest
:
clean
$(
MAKE
)
-C
$(
TESTDIR
)
datagen
# use native, faster
$(
MAKE
)
-C
$(
TESTDIR
)
test
CC
=
arm-linux-gnueabi-gcc
QEMU_SYS
=
qemu-arm-static
ZSTDRTTEST
=
MOREFLAGS
=
"-Werror -static"
FUZZER_FLAGS
=
--no-big-tests
...
...
README.md
View file @
8567a728
...
...
@@ -14,6 +14,7 @@ a list of known ports and bindings is provided on [Zstandard homepage](http://ww
[
![Build Status
][
travisDevBadge
]
][travisLink]
[
![Build status
][
AppveyorDevBadge
]
][AppveyorLink]
[
![Build status
][
CircleDevBadge
]
][CircleLink]
[
![Build status
][
CirrusDevBadge
]
][CirrusLink]
[
travisDevBadge
]:
https://travis-ci.org/facebook/zstd.svg?branch=dev
"Continuous Integration test suite"
[
travisLink
]:
https://travis-ci.org/facebook/zstd
...
...
@@ -21,14 +22,16 @@ a list of known ports and bindings is provided on [Zstandard homepage](http://ww
[
AppveyorLink
]:
https://ci.appveyor.com/project/YannCollet/zstd-p0yf0
[
CircleDevBadge
]:
https://circleci.com/gh/facebook/zstd/tree/dev.svg?style=shield
"Short test suite"
[
CircleLink
]:
https://circleci.com/gh/facebook/zstd
[
CirrusDevBadge
]:
https://api.cirrus-ci.com/github/facebook/zstd.svg?branch=dev
[
CirrusLink
]:
https://cirrus-ci.com/github/facebook/zstd
## Benchmarks
For reference, several fast compression algorithms were tested and compared
on a server running Linux
Debian
(
`Linux version
4.14.0-3-amd64
`
),
with a Core i
7-67
00K CPU @
4
.0GHz,
on a server running
Arch
Linux (
`Linux version
5.0.5-arch1-1
`
),
with a Core i
9-99
00K CPU @
5
.0GHz,
using [lzbench], an open-source in-memory benchmark by @inikep
compiled with [gcc]
7.3.0
,
compiled with [gcc]
8.2.1
,
on the [Silesia compression corpus].
[
lzbench
]:
https://github.com/inikep/lzbench
...
...
@@ -37,14 +40,14 @@ on the [Silesia compression corpus].
| Compressor name | Ratio | Compression| Decompress.|
| --------------- | ------| -----------| ---------- |
|
**zstd 1.
3.4
-1**
| 2.8
77
|
47
0 MB/s | 13
8
0 MB/s |
| zlib 1.2.11 -1 | 2.743 | 110 MB/s | 4
0
0 MB/s |
| brotli 1.0.
2
-0 | 2.701 | 4
1
0 MB/s | 4
3
0 MB/s |
| quicklz 1.5.0 -1 | 2.238 |
55
0 MB/s |
71
0 MB/s |
| lzo1x 2.09 -1 | 2.10
8
| 6
5
0 MB/s |
83
0 MB/s |
| lz4 1.8.
1
| 2.101 |
75
0 MB/s |
370
0 MB/s |
| snappy 1.1.4 | 2.0
91
| 5
3
0 MB/s |
180
0 MB/s |
| lzf 3.6 -1 | 2.077 | 4
0
0 MB/s |
86
0 MB/s |
|
**zstd 1.
4.0
-1**
| 2.8
84
|
53
0 MB/s | 13
6
0 MB/s |
| zlib 1.2.11 -1 | 2.743 | 110 MB/s | 4
4
0 MB/s |
| brotli 1.0.
7
-0 | 2.701 | 4
3
0 MB/s | 4
7
0 MB/s |
| quicklz 1.5.0 -1 | 2.238 |
60
0 MB/s |
80
0 MB/s |
| lzo1x 2.09 -1 | 2.10
6
| 6
8
0 MB/s |
95
0 MB/s |
| lz4 1.8.
3
| 2.101 |
80
0 MB/s |
422
0 MB/s |
| snappy 1.1.4 | 2.0
73
| 5
8
0 MB/s |
202
0 MB/s |
| lzf 3.6 -1 | 2.077 | 4
4
0 MB/s |
93
0 MB/s |
[
zlib
]:
http://www.zlib.net/
[
LZ4
]:
http://www.lz4.org/
...
...
contrib/adaptive-compression/Makefile
View file @
8567a728
...
...
@@ -13,7 +13,7 @@ CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
CFLAGS
?=
-O3
CFLAGS
+=
-Wall
-Wextra
-Wcast-qual
-Wcast-align
-Wshadow
\
-Wstrict-aliasing
=
1
-Wswitch-enum
-Wdeclaration-after-statement
\
-Wstrict-prototypes
-Wundef
-Wformat-security
\
-Wstrict-prototypes
-Wundef
\
-Wvla
-Wformat
=
2
-Winit-self
-Wfloat-equal
-Wwrite-strings
\
-Wredundant-decls
CFLAGS
+=
$(
DEBUGFLAGS
)
...
...
@@ -22,10 +22,10 @@ FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MULTITHREAD_LDFLAGS)
all
:
adapt datagen
adapt
:
$(ZSTD_FILES) $(PRGDIR)/util.c adapt.c
adapt
:
$(ZSTD_FILES) $(PRGDIR)/util.c
$(PRGDIR)/timefn.c
adapt.c
$(
CC
)
$(
FLAGS
)
$^
-o
$@
adapt-debug
:
$(ZSTD_FILES) $(PRGDIR)/util.c adapt.c
adapt-debug
:
$(ZSTD_FILES) $(PRGDIR)/util.c
$(PRGDIR)/timefn.c
adapt.c
$(
CC
)
$(
FLAGS
)
-DDEBUG_MODE
=
2
$^
-o
adapt
datagen
:
$(PRGDIR)/datagen.c datagencli.c
...
...
contrib/adaptive-compression/adapt.c
View file @
8567a728
...
...
@@ -13,6 +13,7 @@
#include
<string.h>
/* memset */
#include
"zstd_internal.h"
#include
"util.h"
#include
"timefn.h"
/* UTIL_time_t, UTIL_getTime, UTIL_getSpanTimeMicro */
#define DISPLAY(...) fprintf(stderr, __VA_ARGS__)
#define PRINT(...) fprintf(stdout, __VA_ARGS__)
...
...
contrib/docker/README.md
View file @
8567a728
...
...
@@ -5,7 +5,7 @@ The `Dockerfile` script requires a version of `docker` >= 17.05
## Installing docker
The offici
e
l docker install docs use a ppa with a modern version available:
The offici
a
l docker install docs use a ppa with a modern version available:
https://docs.docker.com/install/linux/docker-ce/ubuntu/
## How to run
...
...
contrib/experimental_dict_builders/benchmarkDictBuilder/benchmark.c
View file @
8567a728
...
...
@@ -127,7 +127,7 @@ dictInfo* createDictFromFiles(sampleInfo *info, unsigned maxDictSize,
/** compressWithDict() :
* Compress samples from sample buffer given dicionary stored on dictionary buffer and compression level
* Compress samples from sample buffer given dic
t
ionary stored on dictionary buffer and compression level
* @return compression ratio
*/
double
compressWithDict
(
sampleInfo
*
srcInfo
,
dictInfo
*
dInfo
,
int
compressionLevel
,
int
displayLevel
)
{
...
...
@@ -194,7 +194,7 @@ double compressWithDict(sampleInfo *srcInfo, dictInfo* dInfo, int compressionLev
totalCompressedSize
+=
compressedSize
;
}
/* Sum orignal sizes */
/* Sum orig
i
nal sizes */
for
(
i
=
0
;
i
<
srcInfo
->
nbSamples
;
i
++
)
{
totalOriginalSize
+=
srcInfo
->
samplesSizes
[
i
];
}
...
...
contrib/experimental_dict_builders/fastCover/fastCover.c
View file @
8567a728
...
...
@@ -125,7 +125,7 @@ typedef struct {
*
* Score(S) = F(S_1) + F(S_2) + ... + F(S_{k-d+1})
*
* Once the dmer with hash value d is in the dictionay we set F(d) = F(d)/2.
* Once the dmer with hash value d is in the dictiona
r
y we set F(d) = F(d)/2.
*/
static
FASTCOVER_segment_t
FASTCOVER_selectSegment
(
const
FASTCOVER_ctx_t
*
ctx
,
U32
*
freqs
,
U32
begin
,
U32
end
,
...
...
@@ -149,7 +149,7 @@ static FASTCOVER_segment_t FASTCOVER_selectSegment(const FASTCOVER_ctx_t *ctx,
while
(
activeSegment
.
end
<
end
)
{
/* Get hash value of current dmer */
const
size_t
index
=
FASTCOVER_hashPtrToIndex
(
ctx
->
samples
+
activeSegment
.
end
,
parameters
.
f
,
ctx
->
d
);
/* Add frequency of this index to score if this is the first occurence of index in active segment */
/* Add frequency of this index to score if this is the first occur
r
ence of index in active segment */
if
(
ctx
->
segmentFreqs
[
index
]
==
0
)
{
activeSegment
.
score
+=
freqs
[
index
];
}
...
...
contrib/largeNbDicts/Makefile
View file @
8567a728
...
...
@@ -18,7 +18,7 @@ CFLAGS ?= -O3
CFLAGS
+=
-std
=
gnu99
DEBUGFLAGS
=
-Wall
-Wextra
-Wcast-qual
-Wcast-align
-Wshadow
\
-Wstrict-aliasing
=
1
-Wswitch-enum
\
-Wstrict-prototypes
-Wundef
-Wpointer-arith
-Wformat-security
\
-Wstrict-prototypes
-Wundef
-Wpointer-arith
\
-Wvla
-Wformat
=
2
-Winit-self
-Wfloat-equal
-Wwrite-strings
\
-Wredundant-decls
CFLAGS
+=
$(
DEBUGFLAGS
)
$(
MOREFLAGS
)
...
...
@@ -28,7 +28,7 @@ default: largeNbDicts
all
:
largeNbDicts
largeNbDicts
:
util.o benchfn.o datagen.o xxhash.o largeNbDicts.c $(LIBZSTD)
largeNbDicts
:
util.o
timefn.o
benchfn.o datagen.o xxhash.o largeNbDicts.c $(LIBZSTD)
$(
CC
)
$(
CPPFLAGS
)
$(
CFLAGS
)
$^
$(
LDFLAGS
)
-o
$@
.PHONY
:
$(LIBZSTD)
...
...
@@ -38,6 +38,9 @@ $(LIBZSTD):
benchfn.o
:
$(PROGDIR)/benchfn.c
$(
CC
)
$(
CPPFLAGS
)
$(
CFLAGS
)
$^
-c
timefn.o
:
$(PROGDIR)/timefn.c
$(
CC
)
$(
CPPFLAGS
)
$(
CFLAGS
)
$^
-c
datagen.o
:
$(PROGDIR)/datagen.c
$(
CC
)
$(
CPPFLAGS
)
$(
CFLAGS
)
$^
-c
...
...
@@ -48,6 +51,7 @@ util.o: $(PROGDIR)/util.c
xxhash.o
:
$(LIBDIR)/common/xxhash.c
$(
CC
)
$(
CPPFLAGS
)
$(
CFLAGS
)
$^
-c
clean
:
$(
RM
)
*
.o
$(
MAKE
)
-C
$(
LIBDIR
)
clean
>
/dev/null
...
...
contrib/largeNbDicts/largeNbDicts.c
View file @
8567a728
...
...
@@ -424,7 +424,7 @@ static ddict_collection_t createDDictCollection(const void* dictBuffer, size_t d
}
/* mess with adresses, so that linear scanning dictionaries != linear address scanning */
/* mess with ad
d
resses, so that linear scanning dictionaries != linear address scanning */
void
shuffleDictionaries
(
ddict_collection_t
dicts
)
{
size_t
const
nbDicts
=
dicts
.
nbDDict
;
...
...
@@ -559,7 +559,7 @@ static int benchMem(slice_collection_t dstBlocks,
CONTROL
(
BMK_isSuccessful_runOutcome
(
outcome
));
BMK_runTime_t
const
result
=
BMK_extract_runTime
(
outcome
);
U64
const
dTime_ns
=
result
.
nanoSecPerRun
;
double
const
dTime_ns
=
result
.
nanoSecPerRun
;
double
const
dTime_sec
=
(
double
)
dTime_ns
/
1000000000
;
size_t
const
srcSize
=
result
.
sumOfReturn
;
double
const
dSpeed_MBps
=
(
double
)
srcSize
/
dTime_sec
/
(
1
MB
);
...
...
contrib/linux-kernel/0002-lib-Add-zstd-modules.patch
View file @
8567a728
...
...
@@ -4,7 +4,7 @@ Date: Mon, 17 Jul 2017 17:08:19 -0700
Subject: [PATCH v5 2/5] lib: Add zstd modules
Add zstd compression and decompression kernel modules.
zstd offers a wide varity of compression speed and quality trade-offs.
zstd offers a wide vari
e
ty of compression speed and quality trade-offs.
It can compress at speeds approaching lz4, and quality approaching lzma.
zstd decompressions at speeds more than twice as fast as zlib, and
decompression speed remains roughly the same across all compression levels.
...
...
@@ -21,7 +21,7 @@ will be easier to keep the kernel zstd up to date.
I benchmarked zstd compression as a special character device. I ran zstd
and zlib compression at several levels, as well as performing no
compression, which measure the time spent copying the data to kernel space.
Data is passed to the compress
e
r 4096 B at a time. The benchmark file is
Data is passed to the compress
o
r 4096 B at a time. The benchmark file is
located in the upstream zstd source repository under
`contrib/linux-kernel/zstd_compress_test.c` [2].
...
...
@@ -86,7 +86,7 @@ Tested in userland using the test-suite in the zstd repo under
`contrib/linux-kernel/test/UserlandTest.cpp` [5] by mocking the kernel
functions. Fuzz tested using libfuzzer [6] with the fuzz harnesses under
`contrib/linux-kernel/test/{RoundTripCrash.c,DecompressCrash.c}` [7] [8]
with ASAN, UBSAN, and MSAN. Additionaly, it was tested while testing the
with ASAN, UBSAN, and MSAN. Additional
l
y, it was tested while testing the
BtrFS and SquashFS patches coming next.
[1] https://clang.llvm.org/docs/ClangFormat.html
...
...
@@ -4200,14 +4200,14 @@ index 0000000..ff18ae6
+ BYTE const windowLogByte = (BYTE)((params.cParams.windowLog - ZSTD_WINDOWLOG_ABSOLUTEMIN) << 3);
+ U32 const fcsCode =
+ params.fParams.contentSizeFlag ? (pledgedSrcSize >= 256) + (pledgedSrcSize >= 65536 + 256) + (pledgedSrcSize >= 0xFFFFFFFFU) : 0; /* 0-3 */
+ BYTE const frameHeaderDecriptionByte = (BYTE)(dictIDSizeCode + (checksumFlag << 2) + (singleSegment << 5) + (fcsCode << 6));
+ BYTE const frameHeaderDe
s
criptionByte = (BYTE)(dictIDSizeCode + (checksumFlag << 2) + (singleSegment << 5) + (fcsCode << 6));
+ size_t pos;
+
+ if (dstCapacity < ZSTD_frameHeaderSize_max)
+ return ERROR(dstSize_tooSmall);
+
+ ZSTD_writeLE32(dst, ZSTD_MAGICNUMBER);
+ op[4] = frameHeaderDecriptionByte;
+ op[4] = frameHeaderDe
s
criptionByte;
+ pos = 5;
+ if (!singleSegment)
+ op[pos++] = windowLogByte;
...
...
@@ -8812,8 +8812,8 @@ index 0000000..ef3d174
+ U32 position = 0;
+ U32 symbol;
+ for (symbol = 0; symbol <= maxSymbolValue; symbol++) {
+ int nbOccurences;
+ for (nbOccurences = 0; nbOccurences < normalizedCounter[symbol]; nbOccurences++) {
+ int nbOccur
r
ences;
+ for (nbOccur
r
ences = 0; nbOccur
r
ences < normalizedCounter[symbol]; nbOccur
r
ences++) {
+ tableSymbol[position] = (FSE_FUNCTION_TYPE)symbol;
+ position = (position + step) & tableMask;
+ while (position > highThreshold)
...
...
@@ -9944,7 +9944,7 @@ index 0000000..2143da2
+ HUF_repeat_none, /**< Cannot use the previous table */
+ HUF_repeat_check, /**< Can use the previous table but it must be checked. Note : The previous table must have been constructed by HUF_compress{1,
+ 4}X_repeat */
+ HUF_repeat_valid /**< Can use the previous table and it is asumed to be valid */
+ HUF_repeat_valid /**< Can use the previous table and it is as
s
umed to be valid */
+} HUF_repeat;
+/** HUF_compress4X_repeat() :
+* Same as HUF_compress4X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none.
...
...
contrib/linux-kernel/0006-squashfs-tools-Add-zstd-support.patch
View file @
8567a728
...
...
@@ -11,7 +11,7 @@ Signed-off-by: Nick Terrell <terrelln@fb.com>
---
v4 -> v5:
- Fix patch documentation to reflect that Sean Purcell is the author
- Don't strip trailing whitespace of unrel
e
ated code
- Don't strip trailing whitespace of unrelated code
- Make zstd_display_options() static
v5 -> v6:
...
...
@@ -224,7 +224,7 @@ index 0000000..dcab75a
+ * set the default options, this is to ensure any user supplied
+ * -X options on the appending mksquashfs command line are over-ridden.
+ *
+ * This function returns 0 on sucessful extraction of options, and -1 on error.
+ * This function returns 0 on suc
c
essful extraction of options, and -1 on error.
+ */
+static int zstd_extract_options(int block_size, void *buffer, int size)
+{
...
...
contrib/linux-kernel/lib/zstd/compress.c
View file @
8567a728
...
...
@@ -2436,14 +2436,14 @@ static size_t ZSTD_writeFrameHeader(void *dst, size_t dstCapacity, ZSTD_paramete
BYTE
const
windowLogByte
=
(
BYTE
)((
params
.
cParams
.
windowLog
-
ZSTD_WINDOWLOG_ABSOLUTEMIN
)
<<
3
);
U32
const
fcsCode
=
params
.
fParams
.
contentSizeFlag
?
(
pledgedSrcSize
>=
256
)
+
(
pledgedSrcSize
>=
65536
+
256
)
+
(
pledgedSrcSize
>=
0xFFFFFFFFU
)
:
0
;
/* 0-3 */
BYTE
const
frameHeaderDecriptionByte
=
(
BYTE
)(
dictIDSizeCode
+
(
checksumFlag
<<
2
)
+
(
singleSegment
<<
5
)
+
(
fcsCode
<<
6
));
BYTE
const
frameHeaderDe
s
criptionByte
=
(
BYTE
)(
dictIDSizeCode
+
(
checksumFlag
<<
2
)
+
(
singleSegment
<<
5
)
+
(
fcsCode
<<
6
));
size_t
pos
;
if
(
dstCapacity
<
ZSTD_frameHeaderSize_max
)
return
ERROR
(
dstSize_tooSmall
);
ZSTD_writeLE32
(
dst
,
ZSTD_MAGICNUMBER
);
op
[
4
]
=
frameHeaderDecriptionByte
;
op
[
4
]
=
frameHeaderDe
s
criptionByte
;
pos
=
5
;
if
(
!
singleSegment
)
op
[
pos
++
]
=
windowLogByte
;
...
...
contrib/linux-kernel/lib/zstd/fse_compress.c
View file @
8567a728
...
...
@@ -141,8 +141,8 @@ size_t FSE_buildCTable_wksp(FSE_CTable *ct, const short *normalizedCounter, unsi
U32
position
=
0
;
U32
symbol
;
for
(
symbol
=
0
;
symbol
<=
maxSymbolValue
;
symbol
++
)
{
int
nbOccurences
;
for
(
nbOccurences
=
0
;
nbOccurences
<
normalizedCounter
[
symbol
];
nbOccurences
++
)
{
int
nbOccur
r
ences
;
for
(
nbOccur
r
ences
=
0
;
nbOccur
r
ences
<
normalizedCounter
[
symbol
];
nbOccur
r
ences
++
)
{
tableSymbol
[
position
]
=
(
FSE_FUNCTION_TYPE
)
symbol
;
position
=
(
position
+
step
)
&
tableMask
;
while
(
position
>
highThreshold
)
...
...
contrib/linux-kernel/lib/zstd/huf.h
View file @
8567a728
...
...
@@ -134,7 +134,7 @@ typedef enum {
HUF_repeat_none
,
/**< Cannot use the previous table */
HUF_repeat_check
,
/**< Can use the previous table but it must be checked. Note : The previous table must have been constructed by HUF_compress{1,
4}X_repeat */
HUF_repeat_valid
/**< Can use the previous table and it is asumed to be valid */
HUF_repeat_valid
/**< Can use the previous table and it is as
s
umed to be valid */
}
HUF_repeat
;
/** HUF_compress4X_repeat() :
* Same as HUF_compress4X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none.
...
...
contrib/linux-kernel/test/include/linux/compiler.h
View file @
8567a728
#ifndef LINUX_COM
I
PLER_H_
#define LINUX_COM
I
PLER_H_
#ifndef LINUX_COMP
I
LER_H_
#define LINUX_COMP
I
LER_H_
#ifndef __always_inline
# define __always_inline inline
...
...
@@ -9,4 +9,4 @@
# define noinline __attribute__((__noinline__))
#endif
#endif // LINUX_COM
I
PLER_H_
#endif // LINUX_COMP
I
LER_H_
contrib/pzstd/Makefile
View file @
8567a728
...
...
@@ -190,13 +190,15 @@ $(ZSTDDIR)/libzstd.a: $(ZSTD_FILES)
CFLAGS
=
"
$(
ALL_CFLAGS
)
"
LDFLAGS
=
"
$(
ALL_LDFLAGS
)
"
$(
MAKE
)
-C
$(
ZSTDDIR
)
libzstd.a
# Rules to build the tests
test/RoundTripTest$(EXT)
:
test/RoundTripTest.o $(PROGDIR)/datagen.o Options.o
\
test/RoundTripTest$(EXT)
:
test/RoundTripTest.o $(PROGDIR)/datagen.o
\
$(PROGDIR)/util.o Options.o
\
Pzstd.o SkippableFrame.o $(ZSTDDIR)/libzstd.a
$(
LD_COMMAND
)
test/%Test$(EXT)
:
PZSTD_LDFLAGS += $(GTEST_LIB)
test/%Test$(EXT)
:
LIBS += -lgtest -lgtest_main
test/%Test$(EXT)
:
test/%Test.o $(PROGDIR)/datagen.o Options.o Pzstd.o
\
test/%Test$(EXT)
:
test/%Test.o $(PROGDIR)/datagen.o
\
$(PROGDIR)/util.o Options.o Pzstd.o
\
SkippableFrame.o $(ZSTDDIR)/libzstd.a
$(
LD_COMMAND
)
...
...
contrib/pzstd/Pzstd.cpp
View file @
8567a728
...
...
@@ -55,7 +55,7 @@ static std::uint64_t handleOneInput(const Options &options,
SharedState
&
state
)
{
auto
inputSize
=
fileSizeOrZero
(
inputFile
);
// WorkQueue outlives ThreadPool so in the case of error we are certain
// we don't accidently try to call push() on it after it is destroyed
// we don't accident
al
ly try to call push() on it after it is destroyed
WorkQueue
<
std
::
shared_ptr
<
BufferWorkQueue
>>
outs
{
options
.
numThreads
+
1
};
std
::
uint64_t
bytesRead
;
std
::
uint64_t
bytesWritten
;
...
...
contrib/pzstd/utils/Range.h
View file @
8567a728
...
...
@@ -9,7 +9,7 @@
/**
* A subset of `folly/Range.h`.
* All code copied verbati
a
m modulo formatting
* All code copied verbatim modulo formatting
*/
#pragma once
...
...
Prev
1
2
3
4
5
…
8
Next