diff options
author | Guido van Rossum <guido@python.org> | 2000-05-03 23:44:39 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-05-03 23:44:39 (GMT) |
commit | b18618dab7b6b85bb05b084693706e59211fa180 (patch) | |
tree | 785d51f6677da8366be2ad4b4296a62f53161276 /Modules/parsermodule.c | |
parent | 2808b744e8d94459f189e1d89c97072d6a1f53b6 (diff) | |
download | cpython-b18618dab7b6b85bb05b084693706e59211fa180.zip cpython-b18618dab7b6b85bb05b084693706e59211fa180.tar.gz cpython-b18618dab7b6b85bb05b084693706e59211fa180.tar.bz2 |
Vladimir Marangozov's long-awaited malloc restructuring.
For more comments, read the patches@python.org archives.
For documentation read the comments in mymalloc.h and objimpl.h.
(This is not exactly what Vladimir posted to the patches list; I've
made a few changes, and Vladimir sent me a fix in private email for a
problem that only occurs in debug mode. I'm also holding back on his
change to main.c, which seems unnecessary to me.)
Diffstat (limited to 'Modules/parsermodule.c')
-rw-r--r-- | Modules/parsermodule.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index 6a8d38c..9b9baf0 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -295,7 +295,7 @@ parser_compare(PyAST_Object *left, PyAST_Object *right) static PyObject* parser_newastobject(node *ast, int type) { - PyAST_Object* o = PyObject_NEW(PyAST_Object, &PyAST_Type); + PyAST_Object* o = PyObject_New(PyAST_Object, &PyAST_Type); if (o != 0) { o->ast_node = ast; @@ -317,7 +317,7 @@ static void parser_free(PyAST_Object *ast) { PyNode_Free(ast->ast_node); - PyMem_DEL(ast); + PyObject_Del(ast); } @@ -790,10 +790,10 @@ build_node_children(PyObject *tuple, node *root, int *line_num) PyObject *temp = PySequence_GetItem(elem, 1); /* check_terminal_tuple() already verified it's a string */ - strn = (char *)malloc(PyString_GET_SIZE(temp) + 1); + strn = (char *)PyMem_MALLOC(PyString_GET_SIZE(temp) + 1); if (strn != NULL) (void) strcpy(strn, PyString_AS_STRING(temp)); - Py_XDECREF(temp); + Py_DECREF(temp); if (PyObject_Length(elem) == 3) { PyObject* temp = PySequence_GetItem(elem, 2); |