ckolivas / lrzip

Long Range Zip
http://lrzip.kolivas.org
GNU General Public License v2.0
618 stars 76 forks source link

Remove IS_FROM_FILE #define. Speed up Decompression by removing if (S… #178

Closed pete4abw closed 3 years ago

pete4abw commented 3 years ago

…TDOUT) check. No memory leak. Reverts part of 1510f4a.

Discussion. The #define IS_FROM_FILE is always false. I removed all uses and replace with !STDIN which is what it is. In lrzip.c there was a line that prohibited the creation of a temporary output buffer. The reason it was inserted was a supposed memory leak. My testing found no such leak. See #77 comments. When output is smaller than available memory, the entire decompression is speeded up by a factor of at least 2. If the decompressed output is larger than available ram, a file buffer is used instead and the alloced memory is properly released.

Suggest taking a close look at this.

pete4abw commented 3 years ago

No action.