On 11/28/05, Guido van Rossum <guido at python.org> wrote: > On 11/18/05, Neil Schemenauer <nas at arctrix.com> 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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4