debugging tip - valgrind friendly python

James Henstridge james at
Thu Dec 3 01:18:51 GMT 2009

On Thu, Dec 3, 2009 at 2:11 AM, Marius Gedminas <marius at> wrote:
> On Wed, Dec 02, 2009 at 07:27:00PM +0800, James Henstridge wrote:
>> On Wed, Dec 2, 2009 at 1:36 PM, Alexander Belchenko <bialix at> wrote:
>> > Robert Collins пишет:
>> >>
>> >>
>> >> these packages have pymalloc disabled, so valgrind gets a more accurate
>> >> picture of whats happening.
> ...
>> The packages in my PPA include a patch that gets the interpreter to
>> detect whether it is running under valgrind or not.  If it is, then
>> the pymalloc allocator is disabled, with PyObject_Malloc/PyObject_Free
>> passing through to normal malloc/free, which valgrind knows how to
>> track.
> What's the runtime impact when running not under valgrind?

I wrote the patch a while back, but can't find the numbers I produced
back then.  The patch is designed to have as low an impact as possible
on the non-valgrind case as possible though.

> Any chances for getting that patch upstream?

The patch has been sitting in the Python bug tracker without
attracting much attention, so I don't know:


More information about the bazaar mailing list