/build/buildd/xz-utils-4.999.9beta+20100527/src/xz/hardware.c File Reference

Detection of available hardware resources. More...

#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.
static uint64_t total_ram
 Total amount of physical RAM.

Detailed Description

Detection of available hardware resources.


Function Documentation

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 memlimit, and total_ram.

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 memlimit, and total_ram.

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(), hardware_threadlimit_set(), lzma_physmem(), and total_ram.


Variable Documentation

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]
uint64_t total_ram [static]

Total amount of physical RAM.

Referenced by hardware_init(), hardware_memlimit_set(), and hardware_memlimit_set_percentage().

Generated on Mon May 31 10:13:11 2010 for XZ Utils by  doxygen 1.6.3