Commit Graph

2134 Commits

Author SHA1 Message Date
Yann Collet
5db9a2f8b6 added make list target to tests 2019-04-08 13:45:01 -07:00
Yann Collet
c198a39a66 LZ4_initStream() checks alignment restriction
updated associated documentation
2019-04-08 12:49:54 -07:00
Yann Collet
34f0004a5e added comment on initStream + _extState_
as suggested by @felixhandte
2019-04-05 15:35:19 -07:00
Yann Collet
2ece0d8380 created LZ4_initStream()
- promoted LZ4_resetStream_fast() to stable
- moved LZ4_resetStream() into deprecate, but without triggering a compiler warning
- update all sources to no longer rely on LZ4_resetStream()

note : LZ4_initStream() proposal is slightly different :
it's able to initialize any buffer, provided that it's large enough.
To this end, it accepts a void*, and returns an LZ4_stream_t*.
2019-04-05 12:56:26 -07:00
Yann Collet
2a94faf462 fixed _GNU_SOURCE duplicate 2019-04-05 11:55:34 -07:00
Yann Collet
a4f1635b0a fuzzer: fixed strict c99 with mmap+MAP_ANONYMOUS 2019-04-05 11:47:06 -07:00
Yann Collet
c3f8928f87 fixed strict iso C90 2019-04-05 10:41:26 -07:00
Yann Collet
c491df54ec created LZ4_initStreamHC()
- promoted LZ4_resetStreamHC_fast() to stable
- moved LZ4_resetStreamHC() to deprecated (but do not generate a warning yet)
- Updated doc, to highlight difference between init and reset
- switched all invocations of LZ4_resetStreamHC() onto LZ4_initStreamHC()
- misc: ensure `make all` also builds /tests
2019-04-04 17:05:11 -07:00
Yann Collet
f66abc45d9
Merge pull request #658 from lz4/_fast
Deprecated LZ4_decompres_fast*() functions
2019-04-04 13:42:58 -07:00
Yann Collet
7a39fb8fb6 make _fast*() decoder generate a deprecation warning
updated modification
2019-04-04 12:47:36 -07:00
Yann Collet
ab91300509 moved LZ4_decompress_fast*() into deprecated section 2019-04-04 12:24:46 -07:00
Yann Collet
1a41b2b25c
Merge pull request #657 from lz4/destSize
moved _destSize() into "stable API" status
2019-04-03 17:15:06 -07:00
Yann Collet
b5bedefabe fixed an old bug in LZ4F_flush()
which remained undetected so far,
as it requires a fairly large number of conditions to be triggered,
starting with enabling Block checksum, which is disabled by default,
and which usage is known to be extremely rare.
2019-04-03 16:28:42 -07:00
Yann Collet
50f01d881d fixed doc
and bumped version number fo v1.9.0
2019-04-03 14:27:21 -07:00
Yann Collet
25da6cc967 moved _destSize() into "stable API" status
as requested in #642
2019-04-03 14:18:00 -07:00
Yann Collet
27a4c3c308
Merge pull request #656 from lz4/armtest
LZ4_FAST_DEC_LOOP macros
2019-04-03 10:03:26 -07:00
Yann Collet
f2755c9887 minor comments and reformatting 2019-04-03 08:59:29 -07:00
Yann Collet
753076bfa4 fixed minor conversion warnings 2019-04-02 17:16:43 -07:00
Yann Collet
2589c4424f created LZ4_FAST_DEC_LOOP build macro 2019-04-02 16:22:11 -07:00
Yann Collet
7d9d00f4df fixed a few minor conversion warnings 2019-04-02 16:06:37 -07:00
Yann Collet
c438548312
Merge pull request #652 from vtorri/dev
Allow installation of lz4 for Windows 10 with MSYS2
2019-03-03 13:40:45 -08:00
Vincent Torri
0360981f68 Allow installation of lz4 for Windows 10 with MSYS2 2019-03-03 22:06:38 +01:00
Yann Collet
d85bdb4ff2
Merge pull request #645 from djwatson/optimize_decompress_generic
Optimize decompress generic
2019-02-11 16:58:53 -08:00
Dave Watson
5d7d1166cb decompress_generic: Limit fastpath to x86
New fastpath currently shows a regression on qualcomm
arm chips.  Restrict it to x86 for now
2019-02-11 11:44:51 -08:00
Dave Watson
75fb878a90 decompress_generic: Add fastpath for small offsets
For small offsets of size 1, 2, 4 and 8, we can set a single uint64_t,
and then use it to do a memset() variation.  In particular, this makes
the somewhat-common RLE (offset 1) about 2-4x faster than the previous
implementation - we avoid not only the load blocked by store, but also
avoid the loads entirely.
2019-02-08 13:57:23 -08:00
Dave Watson
faac110e20 decompress_generic: Unroll loops a bit more
Generally we want our wildcopy loops to look like the
memcpy loops from our libc, but without the final byte copy checks.
We can unroll a bit to make long copies even faster.

