aboutsummaryrefslogtreecommitdiff
path: root/src/xz/hardware.h
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-05-22 11:29:50 +0300
committerLasse Collin <lasse.collin@tukaani.org>2009-05-22 11:29:50 +0300
commitb0063023f8adb06ea735ec4af5c6f5b7bdb8e84d (patch)
tree7a875e927ad12b63bba7e3f56d3240ab7e691734 /src/xz/hardware.h
parentSupport special value "max" where xz and xzdec accept an integer. (diff)
downloadxz-b0063023f8adb06ea735ec4af5c6f5b7bdb8e84d.tar.xz
Make the default memory usage limit 40 % of RAM for both
compressing and decompressing. This should be OK now that xz automatically scales down the compression settings if they would exceed the memory usage limit (earlier, the limit for compression was increased to 90 % because low limit broke scripts that used "xz -9" on systems with low RAM). Support spcifying the memory usage limit as a percentage of RAM (e.g. --memory=50%). Support --threads=0 to reset the thread limit to the default value (number of available CPU cores). Use UINT32_MAX instead of SIZE_MAX as the maximum in args.c. hardware.c was already expecting uint32_t value. Cleaned up the output of --help and --long-help.
Diffstat (limited to '')
-rw-r--r--src/xz/hardware.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/xz/hardware.h b/src/xz/hardware.h
index 136aab9e..b2cf34cb 100644
--- a/src/xz/hardware.h
+++ b/src/xz/hardware.h
@@ -27,9 +27,9 @@ extern uint32_t hardware_threadlimit_get(void);
/// decoding. Zero indicates resetting the limit back to defaults.
extern void hardware_memlimit_set(uint64_t memlimit);
-/// Get the memory usage limit for encoding. By default this is 90 % of RAM.
-extern uint64_t hardware_memlimit_encoder(void);
+/// Set custom memory usage limit as a percentage of installed RAM.
+/// The percentage must be in the range [1, 100].
+extern void hardware_memlimit_set_percentage(uint32_t percentage);
-
-/// Get the memory usage limit for decoding. By default this is 30 % of RAM.
-extern uint64_t hardware_memlimit_decoder(void);
+/// Get the current memory usage limit.
+extern uint64_t hardware_memlimit_get(void);