#include "private.h"
#include "tuklib_cpucores.h"
Functions | |
void | hardware_threadlimit_set (uint32_t new_threadlimit) |
Set custom value for maximum number of coder threads. | |
uint32_t | hardware_threadlimit_get (void) |
void | hardware_memlimit_set (uint64_t new_memlimit) |
void | hardware_memlimit_set_percentage (uint32_t percentage) |
uint64_t | hardware_memlimit_get (void) |
Get the current memory usage limit. | |
void | hardware_init (void) |
Variables | |
static uint32_t | threadlimit |
static uint64_t | memlimit |
Memory usage limit. |
void hardware_threadlimit_set | ( | uint32_t | new_threadlimit | ) |
Set custom value for maximum number of coder threads.
References threadlimit.
Referenced by hardware_init().
uint32_t hardware_threadlimit_get | ( | void | ) |
Get the maximum number of coder threads. Some additional helper threads are allowed on top of this).
References threadlimit.
Referenced by message_help().
void hardware_memlimit_set | ( | uint64_t | memlimit | ) |
Set custom memory usage limit. This is used for both encoding and decoding. Zero indicates resetting the limit back to defaults.
References hardware_memlimit_set_percentage(), and memlimit.
Referenced by hardware_init().
void hardware_memlimit_set_percentage | ( | uint32_t | percentage | ) |
Set custom memory usage limit as a percentage of installed RAM. The percentage must be in the range [1, 100].
References lzma_physmem(), and memlimit.
Referenced by hardware_memlimit_set().
uint64_t hardware_memlimit_get | ( | void | ) |
Get the current memory usage limit.
References memlimit.
Referenced by coder_init(), message_help(), message_mem_needed(), message_memlimit(), and parse_indexes().
void hardware_init | ( | void | ) |
Initialize some hardware-specific variables, which are needed by other hardware_* functions.
References hardware_memlimit_set(), and hardware_threadlimit_set().
uint32_t threadlimit [static] |
Maximum number of free *coder* threads. This can be set with the --threads=NUM command line option.
Referenced by hardware_threadlimit_get(), and hardware_threadlimit_set().
uint64_t memlimit [static] |
Memory usage limit.
Referenced by hardware_memlimit_get(), hardware_memlimit_set(), hardware_memlimit_set_percentage(), memlimit_set(), memlimit_set_percentage(), message_mem_needed(), and parse_indexes().