Handling overlapping buffers in wcstombs_sbcs

Alexandre Julliard julliard at winehq.com
Fri Mar 23 11:59:44 CST 2001


Fran=E7ois Gouget <fgouget at 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 at winehq.com




More information about the wine-devel mailing list