|
4 | 4 | config ZEPHYR_LZ4_MODULE
|
5 | 5 | bool
|
6 | 6 |
|
7 |
| -config LZ4 |
| 7 | +menuconfig LZ4 |
8 | 8 | bool "Lz4 data compression and decompression"
|
9 | 9 | help
|
10 | 10 | This option enables lz4 compression & decompression library
|
11 | 11 | support.
|
| 12 | +if LZ4 |
| 13 | + |
| 14 | +config LZ4_MEMORY_USAGE |
| 15 | + int "Lz4 memory usage" |
| 16 | + range 10 20 |
| 17 | + default 14 |
| 18 | + help |
| 19 | + Increasing memory usage improves compression ratio, but usually at the |
| 20 | + cost of speed, due to cache locality. Memory usage 2^value (10 -> 1KB, |
| 21 | + 12 -> 4KB, 20 -> 1MB). |
| 22 | + |
| 23 | +config LZ4_DISABLE_DYNAMIC_MEMORY_ALLOCATION |
| 24 | + bool "Disable dynamic memory allocation" |
| 25 | + help |
| 26 | + Disable lz4 functions that use dynamic memory allocation functions. |
| 27 | + |
| 28 | +choice LZ4_HEAPMODE |
| 29 | + prompt "How stateless compression functions allocate memory for their hash table" |
| 30 | + default LZ4_HEAPMODE_HEAP |
| 31 | + |
| 32 | +config LZ4_HEAPMODE_STACK |
| 33 | + bool "in memory stack" |
| 34 | + help |
| 35 | + Allocate memory from stack (fastest). |
| 36 | + |
| 37 | +config LZ4_HEAPMODE_HEAP |
| 38 | + bool "in memory heap" |
| 39 | + depends on !LZ4_DISABLE_DYNAMIC_MEMORY_ALLOCATION |
| 40 | + help |
| 41 | + Allocate memory from heap (requires malloc()). |
| 42 | +endchoice |
| 43 | + |
| 44 | +config LZ4_HIGH_COMPRESSION_VARIANT |
| 45 | + bool "Lz4 high compression variant" |
| 46 | + help |
| 47 | + For more compression ratio at the cost of compression speed, |
| 48 | + the High Compression variant called lz4hc is available. This variant |
| 49 | + also compresses data using the lz4 block format. |
| 50 | + |
| 51 | +if LZ4_HIGH_COMPRESSION_VARIANT |
| 52 | +choice LZ4HC_HEAPMODE |
| 53 | + prompt "How stateless HC compression functions allocate memory for their workspace" |
| 54 | + default LZ4HC_HEAPMODE_HEAP |
| 55 | + |
| 56 | +config LZ4HC_HEAPMODE_STACK |
| 57 | + bool "in memory stack" |
| 58 | + help |
| 59 | + Allocate memory from stack (fastest). |
| 60 | + |
| 61 | +config LZ4HC_HEAPMODE_HEAP |
| 62 | + bool "in memory heap" |
| 63 | + depends on !LZ4_DISABLE_DYNAMIC_MEMORY_ALLOCATION |
| 64 | + help |
| 65 | + Allocate memory from heap (requires malloc()). |
| 66 | +endchoice |
| 67 | +endif |
| 68 | + |
| 69 | +config LZ4_XX_HASH |
| 70 | + bool "xxHash hashing algorithm" |
| 71 | + help |
| 72 | + Build xxHash library included in lz4 sources. |
| 73 | + |
| 74 | +config LZ4_FRAME_SUPPORT |
| 75 | + bool "LZ4 frame support" |
| 76 | + select LZ4_XX_HASH |
| 77 | + select LZ4_HIGH_COMPRESSION_VARIANT |
| 78 | + help |
| 79 | + In order to produce compressed data compatible with lz4 command line |
| 80 | + utility, it's necessary to use the official interoperable frame format. |
| 81 | + This format is generated and decoded automatically by the lz4frame library. |
| 82 | + Its public API is described in lib/lz4frame.h. |
| 83 | + |
| 84 | +if LZ4_FRAME_SUPPORT |
| 85 | +choice LZ4F_HEAPMODE |
| 86 | + prompt "Control how LZ4F_compressFrame() allocates the Compression State" |
| 87 | + default LZ4F_HEAPMODE_STACK |
| 88 | + |
| 89 | +config LZ4F_HEAPMODE_STACK |
| 90 | + bool "in memory stack" |
| 91 | + help |
| 92 | + Allocate memory from stack (fastest). |
| 93 | + |
| 94 | +config LZ4F_HEAPMODE_HEAP |
| 95 | + bool "in memory heap" |
| 96 | + depends on !LZ4_DISABLE_DYNAMIC_MEMORY_ALLOCATION |
| 97 | + help |
| 98 | + Allocate memory from heap (requires malloc()). |
| 99 | +endchoice |
| 100 | +endif |
| 101 | + |
| 102 | +endif |
0 commit comments