src/xz/hardware.c File Reference

Detection of available hardware resources. More...

#include "private.h"
#include "physmem.h"

Functions

static void hardware_cores (void)
static void hardware_memlimit_init (void)
void hardware_memlimit_set (uint64_t memlimit)
uint64_t hardware_memlimit_encoder (void)
 Get the memory usage limit for encoding. By default this is 90 % of RAM.
uint64_t hardware_memlimit_decoder (void)
 Get the memory usage limit for decoding. By default this is 30 % of RAM.
void hardware_init (void)

Variables

size_t opt_threads = 1
static uint64_t memlimit_encoder
 Memory usage limit for encoding.
static uint64_t memlimit_decoder
 Memory usage limit for decoding.
static uint64_t memlimit_custom = 0


Detailed Description

Detection of available hardware resources.


Function Documentation

static void hardware_cores ( void   )  [static]

Get the number of CPU cores, and set opt_threads to default to that value. User can then override this with --threads command line option.

References opt_threads.

Referenced by hardware_init().

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_custom.

uint64_t hardware_memlimit_encoder ( void   ) 

Get the memory usage limit for encoding. By default this is 90 % of RAM.

References memlimit_custom, and memlimit_encoder.

Referenced by message_help().

uint64_t hardware_memlimit_decoder ( void   ) 

Get the memory usage limit for decoding. By default this is 30 % of RAM.

References memlimit_custom, and memlimit_decoder.

Referenced by message_help().

void hardware_init ( void   ) 

Initialize some hardware-specific variables, which are needed by other hardware_* functions.

References hardware_cores().


Variable Documentation

size_t opt_threads = 1

Maximum number of free *coder* threads. This can be set with the --threads=NUM command line option.

Referenced by hardware_cores(), and message_help().

uint64_t memlimit_encoder [static]

Memory usage limit for encoding.

Referenced by hardware_memlimit_encoder().

uint64_t memlimit_decoder [static]

Memory usage limit for decoding.

Referenced by hardware_memlimit_decoder().

uint64_t memlimit_custom = 0 [static]

Memory usage limit given on the command line or environment variable. Zero indicates the default (memlimit_encoder or memlimit_decoder).

Referenced by hardware_memlimit_decoder(), hardware_memlimit_encoder(), and hardware_memlimit_set().


Generated on Wed May 25 10:35:47 2011 for XZ Utils by  doxygen 1.5.5