XZ Utils 5.2.8
|
Detection of available hardware resources. More...
#include "private.h"
Functions | |
void | hardware_threads_set (uint32_t n) |
Set the maximum number of worker threads. More... | |
uint32_t | hardware_threads_get (void) |
Get the maximum number of worker threads. More... | |
void | hardware_memlimit_set (uint64_t new_memlimit, bool set_compress, bool set_decompress, bool is_percentage) |
uint64_t | hardware_memlimit_get (enum operation_mode mode) |
Get the current memory usage limit for compression or decompression. More... | |
static void | memlimit_show (const char *str, uint64_t value) |
Helper for hardware_memlimit_show() to print one human-readable info line. More... | |
void | hardware_memlimit_show (void) |
Display the amount of RAM and memory usage limits and exit. More... | |
void | hardware_init (void) |
Variables | |
static uint32_t | threads_max = 1 |
static uint64_t | memlimit_compress |
Memory usage limit for compression. More... | |
static uint64_t | memlimit_decompress |
Memory usage limit for decompression. More... | |
static uint64_t | total_ram |
Total amount of physical RAM. More... | |
Detection of available hardware resources.
void hardware_threads_set | ( | uint32_t | n | ) |
Set the maximum number of worker threads.
References lzma_cputhreads(), and threads_max.
uint32_t hardware_threads_get | ( | void | ) |
Get the maximum number of worker threads.
References threads_max.
void hardware_memlimit_set | ( | uint64_t | new_memlimit, |
bool | set_compress, | ||
bool | set_decompress, | ||
bool | is_percentage | ||
) |
Set the memory usage limit. There are separate limits for compression and decompression (the latter includes also –list), one or both can be set with a single call to this function. Zero indicates resetting the limit back to the defaults. The limit can also be set as a percentage of installed RAM; the percentage must be in the range [1, 100].
Referenced by hardware_init().
uint64_t hardware_memlimit_get | ( | enum operation_mode | mode | ) |
Get the current memory usage limit for compression or decompression.
Referenced by message_mem_needed().
|
static |
Helper for hardware_memlimit_show() to print one human-readable info line.
void hardware_memlimit_show | ( | void | ) |
Display the amount of RAM and memory usage limits and exit.
void hardware_init | ( | void | ) |
Initialize some hardware-specific variables, which are needed by other hardware_* functions.
References hardware_memlimit_set(), lzma_physmem(), and total_ram.
|
static |
Maximum number of worker threads. This can be set with the –threads=NUM command line option.
Referenced by hardware_threads_get(), and hardware_threads_set().
|
static |
Memory usage limit for compression.
|
static |
Memory usage limit for decompression.
|
static |
Total amount of physical RAM.
Referenced by hardware_init().