Lines Matching full:ip

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