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

Nick Coghlan ncoghlan at gmail.com
Thu Dec 1 09:48:43 CET 2005


Martin v. Löwis wrote:
> Nick Coghlan wrote:
>  > The ast C structs are already auto-generated by a Python script 
> (asdl_c.py, to
>  > be precise). The trick is to make that script generate full PyObjects 
> rather
>  > than the simple C structures that it generates now.
> 
> See the ast-object branch.

Thanks Martin.

>  > The second step is to then modify ast.c to use the new structures. A 
> branch
>  > probably wouldn't help much with initial development (this is a 
> "break the
>  > world, check in when stuff compiles again" kind of change, which is 
> hard to
>  > split amongst multiple people), but I think it would be of benefit when
>  > reviewing the change before moving it back to the trunk.
> 
> Well, there would be a clear two-split right now: one could change
> ast.c, and the other compile.c.

I was focusing too much on the AST production end, and managed to forget that 
compile.c and symtable.c are consumers of the AST, so they'll likely care 
about the change as well ;)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-Dev mailing list