One last check on limit.

This commit is contained in:
Con Kolivas 2011-03-21 07:33:35 +11:00
parent 738cde54ed
commit fd9bbfe64a

View file

@ -989,6 +989,7 @@ void *open_stream_out(rzip_control *control, int f, unsigned int n, i64 chunk_li
limit = (control->maxram - (control->overhead * control->threads)) / testbufs; limit = (control->maxram - (control->overhead * control->threads)) / testbufs;
limit = MIN(limit, chunk_limit); limit = MIN(limit, chunk_limit);
} }
limit = MAX(limit, STREAM_BUFSIZE);
retest_malloc: retest_malloc:
testsize = (limit * testbufs) + (control->overhead * control->threads); testsize = (limit * testbufs) + (control->overhead * control->threads);
testmalloc = malloc(testsize); testmalloc = malloc(testsize);