struct _RangeMap {
- void* (*alloc) ( const HChar*, SizeT ); /* alloc fn (nofail) */
- const HChar* cc; /* cost centre for alloc */
- void (*free) ( void* ); /* free fn */
+ void* (*alloc_fn) ( const HChar*, SizeT ); /* alloc fn (nofail) */
+ const HChar* cc; /* cost centre for alloc */
+ void (*free_fn) ( void* ); /* free fn */
XArray* ranges;
};
vg_assert(alloc_fn);
vg_assert(free_fn);
RangeMap* rm = alloc_fn(cc, sizeof(RangeMap));
- vg_assert(rm);
- rm->alloc = alloc_fn;
- rm->cc = cc;
- rm->free = free_fn;
+ rm->alloc_fn = alloc_fn;
+ rm->cc = cc;
+ rm->free_fn = free_fn;
rm->ranges = VG_(newXA)( alloc_fn, cc, free_fn, sizeof(Range) );
vg_assert(rm->ranges);
/* Add the initial range */
void VG_(deleteRangeMap) ( RangeMap* rm )
{
vg_assert(rm);
- vg_assert(rm->free);
+ vg_assert(rm->free_fn);
vg_assert(rm->ranges);
VG_(deleteXA)(rm->ranges);
- rm->free(rm);
+ rm->free_fn(rm);
}
void VG_(bindRangeMap) ( RangeMap* rm,
typedef struct _RangeMap RangeMap;
/* Create a new RangeMap, using given allocation and free functions.
- Alloc fn must not fail (that is, if it returns it must have
+ alloc_fn must not return NULL (that is, if it returns it must have
succeeded.) The new array will contain a single range covering the
- entire key space, which will be bound to the value |initialVal|. */
+ entire key space, which will be bound to the value |initialVal|.
+ This function never returns NULL. */
RangeMap* VG_(newRangeMap) ( void*(*alloc_fn)(const HChar*,SizeT),
const HChar* cc,
void(*free_fn)(void*),
return;
gIgnoredAddressRanges = VG_(newRangeMap)( VG_(malloc), "mc.igIAR.1",
VG_(free), IAR_NotIgnored );
- tl_assert(gIgnoredAddressRanges != NULL);
}
INLINE Bool MC_(in_ignored_range) ( Addr a )