• 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: CFDictionary callback on PPC vs Intel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFDictionary callback on PPC vs Intel


  • Subject: Re: CFDictionary callback on PPC vs Intel
  • From: "Michael Ash" <email@hidden>
  • Date: Sun, 17 Feb 2008 11:59:43 -0500

On Feb 17, 2008 11:43 AM, Derrek Leute <email@hidden> wrote:
> The project actually started in cocoa but I moved to CF because
> NSDictionary forces a string copy for keys. This made memory needs go
> through the roof (unless I'm misusing or misunderstanding how to use
> it). CF lets me use anything as a key. In some sense I would love to
> be in Cocoa as I had to reimplement NSSet intersection and some other
> little basic things to do this. But it's fast, and it seems to be
> working quite well now. Not to mention that pointer comparison also
> seemed ridiculously faster on this amount of data.

Check out toll free bridging:

http://www.cocoadev.com/index.pl?TollFreeBridging

In short, a lot of CF types are equivalent to their NS types and can
be "converted" simply by casting. I put "converted" in quotes because
no conversion takes place; the same object is simultaneously an NS
object and a CF object.

Note that a CFDictionary created with custom callbacks will still copy
its keys if you use -setObject:forKey:, so don't do that. But
otherwise you can take a CFSet and use NSSet methods, you can put
NSNumbers in your CFDictionaries, and so forth. As far as I know, all
custom callbacks will be respected aside from NSDictionary insisting
on creating copies of the keys.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >CFDictionary callback on PPC vs Intel (From: "Derrek Leute" <email@hidden>)
 >Re: CFDictionary callback on PPC vs Intel (From: "Michael Ash" <email@hidden>)
 >Re: CFDictionary callback on PPC vs Intel (From: "Derrek Leute" <email@hidden>)

  • Prev by Date: Re: @property problem
  • Next by Date: Re: CFDictionary callback on PPC vs Intel
  • Previous by thread: Re: CFDictionary callback on PPC vs Intel
  • Next by thread: Re: CFDictionary callback on PPC vs Intel
  • Index(es):
    • Date
    • Thread