Skip to content

Commit

Permalink
Update zlib-intel (#51857)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarnaViire authored Apr 26, 2021
1 parent 3b1085c commit 268ad5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ struct match {
uInt orgstart;
};

#define MAX_DIST2 ((1 << MAX_WBITS) - MIN_LOOKAHEAD)

static int tr_tally_dist(deflate_state *s, int distance, int length)
{
return _tr_tally(s, distance, length);
Expand Down Expand Up @@ -113,6 +111,7 @@ static void fizzle_matches(deflate_state *s, struct match *current, struct match
unsigned char *match, *orig;
int changed = 0;
struct match c,n;
uInt maxDist;
/* step zero: sanity checks */

if (current->match_length <= 1)
Expand Down Expand Up @@ -142,7 +141,8 @@ static void fizzle_matches(deflate_state *s, struct match *current, struct match
n = *next;

/* step one: try to move the "next" match to the left as much as possible */
limit = next->strstart > MAX_DIST2 ? next->strstart - MAX_DIST2 : 0;
maxDist = MAX_DIST(s);
limit = next->strstart > maxDist ? next->strstart - maxDist : 0;

match = s->window + n.match_start - 1;
orig = s->window + n.strstart - 1;
Expand Down Expand Up @@ -230,7 +230,7 @@ block_state deflate_medium(deflate_state *s, int flush)
* At this point we have always match_length < MIN_MATCH
*/

if (hash_head != 0 && s->strstart - hash_head <= MAX_DIST2) {
if (hash_head != 0 && s->strstart - hash_head <= MAX_DIST(s)) {
/* To simplify the code, we prevent matches with the string
* of window index 0 (in particular we have to avoid a match
* of the string with itself at the start of the input file).
Expand Down Expand Up @@ -265,7 +265,7 @@ block_state deflate_medium(deflate_state *s, int flush)
/* Find the longest match, discarding those <= prev_length.
* At this point we have always match_length < MIN_MATCH
*/
if (hash_head != 0 && s->strstart - hash_head <= MAX_DIST2) {
if (hash_head != 0 && s->strstart - hash_head <= MAX_DIST(s)) {
/* To simplify the code, we prevent matches with the string
* of window index 0 (in particular we have to avoid a match
* of the string with itself at the start of the input file).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
is from https://github.com/madler/zlib/releases/tag/v1.2.11

.\zlib-intel (for x64/x86)
is from https://github.com/jtkukunas/zlib/tree/v1.2.11.1_jtkv6.3
is from https://github.com/jtkukunas/zlib/commit/bf103c626c6c0d80580748f6b814ec534614ca52

0 comments on commit 268ad5b

Please sign in to comment.