summaryrefslogtreecommitdiff
path: root/Modules/parsermodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-05-03 23:44:39 +0000
committerGuido van Rossum <guido@python.org>2000-05-03 23:44:39 +0000
commit2ad49d47ba5cf6a6c84baef80143cb2ab354744e (patch)
treeefae1e8b4dd63a06425818661fc2dbc74824d50c /Modules/parsermodule.c
parentcb711cb64b882076d5e77c147b164eec755fcf2c (diff)
downloadcpython-2ad49d47ba5cf6a6c84baef80143cb2ab354744e.tar.gz
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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c
index 6a8d38c0e0..9b9baf0cea 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);