Skip to content

Commit 835fd30

Browse files
committed
Disable inappropriate warning on small file compression.
1 parent ed62b87 commit 835fd30

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

stream.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ void *open_stream_out(rzip_control *control, int f, unsigned int n, i64 chunk_li
940940
{
941941
struct stream_info *sinfo;
942942
unsigned int i, testbufs;
943-
bool threadlimit = false;
943+
bool threadlimit = false, memlimit = false;
944944
i64 testsize, limit;
945945
uchar *testmalloc;
946946

@@ -998,13 +998,15 @@ void *open_stream_out(rzip_control *control, int f, unsigned int n, i64 chunk_li
998998
/* Use a nominal minimum size should we fail all previous shrinking */
999999
if (limit < STREAM_BUFSIZE) {
10001000
limit = MAX(limit, STREAM_BUFSIZE);
1001-
print_output("Warning, low memory for chosen compression settings\n");
1001+
if (threadlimit || memlimit)
1002+
print_output("Warning, low memory for chosen compression settings\n");
10021003
}
10031004
limit = MIN(limit, chunk_limit);
10041005
retest_malloc:
10051006
testsize = limit + (control->overhead * control->threads);
10061007
testmalloc = malloc(testsize);
10071008
if (!testmalloc) {
1009+
memlimit = true;
10081010
limit = limit / 10 * 9;
10091011
if (limit < 100000000) {
10101012
/* If we can't even allocate 100MB then we'll never

0 commit comments

Comments
 (0)