summaryrefslogtreecommitdiffstats
path: root/Objects/complexobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/complexobject.c')
-rw-r--r--Objects/complexobject.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 0564942..42709ee 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -166,13 +166,14 @@ PyObject *
PyComplex_FromCComplex(cval)
Py_complex cval;
{
- register PyComplexObject *op =
- (PyComplexObject *) malloc(sizeof(PyComplexObject));
+ register PyComplexObject *op;
+
+ /* PyObject_New is inlined */
+ op = (PyComplexObject *) PyObject_MALLOC(sizeof(PyComplexObject));
if (op == NULL)
return PyErr_NoMemory();
- op->ob_type = &PyComplex_Type;
+ PyObject_INIT(op, &PyComplex_Type);
op->cval = cval;
- _Py_NewReference((PyObject *)op);
return (PyObject *) op;
}
@@ -226,7 +227,7 @@ static void
complex_dealloc(op)
PyObject *op;
{
- PyMem_DEL(op);
+ PyObject_DEL(op);
}