Memory management




I've been looking at some of the gnome programs and have been struck
by the vast amount of code thats dedicated to try to keep track of
memory. 

As any thought been given to using a conservative garbage collector or
something similar? (i.e. http://reality.sgi.com/employees/boehm_mti/gc.html) 

This would have the advantage of losing all the code that working out
if X should be free'd, most of the ref-counting code, and remove a fair
quantity of the strdup's (you'd only need to strdup if the original is
mutable).

And of course, you don't get memory leaks any more... 

The down side of the GC is the possible 'pauses' for garbage
collection, but even a 100ms pause every few mins isn't a real
consideration for an interactive program.

Comments?

Michael.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]