MCPcopy Create free account
hub / github.com/F-Stack/f-stack / slide_hash

Function slide_hash

freebsd/contrib/zlib/deflate.c:204–228  ·  view source on GitHub ↗

=========================================================================== * Slide the hash table when sliding the window down (could be avoided with 32 * bit values at the expense of memory usage). We slide even when level == 0 to * keep the hash table consistent if we switch back to level > 0 later. */

(s)

Source from the content-addressed store, hash-verified

202 * keep the hash table consistent if we switch back to level > 0 later.
203 */
204local void slide_hash(s)
205 deflate_state *s;
206{
207 unsigned n, m;
208 Posf *p;
209 uInt wsize = s->w_size;
210
211 n = s->hash_size;
212 p = &s->head[n];
213 do {
214 m = *--p;
215 *p = (Pos)(m >= wsize ? m - wsize : NIL);
216 } while (--n);
217 n = wsize;
218#ifndef FASTEST
219 p = &s->prev[n];
220 do {
221 m = *--p;
222 *p = (Pos)(m >= wsize ? m - wsize : NIL);
223 /* If n is not on any hash chain, prev[n] is garbage but
224 * its value will never be used.
225 */
226 } while (--n);
227#endif
228}
229
230/* ========================================================================= */
231int ZEXPORT deflateInit_(strm, level, version, stream_size)

Callers 2

deflateParamsFunction · 0.85
fill_windowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected