How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

jacko jackokring at gmail.com
Mon Aug 16 10:59:40 EDT 2010


> is it possible to convert any and all algorithms to stack based ones and thus avoid memory leaks?

No, not really. If you keep the allocated things and free them in
reverse order on exit, then well yes, but practically, early free()
frees memory for reuse on low memory systems. In this sense not
'reversed' out of order free is essential in some contexts.

The question then becomes what is the best heap fragmentation/
compaction strategy and what is the best allocation algorithm to
allocate addresses?



More information about the Python-list mailing list