Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Making the high buffer only one page size is faster for sliding mmap …
…mode
  • Loading branch information
ckolivas committed Mar 10, 2015
1 parent d5a3393 commit 9a17a54
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions rzip.c
Expand Up @@ -843,12 +843,9 @@ init_sliding_mmap(rzip_control *control, struct rzip_state *st, int fd_in,
{
struct sliding_buffer *sb = &control->sb;

/* Initialise the high buffer */
/* Initialise the high buffer. One page size is fastest to manipulate */
if (!STDIN) {
sb->high_length = 65536;
/* Round up to the next biggest page size */
if (sb->high_length % control->page_size)
sb->high_length += control->page_size - (sb->high_length % control->page_size);
sb->high_length = control->page_size;
sb->buf_high = (uchar *)mmap(NULL, sb->high_length, PROT_READ, MAP_SHARED, fd_in, offset);
if (unlikely(sb->buf_high == MAP_FAILED))
failure("Unable to mmap buf_high in init_sliding_mmap\n");
Expand Down

0 comments on commit 9a17a54

Please sign in to comment.