[Python-Dev] Breaking builds

Tim Peters tim.one@comcast.net
Sun, 21 Apr 2002 22:34:45 -0400


I may or may not have just broken one or more parts of the build for
non-Windows boxes.  Please check it out, especially on Linux.

What changed:  As spelled out before, as part of enabling pymalloc we need
to redirect PyMem_{DEL, Del} to the pymalloc free(), for backward
compatibility of old extension modules.

This creates an internal problem because the parser stuff uses these guys,
but has never included Python.h, and can't "see" the declarations of the
PyObject_XYZ functions in objimpl.h.  Instead, pgenheaders.h has been
growing its own maze of includes and defines.  I scrapped all that, and had
it include Python.h instead, like everything else does.

This all works on Windows, but Windows is Special <wink>.  I at least expect
that using pgen to rebuild the grammar files will need to link in obmalloc.o
on Linux.


Other changes:  When PYMALLOC_DEBUG is defined (it is by default in a debug
build), *all* PyMem_XYZ functions funnel thru the debugging allocator now.
So we get debugging decorations on all allocations then, except for direct
calls to platform malloc/realloc/free.  Note that platform
malloc/realloc/free cannot be mixed with PyMem_XYZ!  compile.c actually did
that once, and it broke (it's fixed).