Lines Matching refs:ip
38 dt_inttab_t *ip;
42 if ((ip = dt_zalloc(dtp, sizeof (dt_inttab_t))) == NULL ||
43 (ip->int_hash = dt_zalloc(dtp, sizeof (void *) * len)) == NULL) {
44 dt_free(dtp, ip);
48 ip->int_hdl = dtp;
49 ip->int_hashlen = len;
51 return (ip);
55 dt_inttab_destroy(dt_inttab_t *ip)
59 for (hp = ip->int_head; hp != NULL; hp = np) {
61 dt_free(ip->int_hdl, hp);
64 dt_free(ip->int_hdl, ip->int_hash);
65 dt_free(ip->int_hdl, ip);
69 dt_inttab_insert(dt_inttab_t *ip, uint64_t value, uint_t flags)
71 uint_t h = value & (ip->int_hashlen - 1);
75 for (hp = ip->int_hash[h]; hp != NULL; hp = hp->inh_hash) {
81 if ((hp = dt_alloc(ip->int_hdl, sizeof (dt_inthash_t))) == NULL)
84 hp->inh_hash = ip->int_hash[h];
87 hp->inh_index = ip->int_index++;
90 ip->int_hash[h] = hp;
91 ip->int_nelems++;
93 if (ip->int_head == NULL)
94 ip->int_head = hp;
96 ip->int_tail->inh_next = hp;
98 ip->int_tail = hp;
103 dt_inttab_size(const dt_inttab_t *ip)
105 return (ip->int_nelems);
109 dt_inttab_write(const dt_inttab_t *ip, uint64_t *dst)
113 for (hp = ip->int_head; hp != NULL; hp = hp->inh_next)