The only catch is that this affects the value of FASTLOOP_SAFE_DISTANCE.
2019-02-08 13:57:23 -08:00
Dave Watson
1fbaf84306 decompress_generic: remove msan write
This store is also causing load-blocked-by-store issues, remove it.
The msan warning will have to be fixed another way if it is still an issue.
2019-02-08 13:57:23 -08:00
Dave Watson
28b824921d decompress_generic: re-add fastpath
This is the remaineder of the original 'shortcut'.  If true, we can avoid
the loop in LZ4_wildCopy, and directly copy instead.
2019-02-08 13:57:23 -08:00
Dave Watson
232f1e261f decompress_generic: drop partial copy check in fast loop
We've already checked that we are more than FASTLOOP_SAFE_DISTANCE
away from the end, so this branch can never be true, we will have
already jumped to the second decode loop.
2019-02-08 13:57:23 -08:00
Dave Watson
59332a3026 decompress_generic: Optimize literal copies
Use LZ4_wildCopy16 for variable-length literals.  For literal counts that
fit in the flag byte, copy directly.  We can also omit oend checks for
roughly the same reason as the previous shortcut:  We check once that both
match length and literal length fit in FASTLOOP_SAFE_DISTANCE, including
wildcopy distance.
2019-02-08 13:57:23 -08:00
Dave Watson
5dfa7d422b decompress_generic: optimize match copy
Add an LZ4_wildCopy16, that will wildcopy, potentially smashing up
to 16 bytes, and use it for match copy.  On x64, this avoids many
blocked loads due to store forwarding, similar to issue #411.
2019-02-08 13:57:23 -08:00
Dave Watson
28356e02ad decompress_generic: Add a loop fastpath
Copy the main loop, and change checks such that op is always less
than oend-SAFE_DISTANCE.  Currently these are added for the literal
copy length check, and for the match copy length check.

Otherwise the first loop is exactly the same as the second.  Follow on
diffs will optimize the first copy loop based on this new requirement.

I also tried instead making a separate inlineable function for the copy
loop (similar to existing partialDecode flags, etc), but I think the
changes might be significant enough to warrent doubling the code, instead
pulling out common functionality to separate functions.

This is the basic transformation that will allow several following optimisations.
2019-02-08 13:57:19 -08:00
Dave Watson
4da336062e decompress_generic: Refactor variable length fields
Make a helper function to read variable lengths for literals and
match length.
2019-02-08 13:42:42 -08:00
Yann Collet
591b662124
Merge pull request #648 from aregm/fix-VS2017-solution
Build fixed by removing unavailable project
2019-02-07 10:38:09 -08:00
Areg Melik-Adamyan
71ec7fde1e Build fixed by removing unavailable project 2019-02-06 22:29:31 -06:00
Yann Collet
976cb5ca31
Merge pull request #646 from jbms/fix-clang-optimize-attribute-ppc64le
Eliminate optimize attribute warning with clang on PPC64LE
2019-02-04 14:50:28 -08:00
Jeremy Maitin-Shepard
26e7635a0e Eliminate optimize attribute warning with clang on PPC64LE 2019-02-04 12:22:56 -08:00
Yann Collet
c3f0753d30
Merge pull request #644 from lzutao/meson-msvc-export
meson: Add -DLZ4_DLL_EXPORT=1 to build dynamic lib on Windows
2019-01-23 09:03:13 -08:00
Lzu Tao
929dbbcddf meson: Add -DLZ4_DLL_EXPORT=1 to build dynamic lib on Windows
Thanks @nacho for pointing it out.
2019-01-23 15:40:26 +07:00
Yann Collet
6305e43dce
Merge pull request #638 from lzutao/travis
Travis: Clean up .travis.yml
2019-01-11 12:11:45 -08:00
Yann Collet
bc85de6ec9
Merge pull request #639 from lzutao/meson
meson: Small improvements
2019-01-11 12:11:35 -08:00
Yann Collet
94afb9a87b
Merge pull request #640 from tzakian/remove_io_globals
Remove a bunch of global variables that tracked settings for the IO module
2019-01-11 12:11:24 -08:00
Tim Zakian
c1610690b1 Add cast around malloc 2019-01-11 09:49:26 -08:00
Tim Zakian
416916146f Add constant pointer annotations 2019-01-10 20:40:00 -08:00
Tim Zakian
5822e667cc Remove a bunch of global variables that tracked settings for the IO module, and move them in to a struct 2019-01-10 15:27:47 -08:00
Lzu Tao
c99b64af86 travis: Prefer apt-get in install field than addons-apt-sources 2019-01-11 04:17:34 +07:00
Lzu Tao
7fe378fc70 travis: Prefer script field than Cmd env 2019-01-11 04:17:34 +07:00
Lzu Tao
d2288d2cc0 meson: Favor warning if cannot find version string 2019-01-11 02:34:16 +07:00
Lzu Tao
4765ad88bd meson: Use libray as required argument in pkgconfig 2019-01-11 02:33:27 +07:00
Lzu Tao
b3b22b9660 meson: Explicit use meson setup to setup a builddir 2019-01-11 02:32:39 +07:00