Add a mempool-trimming client request (Graydon Hoare).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5992 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/include/valgrind.h b/include/valgrind.h
index a0dce03..266e03f 100644
--- a/include/valgrind.h
+++ b/include/valgrind.h
@@ -2288,6 +2288,7 @@
VG_USERREQ__DESTROY_MEMPOOL = 0x1304,
VG_USERREQ__MEMPOOL_ALLOC = 0x1305,
VG_USERREQ__MEMPOOL_FREE = 0x1306,
+ VG_USERREQ__MEMPOOL_TRIM = 0x1307,
/* Allow printfs to valgrind log. */
VG_USERREQ__PRINTF = 0x1401,
@@ -2499,6 +2500,14 @@
pool, addr, 0, 0, 0); \
}
+/* Disassociate any pieces outside a particular range. */
+#define VALGRIND_MEMPOOL_TRIM(pool, addr, size) \
+ {unsigned int _qzz_res; \
+ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
+ VG_USERREQ__MEMPOOL_TRIM, \
+ pool, addr, size, 0, 0); \
+ }
+
/* Mark a piece of memory as being a stack. Returns a stack id. */
#define VALGRIND_STACK_REGISTER(start, end) \
({unsigned int _qzz_res; \