Memcheck: a memory error detector
•
VALGRIND_MEMPOOL_ALLOC(pool, addr, size)
: This request informs Memcheck that a
size
-byte
chunk has been allocated at
addr
, and associates the chunk with the specified
pool
. If the pool was created
with nonzero
rzB
redzones, Memcheck will mark the
rzB
bytes before and after the chunk as NOACCESS. If
the pool was created with the
is_zeroed
argument set, Memcheck will mark the chunk as DEFINED, otherwise
Memcheck will mark the chunk as UNDEFINED.
•
VALGRIND_MEMPOOL_FREE(pool, addr)
: This request informs Memcheck that the chunk at
addr
should
no longer be considered allocated. Memcheck will mark the chunk associated with
addr
as NOACCESS, and
delete its record of the chunk’s existence.
•
VALGRIND_MEMPOOL_TRIM(pool, addr, size)
: This request trims the chunks associated with
pool
.
The request only operates on chunks associated with
pool
. Trimming is formally defined as:
• All chunks entirely inside the range
addr..(addr+size-1)
are preserved.
• All
chunks
entirely
outside
the
range
addr..(addr+size-1)
are
discarded,
as
though
VALGRIND_MEMPOOL_FREE
was called on them.
• All other chunks must intersect with the range
addr..(addr+size-1)
; areas outside the intersection are
marked as NOACCESS, as though they had been independently freed with
VALGRIND_MEMPOOL_FREE
.
This is a somewhat rare request, but can be useful in implementing the type of mass-free operations common in
custom LIFO allocators.
•
VALGRIND_MOVE_MEMPOOL(poolA, poolB)
: This request informs Memcheck that the pool previously
anchored at address
poolA
has moved to anchor address
poolB
. This is a rare request, typically only needed
if you
realloc
the header of a mempool.
No memory-status bits are altered by this request.
•
VALGRIND_MEMPOOL_CHANGE(pool, addrA, addrB, size)
: This request informs Memcheck that the
chunk previously allocated at address
addrA
within
pool
has been moved and/or resized, and should be changed
to cover the region
addrB..(addrB+size-1)
. This is a rare request, typically only needed if you
realloc
a
superblock or wish to extend a chunk without changing its memory-status bits.
No memory-status bits are altered by this request.
•
VALGRIND_MEMPOOL_EXISTS(pool)
: This request informs the caller whether or not Memcheck is currently
tracking a mempool at anchor address
pool
. It evaluates to 1 when there is a mempool associated with that address,
0 otherwise. This is a rare request, only useful in circumstances when client code might have lost track of the set of
active mempools.
71
Содержание BBV
Страница 176: ...Valgrind FAQ Release 3 8 0 10 August 2012 Copyright 2000 2012 Valgrind Developers Email valgrind valgrind org ...
Страница 177: ...Valgrind FAQ Table of Contents Valgrind Frequently Asked Questions 1 ii ...
Страница 302: ...README mips based on newer GCC versions if possible 95 ...
Страница 303: ...GNU Licenses ...
Страница 304: ...GNU Licenses Table of Contents 1 The GNU General Public License 1 2 The GNU Free Documentation License 8 ii ...