Re: IOObjectRelease: passing null? threadsafe?
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