Re: CFGetRetainCount question
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=Ljoyw4HcsLfs1RFTo1tPuSlhe5e6lQC0BLQ7U4uU4s4=; b=MD66GXr04KDUc7knTrXE4pimn5Sud8++Mxqkw/RqzG+mFbZWswnGF6t9pK3WcpSrNP p8le3IFkNiaPM5E5clzMxtzEhfJybU1DqFO0OLtWYfLe2lV4Jj43Jn8MYve59CWf6+VE iuYhrVal/BY7T8/MSHobB9hV7j3YUK16xltJk= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=EeJr5gFLeR8Tf1nuIocUQuo6Xso1iY6CDRpAaQVaLhXomAsLZOlFahdyvQhfs2HN5q dnmZ6wI5Pmw6U+qfMOMYHdqurZ3PjgGKaxr42nBU0ndXkxCh3ovR8YWzX9riFwGNHfev aeEC1y7DUGL2EvHCb6bfqcwtgGJBgv8aD41tU= On Jul 4, 2008, at 8:43 PM, Dmitry Markman wrote: but UINT_MAX is 4294967295 (0xFFFFFFFF) so what does 0x7FFFFFFF mean? Dmitry, well I found some information in the NSObject's retainCount method documentation: "You rarely send a retainCount message; however, you might implement this method in a class to implement your own reference-counting scheme. For objects that never get released (that is, theirrelease method does nothing), this method should return UINT_MAX, as defined in <limits.h>" thanks I don't think this is explicitly spelled out anywhere, but for CF "constants", such as CFSTR("blah"), kCFBooleanFalse, and other constant 'things' like this, there is no real meaning to releasing them, but depending on your program's abstraction classes or whatever, you may retain/release these CF constants. I believe CF special-cases this specific retaincount as a do-nothing operation. And 0x7FFFFFFF would be INT_MAX or SINT_MAX (which is the maximum for a signed long (which is what a CFIndex is, which is the return type for CFGetRetainCount()) [at least for 32-bit architecture, probably for 64-bit architecture]. Technically, you could retain any given CF object enough to hit this value, but you're program probably would have other problems before you hit this limit. _______________________________________________ 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)
-
Eli Bach