Lines Matching refs:ip

36 	dt_inttab_t *ip;  in dt_inttab_create()  local
40 if ((ip = dt_zalloc(dtp, sizeof (dt_inttab_t))) == NULL || in dt_inttab_create()
41 (ip->int_hash = dt_zalloc(dtp, sizeof (void *) * len)) == NULL) { in dt_inttab_create()
42 dt_free(dtp, ip); in dt_inttab_create()
46 ip->int_hdl = dtp; in dt_inttab_create()
47 ip->int_hashlen = len; in dt_inttab_create()
49 return (ip); in dt_inttab_create()
53 dt_inttab_destroy(dt_inttab_t *ip) in dt_inttab_destroy() argument
57 for (hp = ip->int_head; hp != NULL; hp = np) { in dt_inttab_destroy()
59 dt_free(ip->int_hdl, hp); in dt_inttab_destroy()
62 dt_free(ip->int_hdl, ip->int_hash); in dt_inttab_destroy()
63 dt_free(ip->int_hdl, ip); in dt_inttab_destroy()
67 dt_inttab_insert(dt_inttab_t *ip, uint64_t value, uint_t flags) in dt_inttab_insert() argument
69 uint_t h = value & (ip->int_hashlen - 1); in dt_inttab_insert()
73 for (hp = ip->int_hash[h]; hp != NULL; hp = hp->inh_hash) { in dt_inttab_insert()
79 if ((hp = dt_alloc(ip->int_hdl, sizeof (dt_inthash_t))) == NULL) in dt_inttab_insert()
82 hp->inh_hash = ip->int_hash[h]; in dt_inttab_insert()
85 hp->inh_index = ip->int_index++; in dt_inttab_insert()
88 ip->int_hash[h] = hp; in dt_inttab_insert()
89 ip->int_nelems++; in dt_inttab_insert()
91 if (ip->int_head == NULL) in dt_inttab_insert()
92 ip->int_head = hp; in dt_inttab_insert()
94 ip->int_tail->inh_next = hp; in dt_inttab_insert()
96 ip->int_tail = hp; in dt_inttab_insert()
101 dt_inttab_size(const dt_inttab_t *ip) in dt_inttab_size() argument
103 return (ip->int_nelems); in dt_inttab_size()
107 dt_inttab_write(const dt_inttab_t *ip, uint64_t *dst) in dt_inttab_write() argument
111 for (hp = ip->int_head; hp != NULL; hp = hp->inh_next) in dt_inttab_write()