summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1191 from vsolontsov-volant/install_lz4file_hYann Collet2022-11-241-0/+2
|\ | | | | Add copying lz4file.h to make install
| * Add copying lz4file.h to make installVladimir Solontsov2022-11-221-0/+2
| |
* | Fixed const-ness of src data pointer in lz4file and install lz4file.hVladimir Solontsov2022-11-222-3/+3
|/
* minor refactor of lz4.cYann Collet2022-10-011-19/+23
| | | | | | almost no change, functionally equivalent replaced one test by an assert() (since it should always be true)
* fix another ubsan warning in lz4hcmd_offYann Collet2022-10-011-1/+1
| | | | | | | because ubsan complains even about intermediate pointer arithmetic results (in a simple linear formula with 3 factors for example). use parenthesis to make sure calculations go directly from one valid memory address to another valid memory address value.
* use LZ4HC_match_t structure directly to store match candidatesYann Collet2022-10-011-68/+53
| | | | | this formalized better the coupling between match length and match offset which were 2 separated variables before.
* removed virtual pointer from optimal parserYann Collet2022-09-301-5/+4
| | | | | replaced by direct offset value. this virtual pointer was only used in rare _dstSize scenario.
* removed virtual match pointer from HC parserYann Collet2022-09-301-26/+23
| | | | replaced by direct offset values.
* sequence encoder accepts offset as a valueYann Collet2022-09-301-14/+15
| | | | instead of a virtual pointer
* LZ4 HC matchfinder returns an offset valueYann Collet2022-09-301-43/+58
| | | | instead of a virtual past pointer.
* added code documentation on heap modeYann Collet2022-09-274-15/+46
| | | | and also on decompress_continue variants.
* added notes about LZ4_compressFrame() and stack/heap memory usageYann Collet2022-09-202-4/+14
|
* fix rare ubYann Collet2022-09-171-6/+8
| | | | | apparently, accessing the short member of a union still requires enough space for its largest member.
* fixed minor UB warningYann Collet2022-09-161-12/+13
| | | | now, even intermediate ptr arithmetic results can be UB ??
* removed a few more usages of base ptrYann Collet2022-09-161-15/+20
| | | | | | | by making LZ4_putPosition() specific to byPtr strategy. byU32 and byU16 use LZ4_putIndexOnHash() instead. In both cases, it makes it irrelevant to pass` base as reference ptr.
* remove another usage of baseYann Collet2022-09-161-4/+6
| | | | | within `LZ4_loadDict()` function : it's possible to only employ Indexes directly.
* fix benchmark more using DictionaryYann Collet2022-09-152-9/+33
| | | | | | | benchmark dictionary mode, implemented in #808, is incorrect. It would desynchronize compression and decompression as soon as 2+ files are dictionary compressed. Also : slightly improved traces system, to also include __LINE__ number
* document Makefile variablesYann Collet2022-09-131-0/+7
|
* build: Support BUILD_SHARED=noFotis Xenakis2022-09-131-0/+4
| | | | | | Since e585a438c714652e866a59371b287f52aa4d2dc3, the BUILD_SHARED Makefile variable only takes effect for the install target (i.e. the shared libraries always built). This restores the original behaviour.
* Clarifiy documentation for LZ4F_HEAPMODEYann Collet2022-09-132-3/+5
| | | | | | Now it's only about LZ4F_compressFrame(), and it's only about the Compression Context (not the hash tables, which used to be integrated).
* simplify getPositionYann Collet2022-09-121-9/+7
| | | | | it's only used in byPtr mode. This removes the need to transfer `base` ptr value.
* fixed a few ubsan warnings in lz4hcYann Collet2022-09-091-18/+18
| | | | mostly related to pointer arithmetic involving NULL ptr.
* added LZ4F_compressUpdate() in fullbenchYann Collet2022-09-081-1/+1
|
* allocation optimization for lz4frame compressionYann Collet2022-09-081-7/+6
| | | | | | | | | | | | | | | | | | | | | | | as noted by @yixiutt, the temporary buffer inside lz4frame compression is being invalidated at end of compression, forcing it to be re-allocated at next compression job. This shouldn't be necessary. This change was introduced in #236, as a way to fix #232, but neither the issue is explained, nor why the patch fixes it. This patch revert to previous behavior, where temporary buffer is kept between compression calls. This results in a net reduction of allocation workload. Additionally, the temporary buffer should only need malloc(), not calloc(), thus saving initialization. This diff implements both changes. Long fuzzer tests will be run to ensure that no sanitizer warning get triggered. Additionally : fixed a minor ubsan warning in LZ4F_decompress().
* Add note about RC_INVOKEDTakayuki Matsuoka2022-08-121-0/+13
|
* Suppress warning from rc.exeTakayuki Matsuoka2022-08-121-0/+4
| | | | | | | | | | 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.
* Suppress false positive warning from MSVCTakayuki Matsuoka2022-08-121-0/+7
| | | | | | | | | | | | 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.
* faster CLI decompression speed for frames with -BD4 settingYann Collet2022-08-121-16/+22
| | | | | | | | | | | 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.
* updated documentation in anticipation for `v1.9.4` releaseYann Collet2022-08-111-13/+13
|
* Add short description of LZ4_FREESTANDING and _DISABLE_MEMORY_ALLOCATIONTakayuki Matsuoka2022-08-111-0/+12
|
* Fix document for LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION in lz4.cTakayuki Matsuoka2022-08-111-1/+6
|
* Merge pull request #1129 from t-mat/disable-memory-alloc-add-docYann Collet2022-08-102-0/+15
|\ | | | | Add document for LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION
| * Fix: Disable prototypes in header fileTakayuki Matsuoka2022-08-061-0/+4
| |
| * Add: Doxygen comment for LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATIONTakayuki Matsuoka2022-08-061-0/+11
| |
* | Add short document of LZ4_FREESTANDING to lz4.hTakayuki Matsuoka2022-08-101-4/+11
| |
* | Fix: Disable LZ4HC correspond functions when ↵Takayuki Matsuoka2022-08-072-1/+5
| | | | | | | | LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION is enabled
* | Add LZ4_FREESTANDINGTakayuki Matsuoka2022-08-072-1/+26
|/
* Merge pull request #1124 from t-mat/compile-time-purge-memalloc-funcYann Collet2022-08-052-1/+15
|\ | | | | Introduce LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION
| * Fix : Internal memory allocation macro namesTakayuki Matsuoka2022-07-311-6/+3
| |
| * Introduce LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATIONTakayuki Matsuoka2022-07-312-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | simplify read_variable_length()Yann Collet2022-08-031-26/+24
| | | | | | | | single sumtype return value
* | refactor read_variable_length()Yann Collet2022-08-021-19/+29
| | | | | | | | | | updated documentation, more assert(), overflow detection in 32-bit mode
* | remove support of decompress_fast*() from decompress_generic()Yann Collet2022-08-021-92/+43
| | | | | | | | | | | | | | since it's now supported by decompress_unsafe(). The goal is to improve maintenability of decompress_generic() by reducing its complexity.
* | introduce LZ4_decompress_unsafe_generic()Yann Collet2022-08-021-18/+158
| | | | | | | | | | | | | | designed to support specifically LZ4_decompress_fast*() variants. The end goal is to offload this support from LZ4_decompress_generic to improve its maintenance.
* | fix: various typosDominique Pelle2022-07-313-3/+3
| |
* | New macro for memcpy, memmove and memsetTakayuki Matsuoka2022-07-312-13/+26
|/ | | | | | | | 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.
* can select validation of CRC during benchmarkYann Collet2022-07-291-4/+4
| | | | | on command line, using existing long command --no-frame-crc. Note : it's effectively more than that, since _all_ checksums are disabled.
* added ability to skip checksum calculation when decoding LZ4 FramesYann Collet2022-07-292-11/+21
|
* implement decoder-only benchmark modeYann Collet2022-07-292-7/+7
| | | | requires an LZ4 Frame as input
* minor refactorYann Collet2022-07-292-37/+53
| | | | to prepare bench.c for multiple decoding functions.