• 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: NSAllocateCollectable() questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSAllocateCollectable() questions


  • Subject: Re: NSAllocateCollectable() questions
  • From: "Michael Ash" <email@hidden>
  • Date: Wed, 16 Apr 2008 12:26:20 -0400

On Wed, Apr 16, 2008 at 12:04 PM, Clark Cox <email@hidden> wrote:
>  The purpose of the write barrier is to tell the collector to keep
>  something alive; it has nothing to do with when to collect it.

Right, I get that now.

[snip]
>  Garbage Collection:
>  The housekeeping is taken care of, I don't have to worry about it.
>  However, I cannot know exactly when my object will be destroyed (it
>  might be right away, it might be in a couple of seconds).

I don't see the relevance of this. The Cocoa GC explicitly only works
properly if you play by the rules it sets out. For example, if you
store a pointer in unscanned memory then you're playing with fire and
the object may well have been destroyed by the next time you try to
use it. Skipping write barriers likewise. I had thought that using
write barriers for clearing memory was part of the required rules, but
now it appears that it is not. But regardless, Cocoa GC only takes
care of its housekeeping when you take care of yours.

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

  • Follow-Ups:
    • Re: NSAllocateCollectable() questions
      • From: "Clark Cox" <email@hidden>
References: 
 >Re: NSAllocateCollectable() questions (From: Greg Parker <email@hidden>)
 >Re: NSAllocateCollectable() questions (From: "Michael Ash" <email@hidden>)
 >Re: NSAllocateCollectable() questions (From: "Clark Cox" <email@hidden>)

  • Prev by Date: Re: binary search trees & binning
  • Next by Date: Re: [ANN] ANSystemSoundWrapper - Cocoa wrapper for changing system volume
  • Previous by thread: Re: NSAllocateCollectable() questions
  • Next by thread: Re: NSAllocateCollectable() questions
  • Index(es):
    • Date
    • Thread