> Date: Sun, 11 Nov 2007 19:47:32 -0800> From: [EMAIL PROTECTED]> To: 
> [email protected]> Subject: Re: Still think manual memory 
> management is a good idea? Read this ...> > 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?> What do you think a reference is?  Its a direct pointer.The data 
> structures discussed are caches.  If you bump it, you drop it from the cache, 
> and if its later requested you go to disk or to the net to grab it instead.  
> A browser is semi-unique in that almost all of its memory is used in caches.  
> Only the current webpage really must be resident in memory.> > > 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).> No, I described a cache with a pool based memory.  Its far, far from a 
> garbage collector. Gabe
_________________________________________________________________
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to