PyMem_MALLOC (was [Python-Dev] Snake farm)

Marc Recht marc@informatik.uni-bremen.de
Fri, 22 Nov 2002 17:35:55 +0100


> This can be solved (as MAL suggested) by fixing configure so that
> malloc(0) returning 0x800 is treated the same as malloc(0) returning
> NULL.  That way, pymalloc's free code doesn't have to special-case
> this.
What about changing
PyMem_MALLOC malloc
to
#define PyMem_MALLOC(n)     n ? malloc(n) : NULL

Regards,
Marc