Re: IOObjectRelease: passing null? threadsafe?
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com 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 sean@rogue-research.com 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 (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Sean McBride