Skip to content

Commit aa1881f

Browse files
author
neal.norwitz
committed
Use PyObject_* allocator since FutureFeatures is small
git-svn-id: http://svn.python.org/projects/python/trunk@45226 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 1b82d67 commit aa1881f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Python/compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ compiler_free(struct compiler *c)
314314
if (c->c_st)
315315
PySymtable_Free(c->c_st);
316316
if (c->c_future)
317-
PyMem_Free(c->c_future);
317+
PyObject_Free(c->c_future);
318318
Py_DECREF(c->c_stack);
319319
}
320320

Python/future.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ PyFuture_FromAST(mod_ty mod, const char *filename)
120120
{
121121
PyFutureFeatures *ff;
122122

123-
ff = (PyFutureFeatures *)PyMem_Malloc(sizeof(PyFutureFeatures));
123+
ff = (PyFutureFeatures *)PyObject_Malloc(sizeof(PyFutureFeatures));
124124
if (ff == NULL)
125125
return NULL;
126126
ff->ff_features = 0;
127127
ff->ff_lineno = -1;
128128

129129
if (!future_parse(ff, mod, filename)) {
130-
PyMem_Free((void *)ff);
130+
PyObject_Free(ff);
131131
return NULL;
132132
}
133133
return ff;

0 commit comments

Comments
 (0)