]> icculus.org git repositories - icculus/xz.git/blob - src/xz/hardware.h
Various code cleanups the the xz command line tool.
[icculus/xz.git] / src / xz / hardware.h
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file       hardware.h
4 /// \brief      Detection of available hardware resources
5 //
6 //  Copyright (C) 2007 Lasse Collin
7 //
8 //  This program is free software; you can redistribute it and/or
9 //  modify it under the terms of the GNU Lesser General Public
10 //  License as published by the Free Software Foundation; either
11 //  version 2.1 of the License, or (at your option) any later version.
12 //
13 //  This program is distributed in the hope that it will be useful,
14 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 //  Lesser General Public License for more details.
17 //
18 ///////////////////////////////////////////////////////////////////////////////
19
20 extern size_t opt_threads;
21
22
23 /// Initialize some hardware-specific variables, which are needed by other
24 /// hardware_* functions.
25 extern void hardware_init(void);
26
27
28 /// Set custom memory usage limit. This is used for both encoding and
29 /// decoding. Zero indicates resetting the limit back to defaults.
30 extern void hardware_memlimit_set(uint64_t memlimit);
31
32 /// Get the memory usage limit for encoding. By default this is 90 % of RAM.
33 extern uint64_t hardware_memlimit_encoder(void);
34
35
36 /// Get the memory usage limit for decoding. By default this is 30 % of RAM.
37 extern uint64_t hardware_memlimit_decoder(void);