[Python-Dev] head crashing
Kristján Valur Jónsson
kristjan at ccpgames.com
Wed May 2 12:00:15 CEST 2007
> -----Original Message-----
> From: skip at pobox.com [mailto:skip at pobox.com]
> Sent: Tuesday, May 01, 2007 20:46
> But then you would substantially change the memory access behavior of
> program in a debug build, that is, more than it is already changed by
> fact that you have changed the memory layout of Python objects.
Well, as we say in Iceland, that is a piece difference, not the whole
sheep. In fact, most of the memory is already managed by the Object
allocator, so there is only slight additional change.
Further, at least one platform (windows) already employs a different
memory allocator implementation for malloc in debug builds, namely a
debug allocator. In addition, many python structures grow extra
members in debug builds, most notably the PyObject _head. So you
probably never have the exactly same blocksize pattern anyway.
At any rate, the debug memory only changes memory access patterns
by growing every block by a fixed amount.
And why do we want to keep the same memory pattern? Isn't the
memory allocator supposed to be a black box?
The only reason I can see for maintaining the exact same pattern
in a debug build is to reproduce some sort of memory access error, but
that is precisely what the debug routines are for.
Admittedly, I have never used the debug routines much. generally disable
the object allocator for debug builds, and rely on the windows debug
malloc implementation to spot errors for me, or failing that, I use
Rational Purify, which costs money.
More information about the Python-Dev