set block size to 0 to let the lzma lib choose the right one, add
some comments about possible improvements wrt memory usage/threading.
This commit is contained in:
		
							parent
							
								
									bc7e3a4dd6
								
							
						
					
					
						commit
						9d1e22f743
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		|  | @ -193,9 +193,14 @@ struct XzSink : CompressionSink | ||||||
|     { |     { | ||||||
|         lzma_mt mt_options = {}; |         lzma_mt mt_options = {}; | ||||||
|         mt_options.flags = 0; |         mt_options.flags = 0; | ||||||
|         mt_options.timeout = 300; |         mt_options.timeout = 300; // Using the same setting as the xz cmd line
 | ||||||
|         mt_options.check = LZMA_CHECK_CRC64; |         mt_options.check = LZMA_CHECK_CRC64; | ||||||
|         mt_options.threads = lzma_cputhreads(); |         mt_options.threads = lzma_cputhreads(); | ||||||
|  |         mt_options.block_size = 0; | ||||||
|  |         if (mt_options.threads == 0) | ||||||
|  |             mt_options.threads = 1; | ||||||
|  |         // FIXME: maybe use lzma_stream_encoder_mt_memusage() to control the
 | ||||||
|  |         // number of threads.
 | ||||||
|         lzma_ret ret = lzma_stream_encoder_mt( |         lzma_ret ret = lzma_stream_encoder_mt( | ||||||
|             &strm, &mt_options); |             &strm, &mt_options); | ||||||
|         if (ret != LZMA_OK) |         if (ret != LZMA_OK) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue