27 ms·
I think we might be thinking about the same time period, 4 or 5 years ago. CoreFoundation had something vaguely resembling garbage collection introduced in 10.
by Zev 16y ago
I think we might be thinking about the same time period, 4 or 5 years ago.
CoreFoundation had something vaguely resembling garbage collection introduced in 10.4, with CFMakeCollectable[1]. I've always thought of that time period as being when NSZone was more or less deprecated. There were a lot of other big (and small) design changes that were in that era as well; bindings were introduced, calendars changed, etc.
1. http://developer.apple.com/mac/library/documentation/CoreFoundation/Reference/CFTypeRef/Reference/reference.html#//apple_ref/c/func/CFMakeCollectable http://developer.apple.com/mac/library/documentation/CoreFou...
- chc 16y agoThat wasn't "something vaguely resembling garbage collection" — it was a no-op until garbage collection was finally introduced half a decade later. And NSZone was already out of favor when I started programming Cocoa, on OS X 10.1. It just didn't have any advantages under OS X's memory model. It certainly wasn't a preallocated object pool like this. As it was explained to me at the time, the main point of NSZone originally was that it let you to blow away the whole zone at once without needing to release every single object. This was no longer the case in 10.1 (and I don't think it was even the case in 10.0).
- pohl 16y agoNSZone was born when memory was small and paging to disk was expensive & frequent. Zones were to help you group objects that would likely be used together onto the same virtual memory page so you could decrease the likelihood of thrashing.