On Wed, Feb 17, 2010 at 5:28 AM, Oliver Schneider <[email protected]> wrote:
> Hi,
>
> several systems use tagged memory to identify blocks of memory used by
> the same code and similar. What would be the best way of telling
> Valgrind about this custom allocation scheme?

What is the goal in integrating Valgrind with this scheme; that is,
what is not happening now which should be?

> Tagged memory comes in several flavors and in some cases it is important
> to pass the same tag to the counterpart of the allocation function as
> was given at the time of allocation.

How is the tagged memory allocator obtaining the memory?
Is it not bootstrapped from some lower-level allocator which doesn't
know about the tags?

You can write higher level allocators which add additional
meta-data to memory blocks, such that the application cannot
read or write the meta-data (and thus accidentally overwrite
it without detection).

The way to do this is to simply mark the meta-data unreadable
before returning the block of memory to the application, and
only opening/closing access to that meta-data when manipulating
it inside the allocator, using the VALGRIND_MAKE_MEM_DEFINED
and VALGRIND_MAKE_MEM_NOACCESS macros.
Fresh, uninitialized storage returned to the program (which the
program can write, but should not read) is set up using
VALGRIND_MAKE_MEM_UNDEFINED.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to