On 11/28/05, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> On 11/18/05, Neil Schemenauer <[EMAIL PROTECTED]> wrote:
> > Perhaps we should use the memory management technique that the rest
> > of Python uses: reference counting.  I don't see why the AST
> > structures couldn't be PyObjects.
>
> Me neither. Adding yet another memory allocation scheme to Python's
> already staggering number of memory allocation strategies sounds like
> a bad idea.

The reason this thread started was the complaint that reference
counting in the compiler is really difficult.  Almost every line of
code can lead to an error exit.  The code becomes quite cluttered when
it uses reference counting.  Right now, the AST is created with
malloc/free, but that makes it hard to free the ast at the right time.
 It would be fairly complex to convert the ast nodes to pyobjects. 
They're just simple discriminated unions right now.  If they were
allocated from an arena, the entire arena could be freed when the
compilation pass ends.

Jeremy
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to