Re:The Unfamiliar (Objective-C & Cocoa)
by smikhanov on Monday September 19, 2011 @06:30PM
(#3015476)
except ARC is better than Linus was imagining in the above, because it manages to do it without the "explicitly visible" part
I haven't read the article you're linking, but how does ARC manage to keep this invisible?
The usual trouble is supporting legacy code. Even with C++/Boost, where there's a variety of _ptr templates each promising either automatic deletion or automatic reference count decrement at an appropriate time, you can find yourself in a situation where there's a legacy C function accepting and returning, say, wchar_t*. You simply cannnot avoid doing malloc/free or retain/release in this situation.
Re:The Unfamiliar (Objective-C & Cocoa)
by pohl on Monday September 19, 2011 @06:54PM
(#3015550)
ARC handles this by being something you can choose in a per-compilation-unit basis, and by providing functions/macros for working with these legacy libraries. You still have to say what to do at such boundaries.
I haven't read the article you're linking, but how does ARC manage to keep this invisible?
The usual trouble is supporting legacy code. Even with C++/Boost, where there's a variety of _ptr templates each promising either automatic deletion or automatic reference count decrement at an appropriate time, you can find yourself in a situation where there's a legacy C function accepting and returning, say, wchar_t*. You simply cannnot avoid doing malloc/free or retain/release in this situation.