mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-04-04 13:57:40 +00:00
We were attempting to truncate mmap to page size when only the offset needed to be.
Fix the longstanding limit on 32 bits that allowed us to allocate only 2GB of ram by moving the big malloc calls to mmap equivalents which allow us to mmap up to 2^44 bytes of anonymous space. Use progressively smaller preallocation to try and defragment ram prior to real mmap call to increase success rate of allocating ram when it's a significant proportion of total ram. Don't fail if preallocation is unsuccessful. Add more detailed error reporting. Minor cleanups.
This commit is contained in:
parent
19c2769061
commit
2bacbc60d2
3 changed files with 40 additions and 43 deletions
7
main.c
7
main.c
|
|
@ -770,13 +770,6 @@ int main(int argc, char *argv[])
|
|||
control.window = 1;
|
||||
}
|
||||
|
||||
/* malloc limited to 2GB on 32bit */
|
||||
if (sizeof(long) == 4 && control.window > 20) {
|
||||
control.window = 20;
|
||||
if (control.flags & FLAG_VERBOSE)
|
||||
fprintf(stderr, "Limiting control window to 2GB due to 32bit limitations.\n");
|
||||
}
|
||||
|
||||
/* OK, if verbosity set, print summary of options selected */
|
||||
if ((control.flags & FLAG_VERBOSE) && !(control.flags & FLAG_INFO)) {
|
||||
fprintf(stderr, "The following options are in effect for this %s.\n",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue