Re: GC pros and cons
Re: GC pros and cons
- Subject: Re: GC pros and cons
- From: Peter Ammon <email@hidden>
- Date: Thu, 25 Jun 2009 11:39:40 -0700
On Jun 24, 2009, at 8:11 PM, Kyle Sluder wrote:
On Wed, Jun 24, 2009 at 7:55 PM, Peter Ammon<email@hidden> wrote:
Microsoft even says that all objects must be robust against being
Dispose()d
multiple times, which smacks of sloppiness. If your program
disposes of an
object twice, then it is structured so that independent usages of
the object
are not coordinated, and so it is likely that one part of your
program uses
an object after it has been disposed by another part.
It's not really sloppiness. Python behaves the same way with its
contexts; both Python contexts and Dispose() are intended to be used
on objects that hold on to finite resources. Similarly to Dispose(),
you can't reopen a closed NSStream.
IOW, Dispose() isn't a memory management technique, it's a
limited-resource-management technique.
--Kyle Sluder
Are you saying that it's not sloppy to close a file twice, unlock a
lock twice, etc.?
Python doesn't require that its contexts be robust against multiple
calls to __exit__ (its answer to Dispose()).
_______________________________________________
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