Lines Matching refs:map
51 freemap(Intmap *map, void (*destroy)(void*)) in freemap() argument
59 for(p=map->hash[i]; p; p=nlink){ in freemap()
66 free(map); in freemap()
70 llookup(Intmap *map, ulong id) in llookup() argument
74 for(lf=&map->hash[hashid(id)]; *lf; lf=&(*lf)->link) in llookup()
87 lookupkey(Intmap *map, ulong id) in lookupkey() argument
92 rlock(map); in lookupkey()
93 if(f = *llookup(map, id)){ in lookupkey()
95 map->inc(v); in lookupkey()
98 runlock(map); in lookupkey()
103 insertkey(Intmap *map, ulong id, void *v) in insertkey() argument
109 wlock(map); in insertkey()
110 if(f = *llookup(map, id)){ in insertkey()
119 f->link = map->hash[h]; in insertkey()
120 map->hash[h] = f; in insertkey()
123 wunlock(map); in insertkey()
128 caninsertkey(Intmap *map, ulong id, void *v) in caninsertkey() argument
134 wlock(map); in caninsertkey()
135 if(*llookup(map, id)) in caninsertkey()
142 f->link = map->hash[h]; in caninsertkey()
143 map->hash[h] = f; in caninsertkey()
146 wunlock(map); in caninsertkey()
151 deletekey(Intmap *map, ulong id) in deletekey() argument
156 wlock(map); in deletekey()
157 if(f = *(lf = llookup(map, id))){ in deletekey()
163 wunlock(map); in deletekey()