On 3/31/05 4:49 AM, Alexey Proskuryakov didst favor us with:
> On 31.03.2005 13:13, "Laurence Harris" <email@hidden> wrote:
>
>> Answering my own question: It doesn't seem to offer any advantages at all,
>> it just limits the size. In fact, it makes appending to the string slower if
>> it has a max size. So that leaves me wondering why one would ever create a
>> mutable CFString with any size limitation.
>
> Just speculating: CFStringCreateMutableWithExternalCharactersNoCopy
> definitely needs this parameter, and with the functionality already
> implemented, why not expose it in other functions? Also, if it's known that
> a resulting string has a length limit (e.g. will be ultimately stored in
> some structure), one may like CFString to catch overflow as soon as it
> happens.
>
> That said, I didn't expect it to be slower, it is interesting... How big
> is the difference?
Only a few percent. It's slower because before every append it has to check
to ensure the string won't get too long. I was hoping it would cause the
memory for the string to be pre-allocated so appending would be faster.
Silly me.
Larry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden
This email sent to email@hidden