Kaydet (Commit) 14bc4e4d authored tarafından Neal Norwitz's avatar Neal Norwitz

Use PyObject_* allocator since FutureFeatures is small

üst 2c4e4f98
...@@ -314,7 +314,7 @@ compiler_free(struct compiler *c) ...@@ -314,7 +314,7 @@ compiler_free(struct compiler *c)
if (c->c_st) if (c->c_st)
PySymtable_Free(c->c_st); PySymtable_Free(c->c_st);
if (c->c_future) if (c->c_future)
PyMem_Free(c->c_future); PyObject_Free(c->c_future);
Py_DECREF(c->c_stack); Py_DECREF(c->c_stack);
} }
......
...@@ -120,14 +120,14 @@ PyFuture_FromAST(mod_ty mod, const char *filename) ...@@ -120,14 +120,14 @@ PyFuture_FromAST(mod_ty mod, const char *filename)
{ {
PyFutureFeatures *ff; PyFutureFeatures *ff;
ff = (PyFutureFeatures *)PyMem_Malloc(sizeof(PyFutureFeatures)); ff = (PyFutureFeatures *)PyObject_Malloc(sizeof(PyFutureFeatures));
if (ff == NULL) if (ff == NULL)
return NULL; return NULL;
ff->ff_features = 0; ff->ff_features = 0;
ff->ff_lineno = -1; ff->ff_lineno = -1;
if (!future_parse(ff, mod, filename)) { if (!future_parse(ff, mod, filename)) {
PyMem_Free((void *)ff); PyObject_Free(ff);
return NULL; return NULL;
} }
return ff; return ff;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment