[Python-Dev] Moving forward on the object memory API (original) (raw)

Guido van Rossum guido@python.org
Sun, 31 Mar 2002 17:23:40 -0500


> We deprecate the PyMem* functions. There's no need for them, IMHO:

-1. The rationale behind the function spellings is, as Tim explains, cross-version compatibility.

Also, I believe there once was an issue on Windows where a DLL shouldn't call its own malloc, it should call Python's malloc (even if they're both the system malloc!) for memory that Python might free, and conversely it should call Python's free for memory that Python has allocated, because the DLL might be using a different heap than the Python core. Wrapper functions defined by the core that call the core's malloc/realloc/free are the only solution here.

I'm not sure if this is still an issue; I'm not even really sure it was ever an issue; I recall learning this from reading the Tcl/Tk sources.

Do we need to bump the API version after these changes?

Probably.

--Guido van Rossum (home page: http://www.python.org/~guido/)