]> icculus.org git repositories - icculus/xz.git/blob - src/lzma/hardware.h
Oh well, big messy commit again. Some highlights:
[icculus/xz.git] / src / lzma / hardware.h
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file       hardware.c
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 #ifndef HARDWARE_H
21 #define HARDWARE_H
22
23 #include "private.h"
24
25
26 extern size_t opt_threads;
27
28
29 /// Initialize some hardware-specific variables, which are needed by other
30 /// hardware_* functions.
31 extern void hardware_init(void);
32
33
34 /// Set custom memory usage limit. This is used for both encoding and
35 /// decoding. Zero indicates resetting the limit back to defaults.
36 extern void hardware_memlimit_set(uint64_t memlimit);
37
38 /// Get the memory usage limit for encoding. By default this is 90 % of RAM.
39 extern uint64_t hardware_memlimit_encoder(void);
40
41
42 /// Get the memory usage limit for decoding. By default this is 30 % of RAM.
43 extern uint64_t hardware_memlimit_decoder(void);
44
45 #endif