Lines Matching refs:table
58 These are functions for producing 32-bit hashes for hash table lookup.
215 The best hash table sizes are powers of 2. There is no need to do
219 In which case, the hash table should have hashsize(10) elements.
227 Use for hash table lookup, or anything where one collision in 2^^32 is
439 t->table = (struct lh_entry*)calloc(size, sizeof(struct lh_entry));
440 if(!t->table) lh_abort("lh_table_new: calloc failed\n");
444 for(i = 0; i < size; i++) t->table[i].k = LH_EMPTY;
471 free(t->table);
472 t->table = new_t->table;
488 free(t->table);
504 if(t->table[n].k == LH_EMPTY || t->table[n].k == LH_FREED) break;
509 t->table[n].k = k;
510 t->table[n].v = v;
514 t->head = t->tail = &t->table[n];
515 t->table[n].next = t->table[n].prev = NULL;
517 t->tail->next = &t->table[n];
518 t->table[n].prev = t->tail;
519 t->table[n].next = NULL;
520 t->tail = &t->table[n];
535 if(t->table[n].k == LH_EMPTY) return NULL;
536 if(t->table[n].k != LH_FREED &&
537 t->equal_fn(t->table[n].k, k)) return &t->table[n];
565 ptrdiff_t n = (ptrdiff_t)(e - t->table); /* CAW: fixed to be 64bit nice, still need the crazy negative case... */
570 if(t->table[n].k == LH_EMPTY || t->table[n].k == LH_FREED) return -1;
573 t->table[n].v = NULL;
574 t->table[n].k = LH_FREED;
575 if(t->tail == &t->table[n] && t->head == &t->table[n]) {
577 } else if (t->head == &t->table[n]) {
580 } else if (t->tail == &t->table[n]) {
584 t->table[n].prev->next = t->table[n].next;
585 t->table[n].next->prev = t->table[n].prev;
587 t->table[n].next = t->table[n].prev = NULL;