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

Thomas Lee krumms at gmail.com
Wed Nov 23 09:44:27 CET 2005


Neil Schemenauer wrote:

>Fredrik Lundh <fredrik at pythonware.com> wrote:
>  
>
>>Thomas Lee wrote:
>>
>>    
>>
>>>Even if it meant we had just one function call - one, safe function call
>>>that deallocated all the memory allocated within a function - that we
>>>had to put before each and every return, that's better than what we
>>>have.
>>>      
>>>
>>alloca?
>>    
>>
>
>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.
>
>  Neil
>
>  
>
I'm +1 for reference counting. It's going to be a little error prone 
initially (certainly much less error prone than the current system in 
the long run), but the pooling/arena idea is going to screw with all 
sorts of stuff within the AST and possibly in bits of Python/compile.c 
too. At least, all my attempts wound up looking that way :)

Cheers,
Tom

>_______________________________________________
>Python-Dev mailing list
>Python-Dev at python.org
>http://mail.python.org/mailman/listinfo/python-dev
>Unsubscribe: http://mail.python.org/mailman/options/python-dev/krumms%40gmail.com
>
>  
>



More information about the Python-Dev mailing list