diff options
author | sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2006-10-05 17:59:23 +0000 |
---|---|---|
committer | sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2006-10-05 17:59:23 +0000 |
commit | c740d7660ad140b79e561e0d578ab8435a5a5289 (patch) | |
tree | 46d58446eae00adfa1450c536fee6f43b0a6fded /memcheck/mc_main.c | |
parent | ce10c26db13a44c39061f1dadd6725de56d31491 (diff) |
A memory pool update from Graydon Hoare.
Here's an update to the mempool move / change client requests and sanity
checking. The following changes are present:
- Added one more (hopefully last) client request, a predicate to
test whether a mempool anchor address is currently tracked.
It turns out mozilla's arena-using code is sufficiently inconsistent
in its assumptions that it's very difficult to phrase the valgrind
client-request annotations without this request. Namely: sometime
arena-init and arena-free operations are assumed to be idempotent.
- Fixed a very rapid tool-memory leak in the mempool sanity check
routine. The previous version of the patch I posted would use all
memory even on my Very Beefy Test Machine within ~15 minutes of
browsing with firefox.
- Added a little logging code to print the counts of pools and chunks
active every ~10000 sanity checks, when running with -v.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6197 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'memcheck/mc_main.c')
-rw-r--r-- | memcheck/mc_main.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index 98052484..9495bc1c 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -4064,7 +4064,10 @@ static Bool mc_handle_client_request ( ThreadId tid, UWord* arg, UWord* ret ) && VG_USERREQ__DESTROY_MEMPOOL != arg[0] && VG_USERREQ__MEMPOOL_ALLOC != arg[0] && VG_USERREQ__MEMPOOL_FREE != arg[0] - && VG_USERREQ__MEMPOOL_TRIM != arg[0]) + && VG_USERREQ__MEMPOOL_TRIM != arg[0] + && VG_USERREQ__MOVE_MEMPOOL != arg[0] + && VG_USERREQ__MEMPOOL_CHANGE != arg[0] + && VG_USERREQ__MEMPOOL_EXISTS != arg[0]) return False; switch (arg[0]) { @@ -4239,6 +4242,32 @@ static Bool mc_handle_client_request ( ThreadId tid, UWord* arg, UWord* ret ) return True; } + case VG_USERREQ__MOVE_MEMPOOL: { + Addr poolA = (Addr)arg[1]; + Addr poolB = (Addr)arg[2]; + + MC_(move_mempool) ( poolA, poolB ); + return True; + } + + case VG_USERREQ__MEMPOOL_CHANGE: { + Addr pool = (Addr)arg[1]; + Addr addrA = (Addr)arg[2]; + Addr addrB = (Addr)arg[3]; + UInt size = arg[4]; + + MC_(mempool_change) ( pool, addrA, addrB, size ); + return True; + } + + case VG_USERREQ__MEMPOOL_EXISTS: { + Addr pool = (Addr)arg[1]; + + *ret = (UWord) MC_(mempool_exists) ( pool ); + return True; + } + + default: VG_(message)(Vg_UserMsg, "Warning: unknown memcheck client request code %llx", |