mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Drop the upper limit on lzma compression window on 64 bit. It is not necessary.
zpaq will fail with windows bigger than 600MB on 32 bit due to failing testing the 3* malloc test, so limit it to 600MB as well as lzma on 32 bit.
This commit is contained in:
parent
b8528abee9
commit
ead0e54182
4
rzip.c
4
rzip.c
|
|
@ -718,7 +718,7 @@ static void rzip_chunk(struct rzip_state *st, int fd_in, int fd_out, i64 offset,
|
|||
}
|
||||
|
||||
/* Needs to be less than 31 bits and page aligned on 32 bits */
|
||||
static const i64 two_gig = (1ull << 31) - 4096;
|
||||
const i64 two_gig = (1ull << 31) - 4096;
|
||||
|
||||
/* compress a whole file chunks at a time */
|
||||
void rzip_fd(int fd_in, int fd_out)
|
||||
|
|
@ -797,7 +797,7 @@ void rzip_fd(int fd_in, int fd_out)
|
|||
if (st->chunk_size > len && !STDIN)
|
||||
st->chunk_size = len;
|
||||
st->mmap_size = st->chunk_size;
|
||||
if (sizeof(long) == 4 && st->mmap_size > two_gig) {
|
||||
if (BITS32 && st->mmap_size > two_gig) {
|
||||
print_verbose("Limiting to 2GB due to 32 bit limitations\n");
|
||||
st->mmap_size = two_gig;
|
||||
}
|
||||
|
|
|
|||
3
rzip.h
3
rzip.h
|
|
@ -211,6 +211,8 @@ static inline i64 get_ram(void)
|
|||
#define MAXRAM (control.flags & FLAG_MAXRAM)
|
||||
#define UNLIMITED (control.flags & FLAG_UNLIMITED)
|
||||
|
||||
#define BITS32 (sizeof(long) == 4)
|
||||
|
||||
#define CTYPE_NONE 3
|
||||
#define CTYPE_BZIP2 4
|
||||
#define CTYPE_LZO 5
|
||||
|
|
@ -272,6 +274,7 @@ ssize_t write_1g(int fd, void *buf, i64 len);
|
|||
ssize_t read_1g(int fd, void *buf, i64 len);
|
||||
void zpipe_compress(FILE *in, FILE *out, FILE *msgout, long long int buf_len, int progress);
|
||||
void zpipe_decompress(FILE *in, FILE *out, FILE *msgout, long long int buf_len, int progress);
|
||||
const i64 two_gig;
|
||||
|
||||
#define print_err(format, args...) do {\
|
||||
fprintf(stderr, format, ##args); \
|
||||
|
|
|
|||
13
stream.c
13
stream.c
|
|
@ -583,15 +583,10 @@ void *open_stream_out(int f, int n, i64 limit)
|
|||
however, the larger the buffer, the better the compression so we
|
||||
make it as large as the window up to the limit the compressor
|
||||
will take */
|
||||
if (LZMA_COMPRESS) {
|
||||
if (sizeof(long) == 4) {
|
||||
/* Largest window supported on lzma 32bit is 600MB */
|
||||
if (!cwindow || cwindow > 6)
|
||||
cwindow = 6;
|
||||
}
|
||||
/* Largest window supported on lzma 64bit is 4GB */
|
||||
if (!cwindow || cwindow > 40)
|
||||
cwindow = 40;
|
||||
if (BITS32) {
|
||||
/* Largest window supported on 32bit is 600MB */
|
||||
if (!cwindow || cwindow > 6)
|
||||
cwindow = 6;
|
||||
}
|
||||
|
||||
if (LZMA_COMPRESS || ZPAQ_COMPRESS)
|
||||
|
|
|
|||
Loading…
Reference in a new issue