Commit Graph

1037 Commits

Author SHA1 Message Date
Takayuki Matsuoka
ae179a9c16 Add note about RC_INVOKED 2022-08-13 05:39:25 +09:00
Takayuki Matsuoka
af0d7c0cb8 Suppress warning from rc.exe
Since rc.exe (the resource compiler) is legacy compiler,  it truncates preprocessor symbol name length to 32 chars.
And it reports the following warning

lz4\build\VS2022\..\..\lib\lz4.h(314): warning RC4011: identifier truncated to 'LZ4_STATIC_LINKING_ONLY_DISABLE'
lz4\build\VS2022\..\..\lib\lz4.h(401): warning RC4011: identifier truncated to 'LZ4_STATIC_LINKING_ONLY_DISABLE'

This patch detects rc.exe and just skips long symbol.
2022-08-12 23:59:34 +09:00
Takayuki Matsuoka
0fc36f1bc7 Suppress false positive warning from MSVC
MSVC (17.3 or earlier) reports the following warning

lz4\lib\lz4.c(527): warning C6385: Reading invalid data from 'v'.
Line 527 is : LZ4_memcpy(&v[4], v, 4);

But, obviously v[0..3] is always filled with meaningful value.
Therefore, this warning report is wrong.

We must revisit this issue with future version of MSVC.
2022-08-12 23:49:22 +09:00
Yann Collet
ec487d3265 faster CLI decompression speed for frames with -BD4 setting
lz4frame favors the faster prefix mode
when decompressing a frame with linked blocks.

This significantly improved CLI decompression on files compressed with -BD4 setting.
On my laptop, decompressing `enwik9` went from 0.89s to 0.52s.

This improvement is only for linked blocks.
It's more visible for small block sizes.
2022-08-11 17:48:35 -07:00
Yann Collet
18b293d9fd updated documentation in anticipation for v1.9.4 release 2022-08-11 14:06:30 -07:00
Takayuki Matsuoka
b41ee9935d Add short description of LZ4_FREESTANDING and _DISABLE_MEMORY_ALLOCATION 2022-08-11 16:13:56 +09:00
Takayuki Matsuoka
67c321935b Fix document for LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION in lz4.c 2022-08-11 16:13:24 +09:00
Yann Collet
dee9f95fd9
Merge pull request #1129 from t-mat/disable-memory-alloc-add-doc
Add document for LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION
2022-08-10 10:59:36 -07:00
Takayuki Matsuoka
d0928a7f20 Add short document of LZ4_FREESTANDING to lz4.h 2022-08-11 01:09:53 +09:00
Takayuki Matsuoka
50915609a9 Fix: Disable LZ4HC correspond functions when LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION is enabled 2022-08-07 19:07:41 +09:00
Takayuki Matsuoka
721e76d1af Add LZ4_FREESTANDING 2022-08-07 19:06:37 +09:00
Takayuki Matsuoka
e1276aebe2 Fix: Disable prototypes in header file 2022-08-06 19:46:01 +09:00
Takayuki Matsuoka
d9e0741aee Add: Doxygen comment for LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION 2022-08-06 19:45:13 +09:00
Yann Collet
ca26930a91
Merge pull request #1124 from t-mat/compile-time-purge-memalloc-func
Introduce LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION
2022-08-05 21:36:57 +02:00
Yann Collet
ccd92cb43b simplify read_variable_length()
single sumtype return value
2022-08-03 02:57:26 +02:00
Yann Collet
63e9a62249 refactor read_variable_length()
updated documentation, more assert(),
overflow detection in 32-bit mode
2022-08-02 15:56:05 +02:00
Yann Collet
7d7cddfac1 remove support of decompress_fast*() from decompress_generic()
since it's now supported by decompress_unsafe().

The goal is to improve maintenability of decompress_generic()
by reducing its complexity.
2022-08-02 14:40:24 +02:00
Yann Collet
efd123e1f1 introduce LZ4_decompress_unsafe_generic()
designed to support specifically LZ4_decompress_fast*() variants.

The end goal is to offload this support from LZ4_decompress_generic
to improve its maintenance.
2022-08-02 12:53:22 +02:00
Takayuki Matsuoka
9173ca37d7 Fix : Internal memory allocation macro names 2022-08-01 06:12:45 +09:00
Dominique Pelle
3347485307 fix: various typos 2022-07-31 17:47:00 +02:00
Takayuki Matsuoka
fa889cf6da Introduce LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION
This changeset introduces new compile time switch macro LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION
which removes the following functions when it's defined.

```
// lz4.c
LZ4_createStream
LZ4_freeStream
LZ4_createStreamDecode
LZ4_freeStreamDecode
LZ4_create              // legacy

// lz4hc.c
LZ4_createStreamHC(void)
LZ4_freeStreamHC
LZ4_createHC            // legacy
LZ4_freeHC              // legacy
```

These functions uses dynamic memory allocation functions such as malloc() and free().
It'll be useful for freestanding environment which doesn't have these allocation functions.

Since this change breaks API, this macro is only valid with lz4 as a static linked object.
2022-07-31 21:10:55 +09:00
Takayuki Matsuoka
5d80375ded New macro for memcpy, memmove and memset
This changeset introduces the following external macros.

