mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-01-20 15:20:15 +01:00
Put a lower bound on the amount of memory available during malloc testing and shrinking the window.
This commit is contained in:
parent
a0bacc90ee
commit
dd58a58692
8
stream.c
8
stream.c
|
|
@ -985,6 +985,14 @@ retest_malloc:
|
|||
testmalloc = malloc(testsize);
|
||||
if (!testmalloc) {
|
||||
limit = limit / 10 * 9;
|
||||
if (limit < 100000000) {
|
||||
/* If we can't even allocate 100MB then we'll never
|
||||
* succeed */
|
||||
print_err("Unable to allocate enough memory for operation\n");
|
||||
dealloc(sinfo->s);
|
||||
dealloc(sinfo);
|
||||
return NULL;
|
||||
}
|
||||
goto retest_malloc;
|
||||
}
|
||||
if (!NO_COMPRESS) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue