• 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: Garbage collector vs variable lifetime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Garbage collector vs variable lifetime


  • Subject: Re: Garbage collector vs variable lifetime
  • From: "Michael Ash" <email@hidden>
  • Date: Sat, 7 Jun 2008 14:45:32 -0400

On Sat, Jun 7, 2008 at 2:19 PM, Quincey Morris
<email@hidden> wrote:
> The consequence of this should be either:
>
> (a) [data bytes] must promise to return a collectable object (so that the
> 'bytes' reference keeps it alive), or
>
> (b) [data bytes] must lock (pseudo-retain) something internally (possibly
> just 'data' itself) and be matched with an unlock (pseudo-release) method.
>
> (Maybe there's a 3rd option, but I can't think of it. Your custom allocator
> suggestion is more or less equivalent to (b), I think.)

The custom allocator idea would actually be a way of implementing
option (a). I assume the reason (a) isn't used now, aside from simple
legacy or not having thought about it, is because sometimes NSData
wraps pointers which *can't* be collected, because they need to be
"freed" using calls such as munmap and the current collector only
works with pointers that it allocates itself. Adding support for
custom allocators to the collector would allow such special cases to
work.

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

References: 
 >Garbage collector vs variable lifetime (From: Quincey Morris <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Bill Bumgarner <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Ricky Sharp <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Bill Bumgarner <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Antonio Nunes <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Ken Thomases <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Bill Bumgarner <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Ken Thomases <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: "Michael Ash" <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Garbage collector vs variable lifetime
  • Next by Date: Re: Learning Cocoa with RubyCocoa (was Regular Expressions)
  • Previous by thread: Re: Garbage collector vs variable lifetime
  • Next by thread: Re: Garbage collector vs variable lifetime
  • Index(es):
    • Date
    • Thread