Lines Matching refs:rm
59 static void preen (/*MOD*/RangeMap* rm);
60 static Word find ( const RangeMap* rm, UWord key );
61 static void split_at ( /*MOD*/RangeMap* rm, UWord key );
62 static void show ( const RangeMap* rm );
73 RangeMap* rm = alloc_fn(cc, sizeof(RangeMap)); in VG_() local
74 rm->alloc_fn = alloc_fn; in VG_()
75 rm->cc = cc; in VG_()
76 rm->free_fn = free_fn; in VG_()
77 rm->ranges = VG_(newXA)( alloc_fn, cc, free_fn, sizeof(Range) ); in VG_()
83 Word i = VG_(addToXA)(rm->ranges, &r); in VG_()
85 vg_assert(VG_(sizeXA)(rm->ranges) == 1); in VG_()
87 return rm; in VG_()
90 void VG_(deleteRangeMap) ( RangeMap* rm ) in VG_()
92 vg_assert(rm); in VG_()
93 vg_assert(rm->free_fn); in VG_()
94 vg_assert(rm->ranges); in VG_()
95 VG_(deleteXA)(rm->ranges); in VG_()
96 rm->free_fn(rm); in VG_()
99 void VG_(bindRangeMap) ( RangeMap* rm, in VG_()
103 split_at(rm, key_min); in VG_()
105 split_at(rm, key_max + 1); in VG_()
107 iMin = find(rm, key_min); in VG_()
108 iMax = find(rm, key_max); in VG_()
110 Range* rng = VG_(indexXA)(rm->ranges, i); in VG_()
113 preen(rm); in VG_()
117 /*OUT*/UWord* val, const RangeMap* rm, UWord key ) in VG_()
119 Word i = find(rm, key); in VG_()
120 Range* rng = (Range*)VG_(indexXA)(rm->ranges, i); in VG_()
126 Word VG_(sizeRangeMap) ( const RangeMap* rm ) in VG_()
128 vg_assert(rm && rm->ranges); in VG_()
129 return VG_(sizeXA)(rm->ranges); in VG_()
133 /*OUT*/UWord* val, const RangeMap* rm, Word ix ) in VG_()
135 vg_assert(rm && rm->ranges); in VG_()
136 Range* rng = (Range*)VG_(indexXA)(rm->ranges, ix); in VG_()
144 static void preen (/*MOD*/RangeMap* rm) in preen() argument
147 XArray* ranges = rm->ranges; in preen()
161 static Word find ( const RangeMap* rm, UWord key ) in find() argument
163 XArray* ranges = rm->ranges; in find()
184 static void split_at ( /*MOD*/RangeMap* rm, UWord key ) in split_at() argument
186 XArray* ranges = rm->ranges; in split_at()
187 Word i = find(rm, key); in split_at()
201 static void show ( const RangeMap* rm ) in show() argument
204 VG_(printf)("<< %ld entries:\n", VG_(sizeXA)(rm->ranges) ); in show()
205 for (i = 0; i < VG_(sizeXA)(rm->ranges); i++) { in show()
206 Range* rng = (Range*)VG_(indexXA)(rm->ranges, i); in show()