Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a3fd07d5
Commit
a3fd07d5
authored
Nov 16, 2005
by
Neal Norwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add more doc
parent
dee2fd54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
Python/ast.c
Python/ast.c
+22
-1
No files found.
Python/ast.c
View file @
a3fd07d5
...
...
@@ -34,11 +34,32 @@
for (i = 0; i < asdl_seq_LEN(seq); i++)
free_***(asdl_seq_GET(seq, i));
asdl_seq_free(seq);
asdl_seq_free(seq);
/ * ok * /
Almost all of the ast functions return a seq of expr, so you should
use asdl_expr_seq_free(). The exception is ast_for_suite() which
returns a seq of stmt's, so use asdl_stmt_seq_free() to free it.
If asdl_seq_free is appropriate, you should mark it with an ok comment.
There are still many memory problems in this file even though
it runs clean in valgrind, save one problem that may have existed
before the AST.
Any code which does something like this:
return ASTconstruct(local, LINENO(n));
will leak memory. The problem is if ASTconstruct (e.g., TryFinally)
cannot allocate memory, local will be leaked.
There was discussion on python-dev to replace the entire allocation
scheme in this file with arenas. Basically rather than allocate
memory in little blocks with malloc(), we allocate one big honking
hunk and deref everything into this block. We would still need
another block or technique to handle the PyObject*s.
http://mail.python.org/pipermail/python-dev/2005-November/058138.html
*/
/* Data structure used internally */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment