Memory Management

Gfront uses standard Objectice-C manual memory management, no reference counting, no garbage collection. Given that execution is short lived and covers only a single file, most of the allocated data -- the AST and Synthesized Types -- is immortal.

The AST is a simple tree, so freeing subtrees should be straightforward and should be done when we perform some of the AST transformations. The synthesized tipes are not a tree with may expressions having references to the same type. The only reasonable types of memory managment for the types would be garbage collection or reference counting (could be manual). Fortunately, the types are immortal and thus need not be freed.

The wrapper script, gfront.sh, provides an option to run the binary under valgrind showing memory usage information. It should be noted that there are some "memory leaks" in the GNU objective-C runtime. Some of these are related to the class descriptor modifications that occur when loading categories. Old descriptors hang around in case another thread be using them, obviating the need for synchronization on each access. Or so I've read, anway.


Generated on Mon Dec 24 06:11:58 2007 for gfront by  doxygen 1.5.2