]> granicus.if.org Git - python/commitdiff
Use PyObject_* allocator since FutureFeatures is small
authorNeal Norwitz <nnorwitz@gmail.com>
Mon, 10 Apr 2006 06:57:06 +0000 (06:57 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Mon, 10 Apr 2006 06:57:06 +0000 (06:57 +0000)
Python/compile.c
Python/future.c

index ae4c8503f008a951227bb219532852445f29a4d8..6c8ec53d6ac1b7f2545475357f0e11d4e58d0a08 100644 (file)
@@ -314,7 +314,7 @@ compiler_free(struct compiler *c)
        if (c->c_st)
                PySymtable_Free(c->c_st);
        if (c->c_future)
-               PyMem_Free(c->c_future);
+               PyObject_Free(c->c_future);
        Py_DECREF(c->c_stack);
 }
 
index d22ed3461cff7aa64241f3ab3c7253f0ecb7422d..04fec22fd8c0f0c68e2357458910166abb918290 100644 (file)
@@ -120,14 +120,14 @@ PyFuture_FromAST(mod_ty mod, const char *filename)
 {
        PyFutureFeatures *ff;
 
-       ff = (PyFutureFeatures *)PyMem_Malloc(sizeof(PyFutureFeatures));
+       ff = (PyFutureFeatures *)PyObject_Malloc(sizeof(PyFutureFeatures));
        if (ff == NULL)
                return NULL;
        ff->ff_features = 0;
        ff->ff_lineno = -1;
 
        if (!future_parse(ff, mod, filename)) {
-               PyMem_Free((void *)ff);
+               PyObject_Free(ff);
                return NULL;
        }
        return ff;