• 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: Tracking the retain count
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tracking the retain count


  • Subject: Re: Tracking the retain count
  • From: Graham Cox <email@hidden>
  • Date: Wed, 20 May 2015 08:50:52 +1000

> On 20 May 2015, at 12:20 am, Steve Christensen <email@hidden> wrote:
>
> One thought I had was to base all your cacheable objects on a class whose sole function is to notify the cache when the last reference goes away, i.e., when dealloc is called


This is what NSDiscardableContent is able to do, though the method names it uses are not ‘retain’, ‘release’ and 'retainCount'. As it’s a protocol, not an object, you can implement it however you like.

I disagree (with Quincey) that you may as well use retain/release/retainCount because the point is that those things are called behind your back at times you do not control, which surely is why this is looking like such a difficult problem? Instead, if objects that access the cached objects are forced to use ‘beginContentAccess’ and ‘endContentAccess’ then you have a very definite way to find out when nobody is accessing the objects that cannot be interfered with by memory management in any way.

I may have misunderstood the problem such that this is a poor ot for other reasons, but I’m not seeing it. I’m also not sure why there seems to be a tacit resistance to it - seems logical to me.

—Graham.
_______________________________________________

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: Tracking the retain count
      • From: Britt Durbrow <email@hidden>
    • Re: Tracking the retain count
      • From: Quincey Morris <email@hidden>
References: 
 >Tracking the retain count (From: Britt Durbrow <email@hidden>)
 >Re: Tracking the retain count (From: Jonathan Hull <email@hidden>)
 >Re: Tracking the retain count (From: Britt Durbrow <email@hidden>)
 >Re: Tracking the retain count (From: Quincey Morris <email@hidden>)
 >Re: Tracking the retain count (From: Britt Durbrow <email@hidden>)
 >Re: Tracking the retain count (From: Ken Thomases <email@hidden>)
 >Re: Tracking the retain count (From: Britt Durbrow <email@hidden>)
 >Re: Tracking the retain count (From: Quincey Morris <email@hidden>)
 >Re: Tracking the retain count (From: Graham Cox <email@hidden>)
 >Re: Tracking the retain count (From: Quincey Morris <email@hidden>)
 >Re: Tracking the retain count (From: Britt Durbrow <email@hidden>)
 >Re: Tracking the retain count (From: Steve Christensen <email@hidden>)

  • Prev by Date: Re: Tracking the retain count
  • Next by Date: NSFontPanel swamping the responder chain (and crashing)
  • Previous by thread: Re: Tracking the retain count
  • Next by thread: Re: Tracking the retain count
  • Index(es):
    • Date
    • Thread