• 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: IOObjectRelease: passing null? threadsafe?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IOObjectRelease: passing null? threadsafe?


  • Subject: Re: IOObjectRelease: passing null? threadsafe?
  • From: "Sean McBride" <email@hidden>
  • Date: Wed, 22 Oct 2008 14:59:08 -0400
  • Organization: Rogue Research

On 10/22/08 10:59 AM, Garth Cummings said:

>The constant IO_OBJECT_NULL has been in IOKit/IOTypes.h since Tiger.
>It was added to avoid the void* -> int cast warning that GCC 4.x gives
>if you try to cast NULL to an io_object_t.

Garth,

Thanks for your reply.  I guess I was using the term null loosely.  What
I meant was can I pass NULL/IO_OBJECT_NULL/MACH_PORT_NULL/nil (ie 0) to
IOObjectRelease() or might it crash if I do so?

C's free() is documented to do nothing given null, CFRelease() is
documented to not accept null.  See Q&A 1259, Table 2:
<http://developer.apple.com/qa/qa2001/qa1259.html>

I'm trying to determine what the API contract with IOObjectRelease()
is.  Since the docs are silent, I guess I must be conservative and check
for null myself.

But I am more worried about the doc's lack of thread-safety info.  I
have filed <rdar://6307385> against the docs.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >IOObjectRelease: passing null? threadsafe? (From: "Sean McBride" <email@hidden>)
 >Re: IOObjectRelease: passing null? threadsafe? (From: Terry Lambert <email@hidden>)
 >Re: IOObjectRelease: passing null? threadsafe? (From: "Sean McBride" <email@hidden>)
 >Re: IOObjectRelease: passing null? threadsafe? (From: Terry Lambert <email@hidden>)
 >Re: IOObjectRelease: passing null? threadsafe? (From: Garth Cummings <email@hidden>)

  • Prev by Date: Re: IOObjectRelease: passing null? threadsafe?
  • Next by Date: Re: rename and POSIX permissions
  • Previous by thread: Re: IOObjectRelease: passing null? threadsafe?
  • Next by thread: IOKit Kext Dependencies
  • Index(es):
    • Date
    • Thread