Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating to ARC #80

Open
benuri opened this issue Oct 11, 2012 · 7 comments
Open

Migrating to ARC #80

benuri opened this issue Oct 11, 2012 · 7 comments

Comments

@benuri
Copy link

benuri commented Oct 11, 2012

Why not migrating iMedia to ARC?

@mikeabdullah
Copy link
Collaborator

We still support 32bit apps.

@benuri
Copy link
Author

benuri commented Oct 11, 2012

I see. So is it possible to add an optional support via preprocessor macros like this?

@mikeabdullah
Copy link
Collaborator

Perhaps a better question from me is "why do you want this?". iMedia builds a framework which should be perfectly compatible with an ARC app. If you're seeing a problem with this, that's a bug I'd like to fix.

@benuri
Copy link
Author

benuri commented Oct 11, 2012

I want this because I believe that ARC manages memory better than humans, and specifically better than I do.
(I have made some modifications in iMedia).

I want to be able to compile iMedia with ARC and see if it has better memory performance than with manual memory management (and use it if does work better).

@mikeabdullah
Copy link
Collaborator

The only way ARC has to use less memory with any significance than manual memory management is if it fixes a leak. And if ARC can do that, pretty much by definition, the static analyzer can too.

@benuri
Copy link
Author

benuri commented Oct 11, 2012

Not exactly, because ARC has some limitations on the code that helps it to manage memory better than what the static analyzer can detect. Otherwise the syntax could be exactly the same (especially without __bridge, weak and strong).

@mikeabdullah
Copy link
Collaborator

The __bridge etc. syntax exists so you can tell the compiler what you actually want to happen. Without that, it can know that you've done something wrong, but not be sure what you actually intended.

The only possible memory usage improvement ARC brings is from its autorelease implementation having the potential to destroy some objects a little earlier.

But quite frankly I have no interest in trying to convert and maintain such a large codebase dual-mode (or arguably even triple-mode as we technically support garbage collection still too). If you want to put in the legwork for this, be my guest and we'll see if others are happy with it. But it's a lot of effort for very little gain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants