From df8b4e6215c5f4fed546a39da7b6799c83fdc514 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 27 Jan 2014 00:36:27 -0600 Subject: [PATCH] Allow up to 1 GiB LZMS dictionary Seemingly not compatible with WIMGAPI, but it works with the format. --- doc/imagex-capture.1.in | 14 +++++++------- src/wim.c | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/imagex-capture.1.in b/doc/imagex-capture.1.in index eecfb987..d1b7f95d 100644 --- a/doc/imagex-capture.1.in +++ b/doc/imagex-capture.1.in @@ -225,7 +225,7 @@ decide to use this option regardless, you may choose a chunk size that is a power of 2 greater than or equal to 2^15 (32768) up to a maximum determined by the compression format. For LZX ("maximum") compression, the maximum allowed chunk size is 2^21 (2097152), and for XPRESS ("fast") and LZMS ("recovery") -compression, the maximum allowed chunk size is 2^26 (67108864). +compression, the maximum allowed chunk size is 2^30 (1073741824). .IP "" For XPRESS and LZX compression, Microsoft's implementation (as of Windows 8) does not appear to support alternate chunk sizes; although it will still open @@ -254,12 +254,12 @@ option to change the compression type used in packed resources; however, the \fB--pack-chunk-size\fR=\fISIZE\fR, \fB--solid-chunk-size\fR=\fISIZE\fR Like \fB--chunk-size\fR, but set the chunk size used in packed resources. The compression format is LZMS, so the chunk size can be any power of 2 between 2^15 -and 2^26, inclusively. WIMGAPI (Windows 8) appears to be compatible with all -these sizes, despite not being compatible with sizes greater than 2^20 in -non-packed resources. The default is currently 2^25 (33554432). Note: -currently, the LZMS compression algorithm uses about 15 times the chunk size in -memory per thread, which is about 500 MB per thread for the default pack chunk -size of 2^25 or 1 GB per thread if you change it to 2^26 (67108864). +and 2^30, inclusively. WIMGAPI (Windows 8) appears to be compatible with these +sizes up to 2^26 inclusively, despite not being compatible with sizes greater +than 2^20 in non-packed resources. The default is currently 2^25 (33554432). +Note: currently, the LZMS compression algorithm uses about 15 times the chunk +size in memory per thread, which is about 500 MB per thread for the default pack +chunk size of 2^25 or 1 GB per thread if you change it to 2^26 (67108864). .TP \fB--threads\fR=\fINUM_THREADS\fR Number of threads to use for compressing data. Default: autodetect (number of diff --git a/src/wim.c b/src/wim.c index fc1cfef7..9daa8e3b 100644 --- a/src/wim.c +++ b/src/wim.c @@ -130,8 +130,9 @@ wim_chunk_size_valid(u32 chunk_size, int ctype) return order >= 15 && order <= 21; case WIMLIB_COMPRESSION_TYPE_XPRESS: - case WIMLIB_COMPRESSION_TYPE_LZMS: return order >= 15 && order <= 26; + case WIMLIB_COMPRESSION_TYPE_LZMS: + return order >= 15 && order <= 30; } return false; } -- 2.43.0