Lines Matching refs:tab

52  * tab	- the hash table.
60 const htab_t *tab,
64 htab_itemx_t *x = tab->avlt;
85 * tab - the hash table.
93 const htab_t *tab,
98 htab_itemx_t *x = tab->avlt;
269 * tab - the hash table.
276 htab_t *tab,
288 if (tab->avlt == NULL) {
289 tab->avlt = x;
293 a = tab->avlt;
294 p = tab->avlt;
360 tab->avlt = c;
369 if (x->uid > tab->buid) {
370 tab->buid = x->uid;
379 * tab - the hash table.
387 htab_t *tab,
400 avl_search(tab, uid) != NULL) {
410 if (uid > tab->buid &&
411 (tab->flags & UID_FLAGS_SEQ) != 0) {
412 start = tab->buid + 1;
424 x->n = tab->list;
425 tab->list = x;
426 if (tab->tail == NULL) {
427 tab->tail = x;
435 avl_insert(tab, x);
448 * tab - the hash table.
460 htab_t *tab,
473 x = avl_search(tab, uid);
475 x = new_uid(tab, uid);
484 x = tab->list;
494 UID_REUSABLE(tab->c->timestamp(), x) == 0) {
496 tab->list = x;
497 x = new_uid(tab, tab->buid + 1);
501 tab->list = n;
504 if (tab->list == NULL) {
505 tab->tail = NULL;
528 * tab - the hash table.
534 htab_t *tab
547 logsize = tab->logsize + 1;
550 newsz * tab->chunks, sizeof (htab_item_t *));
554 oldsz = (1 << tab->logsize);
556 while (i < tab->chunks) {
559 item = tab->items[(i * oldsz) + j];
564 uid = tab->c->get_uid(item->p);
566 tab->c->get_uid((*itemp)->p) >
578 free(tab->items);
579 tab->items = items;
580 tab->logsize = logsize;
581 tab->mask = mask;
620 htab_t *tab = NULL;
627 tab = (htab_t *)calloc(1, sizeof (htab_t));
628 if (tab != NULL) {
633 tab->flags = flags;
634 tab->items = items;
635 tab->logsize = logsize;
636 tab->chunks = chunks;
637 tab->mask = count - 1;
638 tab->count = 1; /* reserve one */
639 tab->avlt = NULL;
640 tab->buid = 0;
641 tab->list = NULL;
642 tab->tail = NULL;
644 free(tab);
645 tab = NULL;
650 return (tab);
684 * tab - the hash table.
695 htab_t *tab,
712 hval = VALID_HVAL(tab->c->get_hval(p, 0, &flags));
715 items = tab->items[hval & tab->mask];
717 if (tab->c->cmp(items->p, p, 0) == 0) {
719 ec = tab->c->replace_hook(items->p, p, uid_p,
737 items = (htab_item_t *)calloc(tab->chunks, sizeof (htab_item_t));
740 tab->count == 0 ||
741 (++tab->count) == 0) {
748 chunksz = (1 << tab->logsize);
749 if (tab->count >= (chunksz * HASH_RATIO) &&
750 tab->logsize < MAX_LOGSIZE) {
751 enlarge_htab(tab);
752 chunksz = (1 << tab->logsize);
756 uid = tab->c->get_uid(p);
757 switch (uid_insert(tab, &uid, hval)) {
767 tab->c->set_uid(p, uid);
776 ec = tab->c->add_hook(p);
783 itemp = &tab->items[(i * chunksz) + (hval & tab->mask)];
785 tab->c->get_uid((*itemp)->p) > uid) {
791 if (i < tab->chunks) {
792 hval = VALID_HVAL(tab->c->get_hval(p, i, &flags));
806 tab->c->ddd(p, '+');
826 * tab - the hash table.
836 htab_t *tab,
854 x = avl_search(tab, uid);
862 hval = VALID_HVAL(tab->c->get_hval(p, 0, &flags));
867 chunksz = (1 << tab->logsize);
869 itemp = &tab->items[(i * chunksz) + (hval & tab->mask)];
873 if (tab->c->cmp(item->p, p, 1) == 0) {
877 if ((clone = tab->c->clone(item->p,
879 tab->c->ddd(item->p, '-');
880 tab->count --;
906 if (zhizi != NULL && i < tab->chunks) {
907 hval = VALID_HVAL(tab->c->get_hval(
917 uid = tab->c->get_uid(zhizi);
919 x = avl_search(tab, uid);
925 x->t = tab->c->timestamp();
927 if (tab->list != NULL) {
928 tab->tail->n = x;
930 tab->list = x;
932 tab->tail = x;
948 * tab - the hash table.
961 htab_t *tab,
980 x = avl_search(tab, uid);
987 hval = VALID_HVAL(tab->c->get_hval(p, 0, &flags));
993 chunksz = (1 << tab->logsize);
994 itemp = &tab->items[(i * chunksz) + (hval & tab->mask)];
997 if (tab->c->cmp(item->p, p, 1) == 0) {
1010 *uid_p = tab->c->get_uid(zhizi);
1018 ASSERT(tab->chunks == 1 && x != NULL);
1023 hval = VALID_HVAL(tab->c->get_hval(zhizi, 0, &flags));
1026 itemp = &tab->items[(hval & tab->mask)];
1028 (tab->c->get_uid((*itemp)->p) >
1029 tab->c->get_uid(zhizi))) {
1048 * tab - the hash table.
1056 htab_t *tab,
1064 x = avl_search_next(tab, uid);
1083 * tab - the hash table.
1090 htab_t *tab
1098 chunksz = (1 << tab->logsize);
1101 items = tab->items[i];
1103 tab->c->dump(items->p);