[Python-Dev] Forbidden names & obmalloc.c

Tim Peters tim.one@home.com
Sun, 11 Mar 2001 14:14:28 -0500


In std C, all identifiers that begin with an underscore and are followed by
an underscore or uppercase letter are reserved for the platform C
implementation.  obmalloc.c violates this rule all over the place, spilling
over into objimpl.h's use of _PyCore_ObjectMalloc. _PyCore_ObjectRealloc, and
_PyCore_ObjectFree.  The leading "_Py" there *probably* leaves them safe
despite being forbidden, but things like obmalloc.c's _SYSTEM_MALLOC and
_SET_HOOKS are going to bite us sooner or later (hard to say, but they may
have already, in bug #407680).

I renamed a few of the offending vrbl names, but I don't understand the
intent of the multiple layers of macros in this subsystem.  If anyone else
believes they do, please rename these suckers before the bad names get out
into the world and we have to break user code to repair eventual conflicts
with platforms' uses of these (reserved!) names.