PyMem_Realloc corner case
1 Mar
2002
1 Mar
'02
9:15 a.m.
I just got bit by the following: On Windows, PyMem_Realloc() doesn't seem to work as advertised in http://www.python.org/doc/current/api/memoryInterface.html In particular, "if n is equal to zero, the memory block is resized but is not freed, and the returned pointer is non-NULL". In Objects/object.c, lines 1878-1896, PyMem_Malloc() and PyMem_Realloc() seem to try to guarantee this behavior. Somehow it isn't working for me. Does this mean MALLOC_ZERO_RETURNS_NULL should be defined in PC/pyconfig.h? Or do I have an off version of the CRT that causes problems nobody else has <sigh>? ## Jason Orendorff http://www.jorendorff.com/
8070
Age (days ago)
8083
Last active (days ago)
3 comments
2 participants
participants (2)
-
Jason Orendorff
-
Tim Peters