diff Include/objimpl.h @ 2129:05360cd616ae legacy-trunk

The great renaming, phase two: all header files have been updated to use the new names exclusively, and the linker will see the new names. Files that import "Python.h" also only see the new names. Files that import "allobjects.h" will continue to be able to use the old names, due to the inclusion (in allobjects.h) of "rename2.h".
author Guido van Rossum <guido@python.org>
date Thu, 12 Jan 1995 11:45:45 +0000
parents 508036dbba3b
children 65a68c51e9f2
line wrap: on
line diff
--- a/Include/objimpl.h	Thu Jan 12 11:37:57 1995 +0000
+++ b/Include/objimpl.h	Thu Jan 12 11:45:45 1995 +0000
@@ -34,7 +34,7 @@
 Additional macros for modules that implement new object types.
 You must first include "object.h".
 
-NEWOBJ(type, typeobj) allocates memory for a new object of the given
+PyObject_NEW(type, typeobj) allocates memory for a new object of the given
 type; here 'type' must be the C structure type used to represent the
 object and 'typeobj' the address of the corresponding type object.
 Reference count and type pointer are filled in; the rest of the bytes of
@@ -42,16 +42,16 @@
 The size of the object is actually determined by the tp_basicsize field
 of the type object.
 
-NEWVAROBJ(type, typeobj, n) is similar but allocates a variable-size
-object with n extra items.  The size is computer as tp_basicsize plus
+PyObject_NEW_VAR(type, typeobj, n) is similar but allocates a variable-size
+object with n extra items.  The size is computed as tp_basicsize plus
 n * tp_itemsize.  This fills in the ob_size field as well.
 */
 
-extern object *newobject PROTO((typeobject *));
-extern varobject *newvarobject PROTO((typeobject *, unsigned int));
+extern PyObject *_PyObject_New Py_PROTO((PyTypeObject *));
+extern varobject *_PyObject_NewVar Py_PROTO((PyTypeObject *, unsigned int));
 
-#define NEWOBJ(type, typeobj) ((type *) newobject(typeobj))
-#define NEWVAROBJ(type, typeobj, n) ((type *) newvarobject(typeobj, n))
+#define PyObject_NEW(type, typeobj) ((type *) _PyObject_New(typeobj))
+#define PyObject_NEW_VAR(type, typeobj, n) ((type *) _PyObject_NewVar(typeobj, n))
 
 #ifdef __cplusplus
 }