• 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: CF Types and AU
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF Types and AU


  • Subject: Re: CF Types and AU
  • From: Pete Gontier <email@hidden>
  • Date: Tue, 5 Aug 2003 16:41:34 -0700

On Tuesday, Aug 5, 2003, at 15:42 US/Pacific, Herbie Robinson wrote:

... (this new API) goes against the principles of CoreFoundation reference counting... [goes on to mention incorrect stuff about how CF works like Cocoa]

Core Foundation ... has no concept of auto-releasing pools, or any of the other abstractions of Cocoa's object model ...

I know next to nothing about AU, but I do know CF pretty well.

In CF, the result of a Copy or Create function must be (explicitly) released and the result of a Get function must not. (This is all quite independent of Cocoa except from the perspective of historical influence.) There are exceptions, but they are considered bugs.

Actually, the standard CF behavior you describe is inherently not thread safe; so, I would claim that the standard behavior is a bug. Given that Core Audio is heavily involved with multi-threading, I would say they did the correct thing.

It would be silly for me to comment on the quality of a function in AU, an API I have never used. I have made such comments before, but not this time. :-) I have avoided and hope to continue to avoid any discussion of AU syntax or semantics. I'm only generalizing about CF and hoping the AU gurus will apply my generalities as appropriate.

In CoreFoundation idiom, functions whose name contains Get produce values which should not be passed to CFRelease. Since this is an explicit and official convention, a function whose name contains Get but which produces values which should be passed to CFRelease seems likely to produce confusion. This will in turn produce leaks when clients assume Get implies no need for CFRelease.

This has nothing to do with software and everything to do with wetware. :-)

--

Pete Gontier
http://www.m-audio.com/
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: CF Types and AU (From: Herbie Robinson <email@hidden>)

  • Prev by Date: Re: CF Types and AU
  • Next by Date: Threading
  • Previous by thread: Re: CF Types and AU
  • Next by thread: Re: CF Types and AU
  • Index(es):
    • Date
    • Thread