]> wimlib.net Git - wimlib/blobdiff - src/compress_parallel.c
Add wimlib_get_compressor_needed_memory()
[wimlib] / src / compress_parallel.c
index 6cd306c2fcb96d5aa6d8b7e64c08c27022c3ff12..376e59d6a2fdca8a05fae9486d58fc0f51bba08d 100644 (file)
@@ -438,8 +438,11 @@ new_parallel_chunk_compressor(int out_ctype, u32 out_chunk_size,
                        (u64)msgs_per_thread *
                        (u64)num_threads *
                        (u64)out_chunk_size
+                       + out_chunk_size
                        + 1000000
-                       + (out_chunk_size * num_threads * 4);
+                       + num_threads * wimlib_get_compressor_needed_memory(out_ctype,
+                                                                           out_chunk_size,
+                                                                           NULL);
                if (approx_mem_required <= max_memory)
                        break;