From 835fd30e35a2c0f6d78a59e6398809147b0d2ba8 Mon Sep 17 00:00:00 2001 From: ckolivas Date: Thu, 12 Feb 2026 19:48:12 +1100 Subject: [PATCH] Disable inappropriate warning on small file compression. --- stream.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stream.c b/stream.c index ec992a0..4fd73e2 100644 --- a/stream.c +++ b/stream.c @@ -940,7 +940,7 @@ void *open_stream_out(rzip_control *control, int f, unsigned int n, i64 chunk_li { struct stream_info *sinfo; unsigned int i, testbufs; - bool threadlimit = false; + bool threadlimit = false, memlimit = false; i64 testsize, limit; uchar *testmalloc; @@ -998,13 +998,15 @@ void *open_stream_out(rzip_control *control, int f, unsigned int n, i64 chunk_li /* Use a nominal minimum size should we fail all previous shrinking */ if (limit < STREAM_BUFSIZE) { limit = MAX(limit, STREAM_BUFSIZE); - print_output("Warning, low memory for chosen compression settings\n"); + if (threadlimit || memlimit) + print_output("Warning, low memory for chosen compression settings\n"); } limit = MIN(limit, chunk_limit); retest_malloc: testsize = limit + (control->overhead * control->threads); testmalloc = malloc(testsize); if (!testmalloc) { + memlimit = true; limit = limit / 10 * 9; if (limit < 100000000) { /* If we can't even allocate 100MB then we'll never