On 18 Feb 2010, at 10:42, Richard Frith-Macdonald wrote: > I think zones *are* somewhat useless... > > There are a *lot* of cases where OSX Foundation does not honor them.
Well, they are on OS X, but I thought they were a bit more useful on GNUstep... > They are unused when garbage collecting is enabled anyway. With OS X, yes. GCKit is designed to support them. > Also, I strongly suspect that modern computer cache designs mean that the > supposed benefit of zones (being able to allocate a group of objects close > together in physical memory) has mostly been a fiction for many years now. Bump-the-pointer allocation is still faster than malloc(), but there are lots of other fun things you can do with zones. For example, I had some proof-of-concept code a little while ago that dumped a list of all of the classes to a file and then used mmap() to allocate a persistent region of memory. Objects allocated in this zone persisted between program invocations automatically (there was some fixup code that would correct the isa pointers when you re-mapped the region) as long as they didn't refer to any objects in other zones. You can also use them for per-thread memory pools, to avoid locking when allocating or freeing memory, although some malloc() implementations will do this automatically. David -- Sent from my Cray X1 _______________________________________________ Gnustep-dev mailing list [email protected] http://lists.gnu.org/mailman/listinfo/gnustep-dev
