3 ms·
In ObjC the retain/release memory management system uses reference counters. When the count hits zero the object is deallocated so that does sound like what Lin
by bcl 16y ago
In ObjC the retain/release memory management system uses reference counters. When the count hits zero the object is deallocated so that does sound like what Linus is talking about.
Objective C also has the 'new' garbage collection system and there is autorelease which uses a memory pool and releases at some later point.
- lobster_johnson 16y agoObjective-C also has the autorelease pool, which allows for a bit more flexibility in that you don't need to pay as much attention to the refcount. You can also optimize allocations using zones, which are like mini-heaps that collect a bunch of objects and allow you to release all of them with a single deallocation -- very handy if you have a ton of small objects (like a DAG) where you know for a fact that when the root is deallocated, all the nodes should be freed as well.