[Python-Dev] Malloc interfaced

Greg Stein gstein@lyra.org
Mon, 14 Feb 2000 03:48:41 -0800 (PST)


On Mon, 14 Feb 2000, Vladimir Marangozov wrote:
>...
> Agreed. So the concrete proposal is this, right?
> 
> (mymalloc.h)
> 
> ...
> #define PyMem_FREE(p)	free((ANY *)p)

Small nit:
  #define PyMem_FREE(p)	free((ANY *)(p))

(yes, the "bug" exists in 1.5.2, too)

> ...
> 
> #define PyMem_DEL(p)	PyMem_FREE(p)
> #define PyMem_XDEL(p)	PyMem_FREE(p)  /* obsolete */

Both of these would be obsolete.

Note that the PyMem_NEW/RESIZE/FREE macros are intended for internal use
by Python only. (move to a private header?)

Py_Malloc and friends, and PyMem_Malloc and friends are to be used by C
extensions (or embeddors).

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/