On Jul 12, 2008, at 8:25 AM, Michael Ash wrote:

On Sat, Jul 12, 2008 at 2:25 AM, Marcel Weiher <[EMAIL PROTECTED] > wrote:

So as I said: (a) object allocation slowest (b) out-of-band retain count
slow (c) inline retain count much faster than either.

Well that all makes sense, thanks.

You're very welcome :-)

One further question for you, if you will. I got curious and went off
hunting for the inline refcount in NSCFString but couldn't find it.

Yeah, NSCFString doesn't actually declare any of "its" instance variables, which are actually those of the private CFString structure it uses.

The closest I got was the '_rc' field in CFRuntimeBase, but it's
inside an #if __LP64__ clause, so we don't get it in normal code these
days. The __CFString struct doesn't seem to have any place to store a
refcount. Am I missing something here, or does it only have an inline
refcount in 64-bit?

No, the inline reference count is available for all CF objects, and not limited to 64 bit.

What version of the structure are you looking at? For example http://www.cocoadev.com/index.pl?HowToCreateTollFreeBridgedClass shows this version, which matches what I got from opensource.apple.com


/* All CF "instances" start with this structure.  Never refer to
 * these fields directly -- they are for CF's use and may be added
 * to or removed or change format without warning.  Binary
 * compatibility for uses of this struct is not guaranteed from
 * release to release.
 */
typedef struct __CFRuntimeBase {
    void *_isa;
#if defined(__ppc__)
    uint16_t _rc;
    uint16_t _info;
#elif defined(__i386__)
    uint16_t _info;
    uint16_t _rc;
#else
#error unknown architecture
#endif
} CFRuntimeBase;

Cheers,

Marcel


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to