Valgrind and Python

Jack Diederich jack at performancedrivers.com
Wed May 28 08:12:45 EDT 2003


On Wed, May 28, 2003 at 12:01:24PM +0100, Graeme Winter wrote:
> Hello Everyone,
> 
> Does anyone know of a simple way to instrument the Python code to allow 
> the use of Valgrind? I would like to perform a memory check on my 
> extension which uses the python memory allocation, and I guess that I am 
> not the first to want to do something like this.
> 
> I expect that I will also have to change the compilation so that the 
> Python allocation won't do anything clever.

An easy low tech solution I've used is to make a special build that #defines
allocations to use the normal system malloc/free and compile the extension
with electric fence (similar purpose to valgrind).

-jackdied





More information about the Python-list mailing list