platform/upstream/lz4.git
3 years agoMerge pull request #954 from lz4/dev
Yann Collet [Sun, 15 Nov 2020 23:53:42 +0000 (15:53 -0800)]
Merge pull request #954 from lz4/dev

v1.9.3

3 years agoupdate doc
Yann Collet [Sun, 15 Nov 2020 09:31:09 +0000 (01:31 -0800)]
update doc

3 years agoMerge pull request #953 from lz4/vs2005
Yann Collet [Sun, 15 Nov 2020 09:23:40 +0000 (01:23 -0800)]
Merge pull request #953 from lz4/vs2005

better MSVC conformance

3 years agofix minor win32 warning
Yann Collet [Sun, 15 Nov 2020 04:39:23 +0000 (20:39 -0800)]
fix minor win32 warning

3 years agofixed minor Visual warning
Yann Collet [Sun, 15 Nov 2020 01:25:31 +0000 (17:25 -0800)]
fixed minor Visual warning

doesn't happen on my environment, though it's a different version of Visual Studio

3 years agoMerge pull request #952 from lz4/lz4io
Yann Collet [Sun, 15 Nov 2020 00:49:43 +0000 (16:49 -0800)]
Merge pull request #952 from lz4/lz4io

Fix --sparse mode

3 years agobetter visual conformance
Yann Collet [Sun, 15 Nov 2020 00:24:36 +0000 (16:24 -0800)]
better visual conformance

