Good news for iOS developers!

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Good news for iOS developers!

Post by JuLieN »

With yesterday's release of the beta version of iOS 5 SDK, Apple updated LLVM to its 3rd version, and... implemented a garbage collector in iOS! (At last!). Actually, this will not only work with iOS 5 but even with iOS 4.x. No more manual reference counting! :)

Image

This is handled by the OS (both in IOS and MacOS X) with a system called Automatic Reference Counting (ARC).

Xcode even includes a function to upgrade your projects (both MacOS X and iOS) to ARC: it will NOT modify your objective-C code (so you don't get lost), but it will ignore the unnecessary code at compile time.

ARC will be activated by default for your new projects.
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
mar
Posts: 2684
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Good news for iOS developers!

Post by mar »

Well perphaps I'm one of the few who don't like garbage collectors at all and prefer to do memory management themselves so I hope this ARC will be optional :D I don't know whether this only affects Objective C or C++ as well (have seen garbage collectors for C/C++, see http://www.hpl.hp.com/personal/Hans_Boehm/gc/).
The problem with GCs is that they eat up memory until they hit a limit and do GC which usually pauses all threads. You can't avoid memory fragmentation (unless it would compact heap and change references which I doubt [too expensive]), but you can with proper ordering of new/delete (alloc/free).
Don't know whether this is still a problem these days :)

Martin
User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: Good news for iOS developers!

Post by JuLieN »

Image

Sorry, I HAD to share this picture that made me smile. :D (And the alien is the news host in Futurama ;)

And BTW, the blog it comes from is really interesting too. Any Cocoa developer should bookmark it:

http://cocoasamurai.blogspot.com/
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]