Andrew Lentvorski wrote: > Gabriel Sechan wrote: >> The real problem is >> doing a rather braindead allocation method- always calling malloc to >> get a new block, rather than giving each data type a pool to allocate >> from. Decide on a max size for each cache, allocate it at startup, >> and allocate from the correct pool. You can even be truely evil and >> do it automagically by overriding the new keyword. There you do- no >> more out of control memory issues. When a single cache runs out of >> memory, you bump old stuff from it to free up memory. > > Umm, how do you "bump old stuff" when everything is referenced by > direct pointers, pray tell? Yes, this is a fairly compelling argument against direct pointers, although it would be better if there was an alternative implementation using indirect pointers to compare against (Jazilla would not be a good one). Of course, there is no need to use direct pointers in anything other than C, and even in C, we've had at least two decades worth of platforms with indirect memory references. > Do you think the Firefox guys would just write a periodic defragmenter > if it was that easy? The Firefox guys already have written a garbage collector. A periodic defragmenter is, by comparison, trivial. Of course, converting over all your code from making direct references to indirect references... that takes time. > I ask this in all seriousness: what do you think a garbage collection > is and does? Actually, garbage collection doesn't specify that the memory is relocatable, nor does lack of garbage collection mean that memory isn't relocatable.
--Chris -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
