Re: Handling overlapping buffers in wcstombs_sbcs
Fran=E7ois Gouget <fgouget(a)codeweavers.com> writes:
Actually the documentation specifies that WideCharToMultiByte (cal= led by ConvertVersionInfo32To16) fails if the source and destination pointers are the same. But it does not specify what happens if the buffers merelyt overlap. And of course in the ConvertVersionInfo32To16 case there's a 2 byte difference between them!
Then ConvertVersionInfo32To16 is broken; WideCharToMultiByte does not support overlapping buffers.
I'm not really convinced by the loop unrolling but I tried to keep= it anyway. I just modified it a bit. If someone's interested in doing actual performance tests, wants to look at the assembly or knows how manual loop unrolling must be done, go ahead.
You know, I did exactly that (looking at the assembly and running performance tests) when implementing it; it may be possible to improve it more by optimizing CPU pipelines usage, which is something I don't know too much about. But I strongly doubt you can improve it by only looking at the C source... --=20 Alexandre Julliard julliard(a)winehq.com
participants (1)
-
Alexandre Julliard