summaryrefslogtreecommitdiff
path: root/Include/objimpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/objimpl.h')
-rw-r--r--Include/objimpl.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/Include/objimpl.h b/Include/objimpl.h
index a8ce3cb0ed..cb27c7c5e6 100644
--- a/Include/objimpl.h
+++ b/Include/objimpl.h
@@ -34,7 +34,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
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 object are *undefined*! The resulting expression type is 'type *'.
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
}