On Jun 17, 2011, at 5:35 AM, Andreas Grosam wrote:

> Thank you Ken, for your valuable tips,

You're welcome.

> On Jun 17, 2011, at 10:40 AM, Ken Thomases wrote:
> 
>> After that, maybe use CFStringInitInlineBuffer() and 
>> CFStringGetCharacterFromInlineBuffer(), although that doesn't fit with your 
>> iterator interface.  You could wrap an iterator around them easily, though.

> I don't understand the purpose of the "inline buffer" facility fully, though. 
> Is accessing a NSString's content through an inline buffer faster than 
> accessing the content of a raw pointer whose content has a known encoding?

No.  The inline buffer would be slower than either of the Get...Ptr functions.  
However, it is an optimized way of doing a conversion, as would be required 
when the Get...Ptr functions return NULL.  It converts in chunks and preserves 
state between chunks so that conversion of the next chunk can resume without 
recomputing state.  Also, it uses a fixed-size stack buffer, avoiding heap 
allocation.

Regards,
Ken

_______________________________________________

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 arch...@mail-archive.com

Reply via email to