~mmach/netext73/lz4

« back to all changes in this revision

Viewing changes to lib/README.md

  • Committer: mmach
  • Date: 2020-11-29 19:46:48 UTC
  • Revision ID: netbit73@gmail.com-20201129194648-8g87ivgzol71gnma
1.9.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
Definitions which are not guaranteed to remain stable in future versions,
37
37
are protected behind macros, such as `LZ4_STATIC_LINKING_ONLY`.
38
 
As the name implies, these definitions can only be invoked
 
38
As the name strongly implies, these definitions should only be invoked
39
39
in the context of static linking ***only***.
40
40
Otherwise, dependent application may fail on API or ABI break in the future.
41
 
The associated symbols are also not present in dynamic library by default.
 
41
The associated symbols are also not exposed by the dynamic library by default.
42
42
Should they be nonetheless needed, it's possible to force their publication
43
 
by using build macro `LZ4_PUBLISH_STATIC_FUNCTIONS`.
 
43
by using build macros `LZ4_PUBLISH_STATIC_FUNCTIONS`
 
44
and `LZ4F_PUBLISH_STATIC_FUNCTIONS`.
44
45
 
45
46
 
46
47
#### Build macros
47
48
 
48
 
The following build macro can be selected at compilation time :
 
49
The following build macro can be selected to adjust source code behavior at compilation time :
49
50
 
50
 
- `LZ4_FAST_DEC_LOOP` : this triggers the optimized decompression loop.
51
 
  This loops works great on x86/x64 cpus, and is automatically enabled on this platform.
52
 
  It's possible to enable or disable it manually, by passing `LZ4_FAST_DEC_LOOP=1` or `0` to the preprocessor.
 
51
- `LZ4_FAST_DEC_LOOP` : this triggers a speed optimized decompression loop, more powerful on modern cpus.
 
52
  This loop works great on `x86`, `x64` and `aarch64` cpus, and is automatically enabled for them.
 
53
  It's also possible to enable or disable it manually, by passing `LZ4_FAST_DEC_LOOP=1` or `0` to the preprocessor.
53
54
  For example, with `gcc` : `-DLZ4_FAST_DEC_LOOP=1`,
54
55
  and with `make` : `CPPFLAGS+=-DLZ4_FAST_DEC_LOOP=1 make lz4`.
55
56
 
65
66
  Should this be a problem, it's generally possible to make the compiler ignore these warnings,
66
67
  for example with `-Wno-deprecated-declarations` on `gcc`,
67
68
  or `_CRT_SECURE_NO_WARNINGS` for Visual Studio.
68
 
  Another method is to define `LZ4_DISABLE_DEPRECATE_WARNINGS`
69
 
  before including the LZ4 header files.
 
69
  This build macro offers another project-specific method
 
70
  by defining `LZ4_DISABLE_DEPRECATE_WARNINGS` before including the LZ4 header files.
 
71
 
 
72
- `LZ4_USER_MEMORY_FUNCTIONS` : replace calls to <stdlib>'s `malloc`, `calloc` and `free`
 
73
  by user-defined functions, which must be called `LZ4_malloc()`, `LZ4_calloc()` and `LZ4_free()`.
 
74
  User functions must be available at link time.
 
75
 
 
76
- `LZ4_FORCE_SW_BITCOUNT` : by default, the compression algorithm tries to determine lengths
 
77
  by using bitcount instructions, generally implemented as fast single instructions in many cpus.
 
78
  In case the target cpus doesn't support it, or compiler intrinsic doesn't work, or feature bad performance,
 
79
  it's possible to use an optimized software path instead.
 
80
  This is achieved by setting this build macros .
 
81
  In most cases, it's not expected to be necessary,
 
82
  but it can be legitimately considered for less common platforms.
 
83
 
 
84
- `LZ4_ALIGN_TEST` : alignment test ensures that the memory area
 
85
  passed as argument to become a compression state is suitably aligned.
 
86
  This test can be disabled if it proves flaky, by setting this value to 0.
70
87
 
71
88
 
72
89
#### Amalgamation
102
119
 
103
120
#### Miscellaneous
104
121
 
105
 
Other files present in the directory are not source code. There are :
 
122
Other files present in the directory are not source code. They are :
106
123
 
107
124
 - `LICENSE` : contains the BSD license text
108
125
 - `Makefile` : `make` script to compile and install lz4 library (static and dynamic)