• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: GC pros and cons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: GC pros and cons
      • From: Kyle Sluder <email@hidden>
References: 
 >Re: GC pros and cons (From: Quincey Morris <email@hidden>)
 >Re: GC pros and cons (From: Chris Idou <email@hidden>)
 >RE: GC pros and cons (From: Jeff Laing <email@hidden>)
 >Re: GC pros and cons (From: "Stephen J. Butler" <email@hidden>)
 >Re: GC pros and cons (From: Peter Ammon <email@hidden>)
 >Re: GC pros and cons (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: IBPlugin embedding question
  • Next by Date: Re: GC pros and cons
  • Previous by thread: Re: GC pros and cons
  • Next by thread: Re: GC pros and cons
  • Index(es):
    • Date
    • Thread