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?
Do you think the Firefox guys would just write a periodic defragmenter if it was that easy?
Only if that doesn't work do you malloc a bigger cache.
Are you reading what you write? You just described a "stop-and-copy garbage collector" (albeit a primitive one).
I ask this in all seriousness: what do you think a garbage collection is and does?
-a -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
