mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Fixes for 32 bit limits and osx compilation.
This commit is contained in:
parent
c533b031bc
commit
93f7c602d0
|
|
@ -95,7 +95,7 @@ typedef uint32_t u32;
|
|||
typedef struct rzip_control rzip_control;
|
||||
typedef struct md5_ctx md5_ctx;
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
#ifndef mremap
|
||||
# define mremap fake_mremap
|
||||
#endif
|
||||
|
||||
|
|
|
|||
5
main.c
5
main.c
|
|
@ -41,6 +41,7 @@
|
|||
#include "rzip.h"
|
||||
#include "lrzip.h"
|
||||
#include "util.h"
|
||||
#include "stream.h"
|
||||
|
||||
/* needed for CRC routines */
|
||||
#include "lzma/C/7zCrc.h"
|
||||
|
|
@ -762,12 +763,12 @@ int main(int argc, char *argv[])
|
|||
i64 usable_ram;
|
||||
|
||||
/* Decrease usable ram size on 32 bits due to kernel /
|
||||
* userspace split. Cannot allocate larger than a 2
|
||||
* userspace split. Cannot allocate larger than a 1
|
||||
* gigabyte chunk due to 32 bit signed long being
|
||||
* used in alloc */
|
||||
usable_ram = MAX(control.ramsize - 900000000ll, 900000000ll);
|
||||
control.maxram = MIN(control.maxram, usable_ram);
|
||||
control.maxram = MIN((unsigned long long)control.maxram, two_gig);
|
||||
control.maxram = MIN(control.maxram, one_g);
|
||||
}
|
||||
round_to_page(&control.maxram);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue