[Python-Dev] Memory management in the AST parser & compiler

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Nov 29 23:15:16 CET 2005

Neal Norwitz wrote:

> For those watching, Greg's and Martin's version were almost the same. 
> However, Greg's version left in the memory leak, while Martin fixed it
> by letting the result fall through.

I addressed the memory leak by stipulating that FunctionDef
should steal references to its arguments (whether it
succeeds or not).

However, while that trick works in this particular case, it
wouldn't be so helpful in more complicated situations, so
Martin's version is probably a better model to follow.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+

More information about the Python-Dev mailing list