}
void f(char* a, char* b, wchar_t* wa, wchar_t* wb) {
- // The memcpy is duplicated so we have 10 calls, which makes for nice round
- // numbers in the totals.
+ // The memcpy is duplicated so we have 10 calls
+ // which was a nice round 100,000 until wcpncpy
+ // and wcsncpy were added
memcpy (a, b, 1000); // Redirects to memmove
memcpy (a, b, 1000); // Redirects to memmove
memmove(a, b, 1000);
stpcpy (a, b); // Redirects to strcpy
stpncpy(a, b, 1000);
wcscpy (wa, wb);
+#if defined(HAVE_WCPNCPY)
+ wcpncpy(wa, wb, 1000/sizeof(*wa));
+#else
+ memcpy(a, b, 1000);
+#endif
+#if defined(HAVE_WCSNCPY)
+ wcsncpy(wa, wb, 1000/sizeof(*wa));
+#else
+ memcpy(a, b, 1000);
+#endif
}
void test_malloc() {
-Total: 1,000,... bytes in 1,0.. blocks
+Total: 1,200,... bytes in 1,2.. blocks
# It's impossible to get exact matches for copy counts because even trivial C
# programs do a few memcpy/strcpy calls. So we allow some fuzzy matching.
-# So we allow 1,000,000..1,009,999 bytes and 1,000..1,099 blocks.
+# So we allow 1,200,000..1,209,999 bytes and 1,200..1,299 blocks.
./filter_stderr "$@" |
-sed -e "s/1,00.,... bytes in 1,0.. blocks/1,000,... bytes in 1,0.. blocks/"
+sed -e "s/1,20.,... bytes in 1,2.. blocks/1,200,... bytes in 1,2.. blocks/"