Cygwin: convert sys_wcstombs/sys_mbstowcs wrapper to inline functions

This should slightly speed up especially path conversions,
given there's one less function call rearranging all function
arguments in registers/stack (and less stack pressure).

For clarity, rename overloaded  sys_wcstombs to _sys_wcstombs
and sys_cp_mbstowcs to _sys_mbstowcs.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2020-07-10 10:29:33 +02:00
parent b3af1d5aa3
commit 462fcdb67f
4 changed files with 61 additions and 65 deletions

View File

@@ -1542,11 +1542,11 @@ internal_setlocale ()
if (path && *path) /* $PATH can be potentially unset. */
{
w_path = tp.w_get ();
sys_cp_mbstowcs (cygheap->locale.mbtowc, w_path, 32768, path);
_sys_mbstowcs (cygheap->locale.mbtowc, w_path, 32768, path);
}
w_cwd = tp.w_get ();
cwdstuff::cwd_lock.acquire ();
sys_cp_mbstowcs (cygheap->locale.mbtowc, w_cwd, 32768,
_sys_mbstowcs (cygheap->locale.mbtowc, w_cwd, 32768,
cygheap->cwd.get_posix ());
/* Set charset for internal conversion functions. */
cygheap->locale.mbtowc = __get_global_locale ()->mbtowc;