- Add new macro LZ4_memset() which enables to inject external function as memset().
- Similar macro LZ4_memmove() for memmove().
- In same manner, LZ4_memcpy() also can be overriden by external macro.
2022-07-31 20:59:09 +09:00
Yann Collet
f01b7b5209 can select validation of CRC during benchmark
on command line, using existing long command --no-frame-crc.
Note : it's effectively more than that, since _all_ checksums are disabled.
2022-07-29 22:13:38 +02:00
Yann Collet
e8f0baa3f9 added ability to skip checksum calculation when decoding LZ4 Frames 2022-07-29 21:47:34 +02:00
Yann Collet
4f4d09a0d1 implement decoder-only benchmark mode
requires an LZ4 Frame as input
2022-07-29 19:22:59 +02:00
Yann Collet
cd96e3e7a5 minor refactor
to prepare bench.c for multiple decoding functions.
2022-07-29 15:24:50 +02:00
Yann Collet
ca6e522bff
Merge pull request #1115 from lz4/lz4f_customMem
Support for Custom Memory managers
2022-07-15 18:18:17 -07:00
Yann Collet
6784e78e00 support skippable frames within pipe
fix #977

fseek() doesn't work for pipe,
switch to "read and forget" mode in such case.
2022-07-15 19:30:53 +02:00
Yann Collet
e535d6424a implemented LZ4F_createCDict_advanced() 2022-07-14 01:36:18 +02:00
Yann Collet
a3c4f0d0a3 implemented LZ4F_createDecompressionContext_advanced() 2022-07-13 21:39:59 +02:00
Yann Collet
c76c9c53ac Merge branch 'dev' into lz4f_customMem 2022-07-13 20:43:37 +02:00
Yann Collet
270529e80e implemented first custom memory manager interface
for compression context only for the time being,
using LZ4F_createCompressionContext_advanced().

Added basic test in frametest.c
2022-07-13 20:23:13 +02:00
Yann Collet
832b444266 fix stricter enum type requirements for C++ 2022-07-13 16:18:22 +02:00
Yann Collet
7deae4bd22 minor : proper interface for LZ4F_getBlockSize()
and proper documentation.
Also : updated manual
2022-07-13 15:55:56 +02:00
Yann Collet
db836b5519 declare experimental prototype for LZ4F custom Memory manager 2022-07-13 15:41:11 +02:00
Yann Collet
47681c72ff removed ->dictBase from lz4hc state
replaced by ->dictStart
2022-07-13 13:09:05 +02:00
Yann Collet
20d4ff5361 removed ->base from lz4hc state
replaced by ->prefixStart
2022-07-13 11:48:31 +02:00
Yann Collet
3da483c0e6 Re-organize state's internal to be more compact
produces less padding, notably on OS400
following #1070 by @jonrumsey
2022-07-13 09:57:42 +02:00
Yann Collet
60f8eb6f4c minor : specify min versions for library version identifiers 2022-07-12 22:33:08 +02:00
Yann Collet
d174f975d2 clarify static sizes of states for static allocation 2022-07-12 21:28:12 +02:00
Yann Collet
510dc63706
Merge pull request #1104 from jonrumsey/os400-build-fix
Change definitions of LZ4_xxxSIZE defines for OS400
2022-07-11 06:31:58 -07:00
Yann Collet
9de5b571d7 minor refactor : simplify LZ4F_makeBlock
one less argument
2022-07-11 03:46:15 -07:00
jonrumsey
b4f508608f Change definitions of LZ4_STREAMSIZE, LZ4_STREAMDECODESIZE and LZ4_STREAMHCSIZE to factor in OS400 pointer length and structure alignment rules
Update the length values on platforms where pointers are 16-bytes, factor in implicit compiler padding to ensure proper alignment of members and overall structure lengths
2022-07-11 11:28:32 +01:00
Yann Collet
4da5c4dd30
Merge pull request #1094 from alexmohr/add-uncompressed-api
frame-api: add function to insert uncomressed data
2022-07-05 15:07:36 -07:00
Alexander Mohr
0ac3c74de1
review: fix findings
* replace assert with test for LZ4F_uncompressedUpdate
* update documentation to incldue correct docstring
* remove unecessary entry point
* remove compress_linked_block_mode from fuzzing test

Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
2022-07-05 21:14:34 +02:00
Alexander Mohr
42eb47d42f
uncompressed-api: allow uncompressed_update only for independent blocks
Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
2022-07-05 11:56:23 +02:00
Yann Collet
0af5edc873 updated dll README 2022-07-04 15:58:47 -07:00
Yann Collet
6fb713358b silence a useless MSVC warning 2022-07-04 14:29:35 -07:00
Alexander Mohr
e595150baf
lz4frame: correct start and size after flush
when the block mode changes a flush is executed, to prevent
mixing compressed and uncompressed data.
Prior to this commit dstStart, dstPtr, dstCapacity
where not updated to include the offset from bytesWritten.
For inputs > blockSize this meant the flushed data was
overwritten.

Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
2022-07-04 08:51:37 +02:00
Alexander Mohr
af447b22c8 meson: fix meson build
add static dependency to examples
2022-06-12 00:41:55 +02:00