FPS: useAsCString variants

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri Jul 14 02:36:35 EDT 2006


Hello Donald,

Friday, July 14, 2006, 8:11:22 AM, you wrote:

>> afaik, CStringLen don't require zero byte at the end of string. So the
>> following implementation will be much faster and still correct (not
>> tested, it's just sketch):

> Well spotted! I've applied this patch, with a tiny tweak (you missed a
> withForeignPtr in useAsCStringLen).

thanks. after writing this letter i spotted unsafeUseAsCStringLen and
used it. now i'm curious about having these 4 functions:

useAsCString
useAsCStringLen
unsafeUseAsCString
unsafeUseAsCStringLen

and differences between their behavior. may be, it will be better to
keep only first two functions, with semantics already implemented
(with my patch) - `useAsCString` add zero byte while useAsCStringLen doesn't ?

i copy this letter to libraries list in hope that other FPS developers
may clear the question

-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Libraries mailing list