Re: Garbage collected and non-garbage collected
Re: Garbage collected and non-garbage collected
- Subject: Re: Garbage collected and non-garbage collected
- From: Michael Ash <email@hidden>
- Date: Tue, 10 Mar 2009 23:36:35 -0400
On Tue, Mar 10, 2009 at 2:47 PM, Robert Mullen <email@hidden> wrote:
> Too little resource, too little experience, too little return. The first two
> are because this is a skunk works type corporate project that basically has
> myself (an ex-.NET and general Windows coder) as it's resource so is
> constrained by me. The third is because I don't see sufficient gain to doing
> all the memory management myself. GC systems have become efficient enough in
> our modern world that I think manual memory management has become pretty
> specialized and out of place in 80% of desktop applications. Certainly there
> is the other 20% of high performance and real time situations but mine is
> basically a pretty face on a database. Anybody want to argue the other
> direction? I am always willing to learn.
IMO you're right but also asking the wrong question.
You shouldn't be asking whether GC is worthwhile for desktop apps, but
whether *Cocoa's* GC is. They are not, unfortunately, the same
question. While Cocoa's GC is quite good given the constraints it
lives in, those constraints cause many unfortunate problems which
don't exist in other collectors. Some are in the collector itself
(don't take the address of a global pointer-to-object variable if you
don't like to crash), and some are in the frameworks (NSData has
hidden gotchas, NSInvocation doesn't keep strong references to message
arguments, and many other weird problems). Apple did a good job with
the GC given the constraints they were under (adding GC to a C runtime
environment is Not Easy) but there are still quite a few shortcomings
there.
You may still be right that going with GC and fixing this stuff up is
the best use of your time. I won't argue with that. I just wanted to
point out that it's not as simple as saying "modern GCs are good
enough for the job now" since the GC you have isn't exactly the GC
you'd have in a more "managed" environment.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden