Rizin
unix-like reverse engineering framework and cli tools
|
Multithreading options. More...
#include <container.h>
Public Attributes | |
uint32_t | flags |
Flags. More... | |
uint32_t | threads |
Number of worker threads to use. More... | |
uint64_t | block_size |
Maximum uncompressed size of a Block. More... | |
uint32_t | timeout |
Timeout to allow lzma_code() to return early. More... | |
uint32_t | preset |
Compression preset (level and possible flags) More... | |
const lzma_filter * | filters |
Filter chain (alternative to a preset) More... | |
lzma_check | check |
Integrity check type. More... | |
lzma_reserved_enum | reserved_enum1 |
lzma_reserved_enum | reserved_enum2 |
lzma_reserved_enum | reserved_enum3 |
uint32_t | reserved_int1 |
uint32_t | reserved_int2 |
uint32_t | reserved_int3 |
uint32_t | reserved_int4 |
uint64_t | reserved_int5 |
uint64_t | reserved_int6 |
uint64_t | reserved_int7 |
uint64_t | reserved_int8 |
void * | reserved_ptr1 |
void * | reserved_ptr2 |
void * | reserved_ptr3 |
void * | reserved_ptr4 |
Multithreading options.
Definition at line 66 of file container.h.
uint64_t lzma_mt::block_size |
Maximum uncompressed size of a Block.
The encoder will start a new .xz Block every block_size bytes. Using LZMA_FULL_FLUSH or LZMA_FULL_BARRIER with lzma_code() the caller may tell liblzma to start a new Block earlier.
With LZMA2, a recommended block size is 2-4 times the LZMA2 dictionary size. With very small dictionaries, it is recommended to use at least 1 MiB block size for good compression ratio, even if this is more than four times the dictionary size. Note that these are only recommendations for typical use cases; feel free to use other values. Just keep in mind that using a block size less than the LZMA2 dictionary size is waste of RAM.
Set this to 0 to let liblzma choose the block size depending on the compression options. For LZMA2 it will be 3*dict_size or 1 MiB, whichever is more.
For each thread, about 3 * block_size bytes of memory will be allocated. This may change in later liblzma versions. If so, the memory usage will probably be reduced, not increased.
Definition at line 104 of file container.h.
Referenced by coder_init().
lzma_check lzma_mt::check |
Integrity check type.
See check.h for available checks. The xz command line tool defaults to LZMA_CHECK_CRC64, which is a good choice if you are unsure.
Definition at line 160 of file container.h.
Referenced by coder_init().
const lzma_filter* lzma_mt::filters |
Filter chain (alternative to a preset)
If this is NULL, the preset above is used. Otherwise the preset is ignored and the filter chain specified here is used.
Definition at line 151 of file container.h.
uint32_t lzma_mt::flags |
Flags.
Set this to zero if no flags are wanted.
No flags are currently supported.
Definition at line 74 of file container.h.
Referenced by cmd_descs_generate.Arg::__str__(), and init_encoder().
uint32_t lzma_mt::preset |
Compression preset (level and possible flags)
The preset is set just like with lzma_easy_encoder(). The preset is ignored if filters below is non-NULL.
Definition at line 143 of file container.h.
lzma_reserved_enum lzma_mt::reserved_enum1 |
Definition at line 169 of file container.h.
lzma_reserved_enum lzma_mt::reserved_enum2 |
Definition at line 170 of file container.h.
lzma_reserved_enum lzma_mt::reserved_enum3 |
Definition at line 171 of file container.h.
uint32_t lzma_mt::reserved_int1 |
Definition at line 172 of file container.h.
uint32_t lzma_mt::reserved_int2 |
Definition at line 173 of file container.h.
uint32_t lzma_mt::reserved_int3 |
Definition at line 174 of file container.h.
uint32_t lzma_mt::reserved_int4 |
Definition at line 175 of file container.h.
uint64_t lzma_mt::reserved_int5 |
Definition at line 176 of file container.h.
uint64_t lzma_mt::reserved_int6 |
Definition at line 177 of file container.h.
uint64_t lzma_mt::reserved_int7 |
Definition at line 178 of file container.h.
uint64_t lzma_mt::reserved_int8 |
Definition at line 179 of file container.h.
void* lzma_mt::reserved_ptr1 |
Definition at line 180 of file container.h.
void* lzma_mt::reserved_ptr2 |
Definition at line 181 of file container.h.
void* lzma_mt::reserved_ptr3 |
Definition at line 182 of file container.h.
void* lzma_mt::reserved_ptr4 |
Definition at line 183 of file container.h.
uint32_t lzma_mt::threads |
Number of worker threads to use.
Definition at line 79 of file container.h.
Referenced by coder_init(), and init_encoder().
uint32_t lzma_mt::timeout |
Timeout to allow lzma_code() to return early.
Multithreading can make liblzma to consume input and produce output in a very bursty way: it may first read a lot of input to fill internal buffers, then no input or output occurs for a while.
In single-threaded mode, lzma_code() won't return until it has either consumed all the input or filled the output buffer. If this is done in multithreaded mode, it may cause a call lzma_code() to take even tens of seconds, which isn't acceptable in all applications.
To avoid very long blocking times in lzma_code(), a timeout (in milliseconds) may be set here. If lzma_code() would block longer than this number of milliseconds, it will return with LZMA_OK. Reasonable values are 100 ms or more. The xz command line tool uses 300 ms.
If long blocking times are fine for you, set timeout to a special value of 0, which will disable the timeout mechanism and will make lzma_code() block until all the input is consumed or the output buffer has been filled.
Definition at line 135 of file container.h.