only include <intrin.h> on vs2005+ (#947)
remove some useless #pragma
fix a few minor Visual warnings

3 years agoMerge branch 'dev' of github.com:Cyan4973/lz4 into dev
Yann Collet [Sat, 14 Nov 2020 22:26:48 +0000 (14:26 -0800)]
Merge branch 'dev' of github.com:Cyan4973/lz4 into dev

3 years agorestrict BitScanForward() to VS2005+
Yann Collet [Sat, 14 Nov 2020 22:26:08 +0000 (14:26 -0800)]
restrict BitScanForward() to VS2005+

suggested by @aqrit in #947

3 years agofix minor parse warning
Yann Collet [Sat, 14 Nov 2020 20:44:18 +0000 (12:44 -0800)]
fix minor parse warning

3 years agoall usages of prefs within lz4io are const
Yann Collet [Sat, 14 Nov 2020 20:40:17 +0000 (12:40 -0800)]
all usages of prefs within lz4io are const

3 years agoLZ4IO_openDstFile() doesn't need pref mutability
Yann Collet [Sat, 14 Nov 2020 19:13:08 +0000 (11:13 -0800)]
LZ4IO_openDstFile() doesn't need pref mutability

3 years agofixed force --sparse mode
Yann Collet [Sat, 14 Nov 2020 18:52:19 +0000 (10:52 -0800)]
fixed force --sparse mode

3 years agoMerge pull request #951 from lz4/lz4io
Yann Collet [Sat, 14 Nov 2020 16:18:20 +0000 (08:18 -0800)]
Merge pull request #951 from lz4/lz4io

minor refactor of lz4io

3 years agodictionary functions don't need prefs mutability
Yann Collet [Sat, 14 Nov 2020 06:20:49 +0000 (22:20 -0800)]
dictionary functions don't need prefs mutability

3 years agoLZ4IO_createDict() doesn't need prefs
Yann Collet [Sat, 14 Nov 2020 06:16:39 +0000 (22:16 -0800)]
LZ4IO_createDict() doesn't need prefs

3 years agoLZ4IO_decompressSrcFile() doesn't need mutable prefs
Yann Collet [Sat, 14 Nov 2020 05:51:08 +0000 (21:51 -0800)]
LZ4IO_decompressSrcFile() doesn't need mutable prefs

3 years agoselectDecoder() doesn't need mutable prefs
Yann Collet [Sat, 14 Nov 2020 05:49:43 +0000 (21:49 -0800)]
selectDecoder() doesn't need mutable prefs

3 years agoLZ4IO_passThrough() doesn't need prefs
Yann Collet [Sat, 14 Nov 2020 05:47:17 +0000 (21:47 -0800)]
LZ4IO_passThrough() doesn't need prefs

3 years agoLZ4IO_decompressLZ4F() doesn't need mutable prefs
Yann Collet [Sat, 14 Nov 2020 04:57:26 +0000 (20:57 -0800)]
LZ4IO_decompressLZ4F() doesn't need mutable prefs

3 years agoLZ4IO_decodeLegacyStream() doesn't need mutable prefs
Yann Collet [Sat, 14 Nov 2020 04:51:49 +0000 (20:51 -0800)]
LZ4IO_decodeLegacyStream() doesn't need mutable prefs

3 years agoLZ4IO_fwriteSparse doesn't need writable prefs
Yann Collet [Sat, 14 Nov 2020 00:44:39 +0000 (16:44 -0800)]
LZ4IO_fwriteSparse doesn't need writable prefs

3 years agominor refactor
Yann Collet [Fri, 13 Nov 2020 19:55:33 +0000 (11:55 -0800)]
minor refactor

mostly on the compression code path

3 years agominor refactor of lz4io
Yann Collet [Fri, 13 Nov 2020 18:53:59 +0000 (10:53 -0800)]
minor refactor of lz4io

for readability.
Mostly around --list capability

3 years agoMerge pull request #950 from lz4/appvtest
Yann Collet [Fri, 13 Nov 2020 16:44:11 +0000 (08:44 -0800)]
Merge pull request #950 from lz4/appvtest

appveyor artifact generation

3 years agoappveyor artifact generation
Yann Collet [Thu, 12 Nov 2020 01:12:35 +0000 (17:12 -0800)]
appveyor artifact generation

fix presence of the dynamic library in produced package

3 years agoMerge pull request #949 from lz4/cmakedll
Yann Collet [Wed, 11 Nov 2020 23:48:35 +0000 (15:48 -0800)]
Merge pull request #949 from lz4/cmakedll

fix cmake build of shared dll with visual

3 years agoMerge pull request #946 from lz4/customMem
Yann Collet [Wed, 11 Nov 2020 23:43:17 +0000 (15:43 -0800)]
Merge pull request #946 from lz4/customMem

proposal for LZ4_USER_MEMORY_FUNCTIONS

3 years agofix cmake build of shared dll with visual
Yann Collet [Wed, 11 Nov 2020 08:32:49 +0000 (00:32 -0800)]
fix cmake build of shared dll with visual

inspired from #891

3 years agoupdated NEWS for v1.9.3
Yann Collet [Tue, 10 Nov 2020 05:56:49 +0000 (21:56 -0800)]
updated NEWS for v1.9.3

3 years agominor : lz4frame include stdlib only if needed
Yann Collet [Tue, 10 Nov 2020 05:23:56 +0000 (21:23 -0800)]
minor : lz4frame include stdlib only if needed

3 years agoproper fullbench's LZ4_calloc()
Yann Collet [Mon, 9 Nov 2020 18:58:31 +0000 (10:58 -0800)]
proper fullbench's LZ4_calloc()

3 years agochanged LZ4_calloc() to a 2-arguments signature
Yann Collet [Mon, 9 Nov 2020 16:44:26 +0000 (08:44 -0800)]
changed LZ4_calloc() to a 2-arguments signature

to remain similar to stdlib's calloc().

Updated test to use c++ compiler for stricter signature check.

3 years agofix fullbench's LZ4_free()
Yann Collet [Mon, 9 Nov 2020 08:29:52 +0000 (00:29 -0800)]
fix fullbench's LZ4_free()

3 years agofix travis test
Yann Collet [Mon, 9 Nov 2020 07:36:24 +0000 (23:36 -0800)]
fix travis test

3 years agoMerge branch 'dev' into customMem
Yann Collet [Mon, 9 Nov 2020 07:26:19 +0000 (23:26 -0800)]
Merge branch 'dev' into customMem

3 years agofirst proposal for LZ4_USER_MEMORY_FUNCTIONS
Yann Collet [Mon, 9 Nov 2020 05:17:32 +0000 (21:17 -0800)]
first proposal for LZ4_USER_MEMORY_FUNCTIONS

makes it possible to replace at link time
malloc, calloc and free
by user-provided functions
which must be named LZ4_malloc(), LZ4_calloc() and LZ4_free().

answer #937

3 years agoMerge pull request #944 from lz4/fix874
Yann Collet [Mon, 9 Nov 2020 04:48:20 +0000 (20:48 -0800)]
Merge pull request #944 from lz4/fix874

fix #874

3 years agoMerge pull request #943 from lz4/fullbench_dec
Yann Collet [Mon, 9 Nov 2020 04:47:55 +0000 (20:47 -0800)]
Merge pull request #943 from lz4/fullbench_dec

Added decompression tests in fullbench

3 years agoMerge pull request #945 from lz4/fix926
Yann Collet [Mon, 9 Nov 2020 04:47:19 +0000 (20:47 -0800)]
Merge pull request #945 from lz4/fix926

fixed remaining ubsan warnings

3 years agoattempt at silencing cppcheck
Yann Collet [Mon, 9 Nov 2020 03:48:47 +0000 (19:48 -0800)]
attempt at silencing cppcheck

3 years agofixed remaining ubsan warnings
Yann Collet [Mon, 9 Nov 2020 02:08:43 +0000 (18:08 -0800)]
fixed remaining ubsan warnings

3 years agofix #874
Yann Collet [Sun, 8 Nov 2020 21:21:58 +0000 (13:21 -0800)]
fix #874

coverity reported a warning regarding a memcpy() overwrite.
This is a false positive (the memory area is large enough),
but it's true that it's not trivial to determine (encompassing struct),
and it's proper anyway to only memcpy() just the right amount of data.

3 years agofullbench: added LZ4F_decompress_noHint()
Yann Collet [Wed, 4 Dec 2019 16:57:12 +0000 (08:57 -0800)]
fullbench: added LZ4F_decompress_noHint()

3 years agoadded test for LZ4_decompress_safe_withPrefix64k()
Yann Collet [Wed, 4 Dec 2019 16:49:06 +0000 (08:49 -0800)]
added test for LZ4_decompress_safe_withPrefix64k()

3 years agoupdate obsolete section documentation
Yann Collet [Sun, 8 Nov 2020 20:54:59 +0000 (12:54 -0800)]
update obsolete section documentation

and update manuals.
fix #712

3 years agoMerge pull request #942 from lz4/fix926
Yann Collet [Sun, 8 Nov 2020 05:05:27 +0000 (21:05 -0800)]
Merge pull request #942 from lz4/fix926

fix #926

3 years agofix minor UBs
Yann Collet [Sun, 8 Nov 2020 03:38:07 +0000 (19:38 -0800)]
fix minor UBs

- check alignment before casting a pointer
- saveDict : don't memmove() on NULL dst

3 years agoadded similar tests for LZ4_saveDict()
Yann Collet [Sun, 8 Nov 2020 02:24:02 +0000 (18:24 -0800)]
added similar tests for LZ4_saveDict()

fast (non-HC) variant

3 years agofix #926
Yann Collet [Sun, 8 Nov 2020 02:12:26 +0000 (18:12 -0800)]
fix #926

fix incorrect behavior of LZ4_saveDictHC()
when invoked right after initialization.

3 years agoMerge pull request #941 from lz4/revertinline
Yann Collet [Sun, 8 Nov 2020 01:18:04 +0000 (17:18 -0800)]
Merge pull request #941 from lz4/revertinline

Revert "Replace "static" to "LZ4_FORCE_INLINE" for small functions"

3 years agoMerge pull request #940 from lz4/fix935
Yann Collet [Sun, 8 Nov 2020 00:12:41 +0000 (16:12 -0800)]
Merge pull request #940 from lz4/fix935

fix #935

3 years agoRevert "Replace "static" to "LZ4_FORCE_INLINE" for small functions"
Yann Collet [Sat, 7 Nov 2020 19:02:30 +0000 (11:02 -0800)]
Revert "Replace "static" to "LZ4_FORCE_INLINE" for small functions"

This reverts commit 0e3933edd435c54cc2e21e38f5d4ba7bf644a24e.

3 years agofix #935
Yann Collet [Sat, 7 Nov 2020 18:06:52 +0000 (10:06 -0800)]
fix #935

minor: identical declaration and prototypes of `LZ4HC_compress_optimal()`

also :
very minor optimization of `LZ4_memcpy_using_offset()`

3 years agoMerge pull request #939 from lz4/fix927
Yann Collet [Sat, 7 Nov 2020 17:37:27 +0000 (09:37 -0800)]
Merge pull request #939 from lz4/fix927

LZ4F_decompress requires a valid dctx state

3 years agoLZ4F_decompress requires a valid dctx state
Yann Collet [Sat, 7 Nov 2020 04:46:35 +0000 (20:46 -0800)]
LZ4F_decompress requires a valid dctx state

This is now explicitly documented and asserted.
fix #927

3 years agoMerge pull request #936 from lz4/alignTest
Yann Collet [Sat, 7 Nov 2020 04:27:42 +0000 (20:27 -0800)]
Merge pull request #936 from lz4/alignTest

More alignment tests

3 years agostatic state size
Yann Collet [Sat, 7 Nov 2020 02:26:13 +0000 (18:26 -0800)]
static state size

for better inter-version compatibility

3 years agore-enable alignment test on all targets
Yann Collet [Sat, 7 Nov 2020 00:43:14 +0000 (16:43 -0800)]
re-enable alignment test on all targets

3 years agounified internal state declaration
Yann Collet [Sat, 7 Nov 2020 00:15:51 +0000 (16:15 -0800)]
unified internal state declaration

align on `void*` instead : there is no `long long` inside the structure

3 years agodocument LZ4_ALIGN_TEST
Yann Collet [Fri, 6 Nov 2020 22:48:43 +0000 (14:48 -0800)]
document LZ4_ALIGN_TEST

3 years agounified alignment test
Yann Collet [Fri, 6 Nov 2020 22:46:48 +0000 (14:46 -0800)]
unified alignment test

across lz4.c and lz4hc.c

3 years agoMerge pull request #938 from terrelln/fuzzer-fix
Yann Collet [Fri, 6 Nov 2020 18:34:05 +0000 (10:34 -0800)]
Merge pull request #938 from terrelln/fuzzer-fix

[ossfuzz] Fix parallel builds

3 years ago[ossfuzz] Fix parallel builds
Nick Terrell [Thu, 5 Nov 2020 18:27:43 +0000 (10:27 -0800)]
[ossfuzz] Fix parallel builds

With `make -j` multiple builds of `standaloneengine.o` happened in
parallel. Fix this by detecting `standaloneengine.o` and moving it to a
depedency.

3 years agofix minor explicit cast
Yann Collet [Sat, 31 Oct 2020 08:55:04 +0000 (01:55 -0700)]
fix minor explicit cast

3 years agoMerge pull request #930 from remittor-pr/fix_msvc
Yann Collet [Sat, 31 Oct 2020 08:44:21 +0000 (01:44 -0700)]
Merge pull request #930 from remittor-pr/fix_msvc

Fix: The "inline" specifier do not use for LZ4_wildCopy8 and LZ4_wildCopy32

3 years agoReplace "static" to "LZ4_FORCE_INLINE" for small functions
remittor [Wed, 7 Oct 2020 06:52:40 +0000 (09:52 +0300)]
Replace "static" to "LZ4_FORCE_INLINE" for small functions

The "static" specifier does not guarantee that the function will be inlined.

3 years agoReplace define LZ4_FORCE_O2_INLINE_GCC_PPC64LE to LZ4_FORCE_INLINE
remittor [Wed, 7 Oct 2020 06:51:08 +0000 (09:51 +0300)]
Replace define LZ4_FORCE_O2_INLINE_GCC_PPC64LE to LZ4_FORCE_INLINE

There is no reason to separate these two definitions!

3 years agoMerge pull request #928 from remittor-pr/human_redable
Yann Collet [Tue, 6 Oct 2020 17:49:42 +0000 (10:49 -0700)]
Merge pull request #928 from remittor-pr/human_redable

Made function LZ4HC_encodeSequence a human readable

3 years agoFix: The "inline" specifier do not use for LZ4_wildCopy8 and LZ4_wildCopy32
remittor [Tue, 6 Oct 2020 14:16:43 +0000 (17:16 +0300)]
Fix: The "inline" specifier do not use for LZ4_wildCopy8 and LZ4_wildCopy32

This problem was reproduced on MSVC 2015 (32-bit). Both functions were called using the operator "call".

3 years ago[lz4hc] Made function LZ4HC_encodeSequence a human readable
remittor [Sat, 3 Oct 2020 15:28:24 +0000 (18:28 +0300)]
[lz4hc] Made function LZ4HC_encodeSequence a human readable

3 years agoreduce new test stack usage
Yann Collet [Sat, 3 Oct 2020 01:02:41 +0000 (18:02 -0700)]
reduce new test stack usage

use heap instead

3 years agoAppveyor: added compilation and runtime fuzzer tests
Yann Collet [Fri, 2 Oct 2020 23:37:34 +0000 (16:37 -0700)]
Appveyor: added compilation and runtime fuzzer tests

to all Windows compiler targets

3 years agopreserver alignment test on Visual Studio x64
Yann Collet [Fri, 2 Oct 2020 22:51:14 +0000 (15:51 -0700)]
preserver alignment test on Visual Studio x64

this it works fine in this environment
(only x86 is suspicious)

3 years agofixed x32 test on Travis
Yann Collet [Fri, 2 Oct 2020 22:43:46 +0000 (15:43 -0700)]
fixed x32 test on Travis

3 years agofix cppcheck unused variable warning
Yann Collet [Fri, 2 Oct 2020 21:10:00 +0000 (14:10 -0700)]
fix cppcheck unused variable warning

3 years agoadded LZ4_streamHC_t init test
Yann Collet [Fri, 2 Oct 2020 20:06:51 +0000 (13:06 -0700)]
added LZ4_streamHC_t init test

which includes an alignment test

3 years agoMerge pull request #925 from lz4/test_null
Yann Collet [Fri, 2 Oct 2020 15:30:25 +0000 (08:30 -0700)]
Merge pull request #925 from lz4/test_null

add LZ4F_decompress() tests with (NULL,0) input and output

3 years agodefine sentinelTest
Yann Collet [Fri, 2 Oct 2020 06:42:42 +0000 (23:42 -0700)]
define sentinelTest

to help scan-build detect the condition

3 years agomake it possible to select SCANBUILD binary on command line
Yann Collet [Fri, 2 Oct 2020 06:27:02 +0000 (23:27 -0700)]
make it possible to select SCANBUILD binary on command line

3 years agoadd LZ4F_decompress() tests with (NULL,0) input and output
Yann Collet [Fri, 2 Oct 2020 02:07:56 +0000 (19:07 -0700)]
add LZ4F_decompress() tests with (NULL,0) input and output

fix one (rare & complex) issue discovered by this test

3 years agoMerge pull request #924 from lz4/safixes
Yann Collet [Thu, 1 Oct 2020 19:53:27 +0000 (12:53 -0700)]
Merge pull request #924 from lz4/safixes

fix minor static analyzer warnings

3 years agomake scan-build accept assert()
Yann Collet [Thu, 1 Oct 2020 17:48:22 +0000 (10:48 -0700)]
make scan-build accept assert()

3 years agofix bad init scenario
Yann Collet [Thu, 1 Oct 2020 05:51:17 +0000 (22:51 -0700)]
fix bad init scenario

3 years agoadded memcpy() related SA warning fixes
Yann Collet [Thu, 1 Oct 2020 00:39:42 +0000 (17:39 -0700)]
added memcpy() related SA warning fixes

memcpy() on NULL is UB, even if length is 0.

3 years agoMerge branch 'safixes' of github.com:lz4/lz4 into safixes
Yann Collet [Wed, 30 Sep 2020 07:23:47 +0000 (00:23 -0700)]
Merge branch 'safixes' of github.com:lz4/lz4 into safixes

3 years agofix conversion warning
Yann Collet [Wed, 30 Sep 2020 04:53:42 +0000 (21:53 -0700)]
fix conversion warning

3 years agoMerge branch 'dev' into safixes
Yann Collet [Wed, 30 Sep 2020 00:21:59 +0000 (17:21 -0700)]
Merge branch 'dev' into safixes

3 years agofix minor static analyzer warnings
Yann Collet [Tue, 29 Sep 2020 05:37:20 +0000 (22:37 -0700)]
fix minor static analyzer warnings

detected by scan-build, cppcheck and advanved compilation flags
fix #786

3 years agofix minor static analyzer warnings
Yann Collet [Tue, 29 Sep 2020 05:37:20 +0000 (22:37 -0700)]
fix minor static analyzer warnings

detected by scan-build and cppcheck
fix #786

3 years agobump version number
Yann Collet [Tue, 29 Sep 2020 21:27:39 +0000 (14:27 -0700)]
bump version number

to v1.9.3

3 years agoMerge pull request #923 from lz4/fix784
Yann Collet [Mon, 28 Sep 2020 21:04:56 +0000 (14:04 -0700)]
Merge pull request #923 from lz4/fix784

fix efficiency of LZ4_compress_HC_destSize()

3 years agoimproved last literals run on LZ4_compress_destSize
Yann Collet [Mon, 28 Sep 2020 18:39:00 +0000 (11:39 -0700)]
improved last literals run on LZ4_compress_destSize

applying new more accurate formula from LZ4_compress_HC_destSize()

also : fix some minor display issue in tests/frametest

3 years agoensure last match not too close to end
Yann Collet [Mon, 28 Sep 2020 06:59:56 +0000 (23:59 -0700)]
ensure last match not too close to end

must respect MFLIMIT distance from oend

3 years agofix incorrect counting
Yann Collet [Mon, 28 Sep 2020 05:47:05 +0000 (22:47 -0700)]
fix incorrect counting

after truncation of last sequence

3 years agoMerge pull request #921 from lz4/doubleNull
Yann Collet [Mon, 28 Sep 2020 04:09:06 +0000 (21:09 -0700)]
Merge pull request #921 from lz4/doubleNull

fix compressing into NULL

3 years agoMerge pull request #922 from XVilka/tinycc-support
Yann Collet [Mon, 28 Sep 2020 04:08:26 +0000 (21:08 -0700)]
Merge pull request #922 from XVilka/tinycc-support

Fix compilation with TinyCC

3 years agofix efficiency of LZ4_compress_HC_destSize()
Yann Collet [Mon, 28 Sep 2020 04:04:40 +0000 (21:04 -0700)]
fix efficiency of LZ4_compress_HC_destSize()

LZ4_compress_HC_destSize() had a tendency
to discard its last match when this match overflowed specified dstBuffer limit.
The impact is generally moderate,
but occasionally huge,
typically when this last match is very large
(such as compressing a bunch of zeroes).

Issue #784 fixed for both Chain and Opt implementations.

Added a unit test suggested by @remittor checking this topic.

3 years agoFix compilation with TinyCC
Anton Kochkov [Sun, 27 Sep 2020 09:07:51 +0000 (17:07 +0800)]
Fix compilation with TinyCC

3 years agofix compressing into NULL
Yann Collet [Sat, 26 Sep 2020 18:31:57 +0000 (11:31 -0700)]
fix compressing into NULL

fails properly
bug discovered by oss-fuzz