… | |
… | |
136 | hval = NEXT (hval, ip); |
136 | hval = NEXT (hval, ip); |
137 | hslot = htab + IDX (hval); |
137 | hslot = htab + IDX (hval); |
138 | ref = *hslot; *hslot = ip; |
138 | ref = *hslot; *hslot = ip; |
139 | |
139 | |
140 | if (1 |
140 | if (1 |
141 | #if INIT_HTAB && !USE_MEMCPY |
141 | #if INIT_HTAB |
142 | && ref < ip /* the next test will actually take care of this, but this is faster */ |
142 | && ref < ip /* the next test will actually take care of this, but this is faster */ |
143 | #endif |
143 | #endif |
144 | && (off = ip - ref - 1) < MAX_OFF |
144 | && (off = ip - ref - 1) < MAX_OFF |
145 | && ip + 4 < in_end |
145 | && ip + 4 < in_end |
146 | && ref > (u8 *)in_data |
146 | && ref > (u8 *)in_data |
… | |
… | |
254 | lit = 0; op++; /* start run */ |
254 | lit = 0; op++; /* start run */ |
255 | } |
255 | } |
256 | } |
256 | } |
257 | } |
257 | } |
258 | |
258 | |
259 | if (op + 2 > out_end) /* at most 2 bytes can be missing here */ |
259 | if (op + 3 > out_end) /* at most 3 bytes can be missing here */ |
260 | return 0; |
260 | return 0; |
261 | |
261 | |
262 | while (ip < in_end) |
262 | while (ip < in_end) |
263 | { |
263 | { |
264 | lit++; *op++ = *ip++; |
264 | lit++; *op++ = *ip++; |
|
|
265 | |
|
|
266 | if (expect_false (lit == MAX_LIT)) |
|
|
267 | { |
|
|
268 | op [- lit - 1] = lit - 1; /* stop run */ |
|
|
269 | lit = 0; op++; /* start run */ |
|
|
270 | } |
265 | } |
271 | } |
266 | |
272 | |
267 | op [- lit - 1] = lit - 1; /* end run */ |
273 | op [- lit - 1] = lit - 1; /* end run */ |
268 | op -= !lit; /* undo run if length is zero */ |
274 | op -= !lit; /* undo run if length is zero */ |
269 | |
275 | |