[Python-Dev] Memory management in the AST parser & compiler (original) (raw)

Jeremy Hylton jeremy at alum.mit.edu
Thu Dec 1 04:36:15 CET 2005


On 11/30/05, Neal Norwitz <nnorwitz at gmail.com> wrote:

On 11/30/05, Thomas Lee <krumms at gmail.com> wrote: > > Quick semi-related question: where are the marshal* functions called? > They're all static in Python-ast.c and don't seem to be actually called > anywhere. Can we ditch them?

I think they are not necessary. My guess is that they were there for marshaling the AST to disk, though I'm not sure why we would want to do that. It could have been there was the idea of how they would be marshalled to PyObjects and exported. Unless you hear otherwise from Jeremy, I would probably remove them. I can check your patch into the branch so others can get an idea and hopefully provide comments.

The intent was to share the AST objects between C and Python by coping them. I still think passing copies is better than sharing live objects between Python and C, although the specific mechanism may be different if the C objects are PyObjects.

Jeremy



More information about the Python-Dev mailing list