> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 01, 2007 20:46
> But then you would substantially change the memory access behavior of
> the
> program in a debug build, that is, more than it is already changed by
> the
> 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.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to