[snake-farm] Re: [Python-Dev] Snake farm (original) (raw)

Tim Peters tim.one@comcast.net
Mon, 11 Nov 2002 10:47:55 -0500


[Martin v. Loewis]

... Now, the question is: where does that pointer come from? This should be from funcobject.c:457, which says

k = PyMemNEW(PyObject , 2nk); Unless I'm mistaken, this expands to malloc().

Which version of Python is getting built here?

In 2.3, PyMem_NEW resolves to malloc() in a release build, but not a debug build (in a debug build, all Python memory API calls go through pymalloc). This may be vaguely relevant, since Marc said

This doesn't happen if either --without-pymalloc or --with-pydebug
is given.

In the former case (--without-pymalloc) pymalloc isn't used at all; in the latter case (--with-pydebug) pymalloc is always used. In 2.3. Since I saw a

/opt/local/python/lib/python2.3/config/install-sh
                      ^^^^^^^^^

flash by, I figure that's right for this build.