|
From: <sv...@va...> - 2008-03-23 16:30:51
|
Author: bart
Date: 2008-03-23 15:47:03 +0000 (Sun, 23 Mar 2008)
New Revision: 7762
Log:
Implemented reference counting on DRD's second level bitmap.
Modified:
branches/DRDDEV/coregrind/m_oset.c
branches/DRDDEV/exp-drd/drd_bitmap.c
branches/DRDDEV/exp-drd/drd_bitmap.h
branches/DRDDEV/exp-drd/pub_drd_bitmap.h
branches/DRDDEV/include/pub_tool_oset.h
branches/DRDDEV/memcheck/tests/oset_test.c
Modified: branches/DRDDEV/coregrind/m_oset.c
===================================================================
--- branches/DRDDEV/coregrind/m_oset.c 2008-03-23 14:32:21 UTC (rev 7761)
+++ branches/DRDDEV/coregrind/m_oset.c 2008-03-23 15:47:03 UTC (rev 7762)
@@ -76,9 +76,10 @@
// concurrent uses would screw things up.
#include "pub_core_basics.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcbase.h"
-#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
+#include "pub_core_mallocfree.h"
#include "pub_core_oset.h"
/*--------------------------------------------------------------------*/
@@ -294,7 +295,7 @@
vg_assert(_free);
if (!_cmp) vg_assert(0 == _keyOff); // If no cmp, offset must be zero
- t = _alloc(sizeof(AvlTree));
+ t = VG_(malloc)(sizeof(AvlTree));
t->keyOff = _keyOff;
t->cmp = _cmp;
t->alloc = _alloc;
@@ -344,7 +345,7 @@
vg_assert(sz == t->nElems);
/* Free the AvlTree itself. */
- t->free(t);
+ VG_(free)(t);
}
void VG_(OSetWord_Destroy)(AvlTree* t)
@@ -368,6 +369,11 @@
t->free( node_of_elem(e) );
}
+void* VG_(OSetGen_NodeToElem)(void* node)
+{
+ return elem_of_node(node);
+}
+
/*--------------------------------------------------------------------*/
/*--- Insertion ---*/
/*--------------------------------------------------------------------*/
Modified: branches/DRDDEV/exp-drd/drd_bitmap.c
===================================================================
--- branches/DRDDEV/exp-drd/drd_bitmap.c 2008-03-23 14:32:21 UTC (rev 7761)
+++ branches/DRDDEV/exp-drd/drd_bitmap.c 2008-03-23 15:47:03 UTC (rev 7762)
@@ -36,19 +36,26 @@
#include "drd_suppression.h"
-// Local constants.
+/* Forward declarations. */
-static ULong s_bitmap_creation_count;
+struct bitmap2;
-// Local function declarations.
+/* Local function declarations. */
+static void* bm2ref_new(const SizeT size);
+static void bm2ref_del(void* node);
static void bm2_merge(struct bitmap2* const bm2l,
const struct bitmap2* const bm2r);
-// Function definitions.
+/* Local constants. */
+static ULong s_bitmap_creation_count;
+
+
+/* Function definitions. */
+
struct bitmap* bm_new()
{
struct bitmap* bm;
@@ -60,8 +67,9 @@
bm = VG_(malloc)(sizeof(*bm));
tl_assert(bm);
bm->last_lookup_a1 = 0;
- bm->last_lookup_result = 0;
- bm->oset = VG_(OSetGen_Create)(0, 0, VG_(malloc), VG_(free));
+ bm->last_lookup_bm2ref = 0;
+ bm->last_lookup_bm2 = 0;
+ bm->oset = VG_(OSetGen_Create)(0, 0, bm2ref_new, bm2ref_del);
s_bitmap_creation_count++;
@@ -102,7 +110,7 @@
b_next = a2;
}
- bm2 = bm2_lookup_or_insert(bm, b1);
+ bm2 = bm2_lookup_or_insert_exclusive(bm, b1);
tl_assert(bm2);
if ((bm2->addr << ADDR0_BITS) < a1)
@@ -145,7 +153,7 @@
{
struct bitmap2* bm2;
- bm2 = bm2_lookup_or_insert(bm, a1 >> ADDR0_BITS);
+ bm2 = bm2_lookup_or_insert_exclusive(bm, a1 >> ADDR0_BITS);
bm0_set_range(bm2->bm1.bm0_r, a1 & ADDR0_MASK, size);
}
@@ -155,7 +163,7 @@
{
struct bitmap2* bm2;
- bm2 = bm2_lookup_or_insert(bm, a1 >> ADDR0_BITS);
+ bm2 = bm2_lookup_or_insert_exclusive(bm, a1 >> ADDR0_BITS);
bm0_set_range(bm2->bm1.bm0_w, a1 & ADDR0_MASK, size);
}
@@ -283,7 +291,7 @@
for (b = a1; b < a2; b = b_next)
{
- struct bitmap2* bm2 = bm2_lookup(bm, b >> ADDR0_BITS);
+ const struct bitmap2* bm2 = bm2_lookup(bm, b >> ADDR0_BITS);
b_next = (b & ~ADDR0_MASK) + ADDR0_COUNT;
if (b_next > a2)
@@ -338,9 +346,9 @@
const Addr a,
const BmAccessTypeT access_type)
{
- struct bitmap2* p2;
- struct bitmap1* p1;
- UWord* p0;
+ const struct bitmap2* p2;
+ const struct bitmap1* p1;
+ const UWord* p0;
const UWord a0 = a & ADDR0_MASK;
tl_assert(bm);
@@ -380,12 +388,16 @@
void bm_clear_all(const struct bitmap* const bm)
{
struct bitmap2* bm2;
+ struct bitmap2ref* bm2ref;
VG_(OSetGen_ResetIter)(bm->oset);
- for ( ; (bm2 = VG_(OSetGen_Next)(bm->oset)) != 0; )
+ for ( ; (bm2ref = VG_(OSetGen_Next)(bm->oset)) != 0; )
{
- struct bitmap1* const bm1 = &bm2->bm1;
+ struct bitmap1* bm1;
+
+ bm2 = bm2ref->bm2;
+ bm1 = &bm2->bm1;
tl_assert(bm1);
VG_(memset)(&bm1->bm0_r[0], 0, sizeof(bm1->bm0_r));
VG_(memset)(&bm1->bm0_w[0], 0, sizeof(bm1->bm0_w));
@@ -404,7 +416,7 @@
for (b = a1; b < a2; b = b_next)
{
- struct bitmap2* const p2 = bm2_lookup(bm, b >> ADDR0_BITS);
+ struct bitmap2* const p2 = bm2_lookup_exclusive(bm, b >> ADDR0_BITS);
b_next = (b & ~ADDR0_MASK) + ADDR0_COUNT;
if (b_next > a2)
@@ -456,7 +468,7 @@
for (b = a1; b < a2; b = b_next)
{
- struct bitmap2* bm2 = bm2_lookup(bm, b >> ADDR0_BITS);
+ const struct bitmap2* bm2 = bm2_lookup(bm, b >> ADDR0_BITS);
b_next = (b & ~ADDR0_MASK) + ADDR0_COUNT;
if (b_next > a2)
@@ -516,7 +528,7 @@
Bool bm_aligned_load_has_conflict_with(const struct bitmap* const bm,
const Addr a1, const SizeT size)
{
- struct bitmap2* bm2;
+ const struct bitmap2* bm2;
bm2 = bm2_lookup(bm, a1 >> ADDR0_BITS);
@@ -527,7 +539,7 @@
Bool bm_aligned_store_has_conflict_with(const struct bitmap* const bm,
const Addr a1, const SizeT size)
{
- struct bitmap2* bm2;
+ const struct bitmap2* bm2;
bm2 = bm2_lookup(bm, a1 >> ADDR0_BITS);
@@ -623,23 +635,28 @@
const struct bitmap* const rhs)
{
struct bitmap2* bm2l;
+ const struct bitmap2ref* bm2l_ref;
const struct bitmap2* bm2r;
+ const struct bitmap2ref* bm2r_ref;
// First step: allocate any missing bitmaps in *lhs.
VG_(OSetGen_ResetIter)(rhs->oset);
- for ( ; (bm2r = VG_(OSetGen_Next)(rhs->oset)) != 0; )
+ for ( ; (bm2r_ref = VG_(OSetGen_Next)(rhs->oset)) != 0; )
{
+ bm2r = bm2r_ref->bm2;
bm2_lookup_or_insert(lhs, bm2r->addr);
}
VG_(OSetGen_ResetIter)(lhs->oset);
VG_(OSetGen_ResetIter)(rhs->oset);
- for ( ; (bm2r = VG_(OSetGen_Next)(rhs->oset)) != 0; )
+ for ( ; (bm2r_ref = VG_(OSetGen_Next)(rhs->oset)) != 0; )
{
+ bm2r = bm2r_ref->bm2;
do
{
- bm2l = VG_(OSetGen_Next)(lhs->oset);
+ bm2l_ref = VG_(OSetGen_Next)(lhs->oset);
+ bm2l = bm2l_ref->bm2;
} while (bm2l->addr < bm2r->addr);
tl_assert(bm2l->addr == bm2r->addr);
@@ -662,18 +679,24 @@
for (;;)
{
- const struct bitmap2* bm2l = VG_(OSetGen_Next)(lhs->oset);
- const struct bitmap2* bm2r = VG_(OSetGen_Next)(rhs->oset);
+ const struct bitmap2ref* bm2l_ref;
+ const struct bitmap2ref* bm2r_ref;
+ const struct bitmap2* bm2l;
+ const struct bitmap2* bm2r;
const struct bitmap1* bm1l;
const struct bitmap1* bm1r;
unsigned k;
+ bm2l_ref = VG_(OSetGen_Next)(lhs->oset);
+ bm2l = bm2l_ref->bm2;
+ bm2r_ref = VG_(OSetGen_Next)(rhs->oset);
+ bm2r = bm2r_ref->bm2;
while (bm2l && bm2r && bm2l->addr != bm2r->addr)
{
if (bm2l->addr < bm2r->addr)
- bm2l = VG_(OSetGen_Next)(lhs->oset);
+ bm2l = (bm2l_ref = VG_(OSetGen_Next)(lhs->oset))->bm2;
else
- bm2r = VG_(OSetGen_Next)(rhs->oset);
+ bm2r = (bm2r_ref = VG_(OSetGen_Next)(rhs->oset))->bm2;
}
if (bm2l == 0 || bm2r == 0)
break;
@@ -705,13 +728,17 @@
void bm_print(const struct bitmap* const bm)
{
struct bitmap2* bm2;
+ struct bitmap2ref* bm2ref;
VG_(OSetGen_ResetIter)(bm->oset);
- for ( ; (bm2 = VG_(OSetGen_Next)(bm->oset)) != 0; )
+ for ( ; (bm2ref = VG_(OSetGen_Next)(bm->oset)) != 0; )
{
- const struct bitmap1* const bm1 = &bm2->bm1;
+ const struct bitmap1* bm1;
unsigned b;
+
+ bm2 = bm2ref->bm2;
+ bm1 = &bm2->bm1;
for (b = 0; b < ADDR0_COUNT; b++)
{
const Addr a = (bm2->addr << ADDR0_BITS) | b;
@@ -738,6 +765,83 @@
return s_bitmap2_creation_count;
}
+/** Allocate memory for a tree node, without initializing the tree node. */
+static void* bm2ref_new(const SizeT size)
+{
+ void* node = VG_(malloc)(size);
+ return node;
+}
+
+/** Deallocate the tree node, decrement the reference count of the second
+ * level bitmap and deallocate the second level bitmap memory if the reference
+ * count reached zero.
+ */
+static void bm2ref_del(void* node)
+{
+ struct bitmap2* bm2;
+ struct bitmap2ref* bm2ref;
+
+ bm2ref = VG_(OSetGen_NodeToElem)(node);
+ tl_assert(bm2ref);
+ bm2 = bm2ref->bm2;
+ tl_assert(bm2->refcnt >= 1);
+ if (--bm2->refcnt == 0)
+ {
+ VG_(free)(bm2);
+ }
+ VG_(free)(node);
+}
+
+/** Allocate and initialize a second level bitmap. */
+static struct bitmap2* bm2_new(const UWord a1)
+{
+ struct bitmap2* bm2;
+
+ bm2 = VG_(malloc)(sizeof(*bm2));
+ bm2->addr = a1;
+ bm2->refcnt = 1;
+
+ s_bitmap2_creation_count++;
+
+ return bm2;
+}
+
+/** Make a copy of a shared second level bitmap such that the copy can be
+ * modified.
+ *
+ * @param a1 client address shifted right by ADDR0_BITS.
+ * @param bm bitmap pointer.
+ */
+static
+struct bitmap2* bm2_make_exclusive(struct bitmap* const bm,
+ struct bitmap2ref* const bm2ref)
+{
+ UWord a1;
+ struct bitmap2* bm2;
+ struct bitmap2* bm2_copy;
+
+ tl_assert(bm);
+ tl_assert(bm2ref);
+ bm2 = bm2ref->bm2;
+ tl_assert(bm2);
+ tl_assert(bm2->refcnt > 1);
+ bm2->refcnt--;
+ tl_assert(bm2->refcnt >= 1);
+ a1 = bm2->addr;
+ bm2_copy = bm2_new(a1);
+ tl_assert(bm2_copy);
+ tl_assert(bm2_copy->addr == a1);
+ tl_assert(bm2_copy->refcnt == 1);
+ VG_(memcpy)(&bm2_copy->bm1, &bm2->bm1, sizeof(bm2->bm1));
+ bm2ref->bm2 = bm2_copy;
+
+ bm->last_lookup_a1 = a1;
+ bm->last_lookup_bm2ref = bm2ref;
+ bm->last_lookup_bm2 = bm2_copy;
+
+ return bm2_copy;
+}
+
static void bm2_merge(struct bitmap2* const bm2l,
const struct bitmap2* const bm2r)
{
@@ -764,7 +868,7 @@
{ 0 + ADDR0_COUNT, 1, eLoad },
{ 666 + ADDR0_COUNT, 4, eLoad },
{ 667 + ADDR0_COUNT, 2, eStore },
- { -1 + 2*ADDR0_COUNT, 1, eStore },
+ { -2 + 2*ADDR0_COUNT, 1, eStore },
{ 0x0001ffffUL, 1, eLoad },
{ 0x0002ffffUL, 1, eLoad },
{ 0x00ffffffUL, 1, eLoad },
Modified: branches/DRDDEV/exp-drd/drd_bitmap.h
===================================================================
--- branches/DRDDEV/exp-drd/drd_bitmap.h 2008-03-23 14:32:21 UTC (rev 7761)
+++ branches/DRDDEV/exp-drd/drd_bitmap.h 2008-03-23 15:47:03 UTC (rev 7762)
@@ -23,8 +23,8 @@
*/
-#ifndef __DRD_BITMAP3_H
-#define __DRD_BITMAP3_H
+#ifndef __DRD_BITMAP_H
+#define __DRD_BITMAP_H
#include "pub_tool_oset.h"
@@ -75,7 +75,7 @@
#define UWORD_HIGHEST_ADDRESS(a) ((a) | (BITS_PER_UWORD - 1))
-/* Local constants. */
+/* Local variables. */
static ULong s_bitmap2_creation_count;
@@ -151,58 +151,154 @@
/*********************************************************************/
+/* Second level bitmap. */
struct bitmap2
{
- Addr addr; ///< address >> ADDR0_BITS
+ Addr addr; ///< address >> ADDR0_BITS
+ int refcnt;
struct bitmap1 bm1;
};
+/* One node of bitmap::oset. */
+struct bitmap2ref
+{
+ Addr addr; ///< address >> ADDR0_BITS
+ struct bitmap2* bm2;
+};
+
/* Complete bitmap. */
struct bitmap
{
- Addr last_lookup_a1;
- struct bitmap2* last_lookup_result;
- OSet* oset;
+ Addr last_lookup_a1;
+ struct bitmap2ref* last_lookup_bm2ref;
+ struct bitmap2* last_lookup_bm2;
+ OSet* oset;
};
-/** Look up the address a1 in bitmap bm.
+
+static struct bitmap2* bm2_new(const UWord a1);
+static struct bitmap2* bm2_make_exclusive(struct bitmap* const bm,
+ struct bitmap2ref* const bm2ref);
+
+
+#if 0
+/** Bitmap invariant check.
+ *
+ * @return 1 if the invariant is satisfied, 0 if not.
+ */
+static __inline__
+int bm_check(const struct bitmap* const bm)
+{
+ tl_assert(bm);
+
+ return (bm->last_lookup_a1 == 0
+ || (VG_(OSetGen_Lookup)(bm->oset, &bm->last_lookup_a1)
+ == bm->last_lookup_bm2ref
+ && bm->last_lookup_bm2ref->bm2
+ && bm->last_lookup_a1 == bm->last_lookup_bm2ref->bm2->addr
+ && bm->last_lookup_bm2ref->bm2->refcnt >= 1)
+ );
+}
+#endif
+
+/** Look up the address a1 in bitmap bm and return a pointer to a potentially
+ * shared second level bitmap. The bitmap where the returned pointer points
+ * at may not be modified by the caller.
+ *
* @param a1 client address shifted right by ADDR0_BITS.
* @param bm bitmap pointer.
*/
static __inline__
-struct bitmap2* bm2_lookup(const struct bitmap* const bm, const UWord a1)
+const struct bitmap2* bm2_lookup(const struct bitmap* const bm, const UWord a1)
{
- struct bitmap2* result;
+ struct bitmap2ref* bm2ref;
+
+ tl_assert(bm);
if (a1 == bm->last_lookup_a1)
{
- return bm->last_lookup_result;
+ return bm->last_lookup_bm2;
}
- result = VG_(OSetGen_Lookup)(bm->oset, &a1);
- if (result)
+ bm2ref = VG_(OSetGen_Lookup)(bm->oset, &a1);
+ if (bm2ref)
{
+ struct bitmap2* const bm2 = bm2ref->bm2;
((struct bitmap*)bm)->last_lookup_a1 = a1;
- ((struct bitmap*)bm)->last_lookup_result = result;
+ ((struct bitmap*)bm)->last_lookup_bm2ref = bm2ref;
+ ((struct bitmap*)bm)->last_lookup_bm2 = bm2;
+ return bm2;
}
- return result;
+ return 0;
}
+/** Look up the address a1 in bitmap bm and return a pointer to a second
+ * level bitmap that is not shared and hence may be modified.
+ *
+ * @param a1 client address shifted right by ADDR0_BITS.
+ * @param bm bitmap pointer.
+ */
static __inline__
+struct bitmap2*
+bm2_lookup_exclusive(const struct bitmap* const bm, const UWord a1)
+{
+ struct bitmap2ref* bm2ref;
+ struct bitmap2* bm2;
+
+ if (bm->last_lookup_a1 == a1)
+ {
+ if (bm->last_lookup_bm2->refcnt == 1)
+ {
+ return bm->last_lookup_bm2;
+ }
+ else
+ {
+ bm2 = bm2_make_exclusive((struct bitmap*)bm, bm->last_lookup_bm2ref);
+ return bm2;
+ }
+ }
+ else
+ {
+ bm2ref = VG_(OSetGen_Lookup)(bm->oset, &a1);
+ if (bm2ref)
+ {
+ bm2 = bm2ref->bm2;
+ if (bm2->refcnt > 1)
+ {
+ bm2 = bm2_make_exclusive((struct bitmap*)bm, bm2ref);
+ }
+ return bm2;
+ }
+ }
+ return 0;
+}
+
+/** Look up the address a1 in bitmap bm. The returned second level bitmap has
+ * reference count one and hence may be modified.
+ *
+ * @param a1 client address shifted right by ADDR0_BITS.
+ * @param bm bitmap pointer.
+ */
+static __inline__
struct bitmap2* bm2_insert(const struct bitmap* const bm, const UWord a1)
{
- struct bitmap2* const bm2 = VG_(OSetGen_AllocNode)(bm->oset, sizeof(*bm2));
- bm2->addr = a1;
+ struct bitmap2ref* bm2ref;
+ struct bitmap2* bm2;
+
+ bm2ref = VG_(OSetGen_AllocNode)(bm->oset, sizeof(*bm2ref));
+ bm2ref->addr = a1;
+ bm2 = bm2_new(a1);
+ bm2ref->bm2 = bm2;
VG_(memset)(&bm2->bm1, 0, sizeof(bm2->bm1));
- VG_(OSetGen_Insert)(bm->oset, bm2);
+ VG_(OSetGen_Insert)(bm->oset, bm2ref);
((struct bitmap*)bm)->last_lookup_a1 = a1;
- ((struct bitmap*)bm)->last_lookup_result = bm2;
-
- s_bitmap2_creation_count++;
-
+ ((struct bitmap*)bm)->last_lookup_bm2ref = bm2ref;
+ ((struct bitmap*)bm)->last_lookup_bm2 = bm2;
+
return bm2;
}
/** Look up the address a1 in bitmap bm, and insert it if not found.
+ * The returned second level bitmap may not be modified.
*
* @param a1 client address shifted right by ADDR0_BITS.
* @param bm bitmap pointer.
@@ -211,22 +307,54 @@
struct bitmap2* bm2_lookup_or_insert(const struct bitmap* const bm,
const UWord a1)
{
+ struct bitmap2ref* bm2ref;
struct bitmap2* bm2;
+ tl_assert(bm);
+ tl_assert(a1);
if (a1 == bm->last_lookup_a1)
{
- return bm->last_lookup_result;
+ return bm->last_lookup_bm2;
}
- bm2 = VG_(OSetGen_Lookup)(bm->oset, &a1);
- if (bm2 == 0)
+ bm2ref = VG_(OSetGen_Lookup)(bm->oset, &a1);
+ if (bm2ref == 0)
{
bm2 = bm2_insert(bm, a1);
}
- ((struct bitmap*)bm)->last_lookup_a1 = a1;
- ((struct bitmap*)bm)->last_lookup_result = bm2;
+ else
+ {
+ bm2 = bm2ref->bm2;
+ ((struct bitmap*)bm)->last_lookup_a1 = a1;
+ ((struct bitmap*)bm)->last_lookup_bm2ref = bm2ref;
+ ((struct bitmap*)bm)->last_lookup_bm2 = bm2;
+ }
return bm2;
}
+/** Look up the address a1 in bitmap bm, and insert it if not found.
+ * The returned second level bitmap may be modified.
+ *
+ * @param a1 client address shifted right by ADDR0_BITS.
+ * @param bm bitmap pointer.
+ */
+static __inline__
+struct bitmap2* bm2_lookup_or_insert_exclusive(struct bitmap* const bm,
+ const UWord a1)
+{
+ struct bitmap2* bm2;
-#endif /* __DRD_BITMAP3_H */
+ tl_assert(bm);
+ bm2 = (struct bitmap2*)bm2_lookup_or_insert(bm, a1);
+ tl_assert(bm2);
+ if (bm2->refcnt > 1)
+ {
+ struct bitmap2ref* bm2ref;
+ bm2ref = VG_(OSetGen_Lookup)(bm->oset, &a1);
+ bm2 = bm2_make_exclusive(bm, bm2ref);
+ }
+ return bm2;
+}
+
+
+#endif /* __DRD_BITMAP_H */
Modified: branches/DRDDEV/exp-drd/pub_drd_bitmap.h
===================================================================
--- branches/DRDDEV/exp-drd/pub_drd_bitmap.h 2008-03-23 14:32:21 UTC (rev 7761)
+++ branches/DRDDEV/exp-drd/pub_drd_bitmap.h 2008-03-23 15:47:03 UTC (rev 7762)
@@ -28,8 +28,8 @@
// segment.
-#ifndef __DRD_BITMAP_H
-#define __DRD_BITMAP_H
+#ifndef __PUB_DRD_BITMAP_H
+#define __PUB_DRD_BITMAP_H
#include "pub_tool_basics.h" /* Addr, SizeT */
@@ -107,6 +107,7 @@
void bm_print(const struct bitmap* bm);
ULong bm_get_bitmap_creation_count(void);
ULong bm_get_bitmap2_creation_count(void);
+void bm_test(void);
-#endif /* __DRD_BITMAP_H */
+#endif /* __PUB_DRD_BITMAP_H */
Modified: branches/DRDDEV/include/pub_tool_oset.h
===================================================================
--- branches/DRDDEV/include/pub_tool_oset.h 2008-03-23 14:32:21 UTC (rev 7761)
+++ branches/DRDDEV/include/pub_tool_oset.h 2008-03-23 15:47:03 UTC (rev 7762)
@@ -187,6 +187,7 @@
extern void VG_(OSetGen_Destroy) ( OSet* os );
extern void* VG_(OSetGen_AllocNode) ( OSet* os, SizeT elemSize );
extern void VG_(OSetGen_FreeNode) ( OSet* os, void* elem );
+extern void* VG_(OSetGen_NodeToElem)( void* node );
/*--------------------------------------------------------------------*/
/*--- Operations on OSets (Gen) ---*/
Modified: branches/DRDDEV/memcheck/tests/oset_test.c
===================================================================
--- branches/DRDDEV/memcheck/tests/oset_test.c 2008-03-23 14:32:21 UTC (rev 7761)
+++ branches/DRDDEV/memcheck/tests/oset_test.c 2008-03-23 15:47:03 UTC (rev 7762)
@@ -28,6 +28,9 @@
#define vgPlain_memset memset
#define vgPlain_memcpy memcpy
+static void* VG_(malloc)( SizeT nbytes ) { return malloc(nbytes); }
+static void VG_(free) ( void* p ) { return free(p); }
+
#include "coregrind/m_oset.c"
#define NN 1000 // Size of OSets being created
|