Lines Matching refs:hash

50 	Dthash_t	*hash = (Dthash_t*)dt->data;  in htable()  local
52 if((n = hash->tblz) > 0 && (hash->type&H_FIXED) ) in htable()
58 { hash->type |= H_FIXED; in htable()
65 n = n < HLOAD(hash->data.size) ? HLOAD(hash->data.size) : n; in htable()
68 if((n = k) <= hash->tblz) in htable()
79 for(endt = (t = hash->htbl) + hash->tblz; t < endt; ++t) in htable()
87 if(hash->htbl) /* free old table and set new table */ in htable()
88 (void)(*dt->memoryf)(dt, hash->htbl, 0, disc); in htable()
89 hash->htbl = htbl; in htable()
90 hash->tblz = n; in htable()
98 Dthash_t *hash = (Dthash_t*)dt->data; in hclear() local
100 hash->here = NIL(Dtlink_t*); in hclear()
101 hash->data.size = 0; in hclear()
103 for(endt = (t = hash->htbl) + hash->tblz; t < endt; ++t) in hclear()
117 Dthash_t *hash = (Dthash_t*)dt->data; in hfirst() local
119 for(endt = (t = hash->htbl) + hash->tblz; t < endt; ++t) in hfirst()
122 hash->here = l; in hfirst()
132 Dthash_t *hash = (Dthash_t*)dt->data; in hnext() local
135 { hash->here = next; in hnext()
139 { t = hash->htbl + (l->_hash & (hash->tblz-1)) + 1; in hnext()
140 endt = hash->htbl + hash->tblz; in hnext()
144 hash->here = l; in hnext()
154 Dthash_t *hash = (Dthash_t*)dt->data; in hflatten() local
158 for(endt = (t = hash->htbl) + hash->tblz; t < endt; ++t) in hflatten()
169 { hash->here = head; in hflatten()
170 hash->type |= H_FLATTEN; in hflatten()
172 else hash->data.size = 0; in hflatten()
177 { head = hash->here; in hflatten()
178 for(endt = (t = hash->htbl) + hash->tblz; t < endt; ++t) in hflatten()
193 hash->here = NIL(Dtlink_t*); in hflatten()
194 hash->type &= ~H_FLATTEN; in hflatten()
226 Dthash_t *hash = (Dthash_t*)dt->data; in hstat() local
231 st->size = hash->data.size; in hstat()
232 st->space = sizeof(Dthash_t) + hash->tblz*sizeof(Dtlink_t*) + in hstat()
233 (dt->disc->link >= 0 ? 0 : hash->data.size*sizeof(Dthold_t)); in hstat()
235 for(endt = (t = hash->htbl) + hash->tblz; t < endt; ++t) in hstat()
246 return (Void_t*)hash->data.size; in hstat()
262 Dthash_t *hash = (Dthash_t*)dt->data; local
270 if(!hash->htbl && htable(dt) < 0 ) /* initialize hash table */
273 if(hash->type&H_FLATTEN) /* restore flattened list */
287 lnk = hash->here; /* fingered object */
288 hash->here = NIL(Dtlink_t*);
312 tbl = hash->htbl + (hsh & (hash->tblz-1));
332 { hash->here = ll;
338 { hash->data.size -= 1;
362 if(hash->tblz < HLOAD(hash->data.size) )
364 tbl = hash->htbl + (hsh & (hash->tblz-1));
370 hash->data.size += 1;
376 hash->here = lnk;
388 Dthash_t *hash = (Dthash_t*)dt->data; in hashevent() local
391 { if(hash) in hashevent()
393 if(!(hash = (Dthash_t*)(*dt->memoryf)(dt, 0, sizeof(Dthash_t), dt->disc)) ) in hashevent()
397 memset(hash, 0, sizeof(Dthash_t)); in hashevent()
398 dt->data = (Dtdata_t*)hash; in hashevent()
402 { if(!hash) in hashevent()
404 if(hash->data.size > 0 ) in hashevent()
406 if(hash->htbl) in hashevent()
407 (void)(*dt->memoryf)(dt, hash->htbl, 0, dt->disc); in hashevent()
408 (void)(*dt->memoryf)(dt, hash, 0, dt->disc); in hashevent()