]> git.ipfire.org Git - thirdparty/xz.git/commit
xz: Simplify the memory usage scaling code
authorLasse Collin <lasse.collin@tukaani.org>
Sun, 12 May 2024 19:26:30 +0000 (22:26 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Thu, 23 May 2024 08:28:20 +0000 (11:28 +0300)
commit58f200b6d1dc4cbc1ab3315a359120ab6eb84878
tree511ef53fe7f873731596f51e623268cb3c90a97e
parent41bdc9fa5cc2fc2a70f4331329ac724773cc2f26
xz: Simplify the memory usage scaling code

This is closer to what it was before the --filtersX support was added,
just extended to support for scaling all filter chains. The method
before this commit was an extended version of the original too but
it was done in a more complex way for no clear reason. In case of
an error, the complex version printed fewer informative messages
(a good thing) but it's not a sigificant benefit.

In the limit is too low even for single-threaded mode, the required
amount of memory is now reported like in 5.4.x instead of like in
5.5.1alpha - 5.6.1 which showed the original non-scaled usage. It
had been a FIXME in the old code but it's not clear what message
makes the most sense.

Fixes: 5f0c5a04388f8334962c70bc37a8c2ff8f605e0a
(cherry picked from commit d9e1ae79ec90d6a7eafeaceaf0ece4f0c83d4417)
src/xz/coder.c