mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-04-04 13:57:40 +00:00
more initialization stuff out of main(), remove weird coincidentally successful one_g variable
This commit is contained in:
parent
cfd6915b20
commit
1c64dcfb31
6 changed files with 27 additions and 24 deletions
22
main.c
22
main.c
|
|
@ -629,27 +629,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
/* Use less ram when using STDOUT to store the temporary output
|
||||
* file. */
|
||||
if (STDOUT && ((STDIN && DECOMPRESS) || !(DECOMPRESS || TEST_ONLY)))
|
||||
control->maxram = control->ramsize * 2 / 9;
|
||||
else
|
||||
control->maxram = control->ramsize / 3;
|
||||
if (BITS32) {
|
||||
/* Decrease usable ram size on 32 bits due to kernel /
|
||||
* userspace split. Cannot allocate larger than a 1
|
||||
* gigabyte chunk due to 32 bit signed long being
|
||||
* used in alloc, and at most 3GB can be malloced, and
|
||||
* 2/3 of that makes for a total of 2GB to be split
|
||||
* into thirds.
|
||||
*/
|
||||
control->usable_ram = MAX(control->ramsize - 900000000ll, 900000000ll);
|
||||
control->maxram = MIN(control->maxram, control->usable_ram);
|
||||
control->maxram = MIN(control->maxram, one_g * 2 / 3);
|
||||
} else
|
||||
control->usable_ram = control->maxram;
|
||||
round_to_page(&control->maxram);
|
||||
|
||||
setup_ram(control);
|
||||
show_summary();
|
||||
|
||||
gettimeofday(&start_time, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue