Rizin
unix-like reverse engineering framework and cli tools
|
Detection of available hardware resources. More...
Go to the source code of this file.
Functions | |
void | hardware_init (void) |
void | hardware_threads_set (uint32_t threadlimit) |
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... | |
void | hardware_memlimit_show (void) lzma_attribute((__noreturn__)) |
Display the amount of RAM and memory usage limits and exit. More... | |
Detection of available hardware resources.
Definition in file hardware.h.
void hardware_init | ( | void | ) |
Initialize some hardware-specific variables, which are needed by other hardware_* functions.
Definition at line 169 of file hardware.c.
References ASSUME_RAM, hardware_memlimit_set(), and total_ram.
Referenced by main().
uint64_t hardware_memlimit_get | ( | enum operation_mode | mode | ) |
Get the current memory usage limit for compression or decompression.
Definition at line 112 of file hardware.c.
References memlimit, memlimit_compress, memlimit_decompress, MODE_COMPRESS, and UINT64_MAX.
Referenced by coder_init(), message_mem_needed(), and parse_indexes().
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].
Definition at line 62 of file hardware.c.
References assert(), memlimit_compress, memlimit_decompress, total_ram, UINT64_C, and UINT64_MAX.
Referenced by hardware_init(), and parse_memlimit().
void hardware_memlimit_show | ( | void | ) |
Display the amount of RAM and memory usage limits and exit.
Definition at line 148 of file hardware.c.
References _, E_ERROR, E_SUCCESS, memlimit_compress, memlimit_decompress, memlimit_show(), message_verbosity_get(), opt_robot, printf(), PRIu64, total_ram, tuklib_exit, and V_SILENT.
Referenced by parse_real().
uint32_t hardware_threads_get | ( | void | ) |
Get the maximum number of worker threads.
Definition at line 55 of file hardware.c.
References threads_max.
Referenced by coder_init(), coder_normal(), and split_block().
void hardware_threads_set | ( | uint32_t | threadlimit | ) |
Set the maximum number of worker threads.
Definition at line 31 of file hardware.c.
References n, and threads_max.
Referenced by coder_init(), and parse_real().