|
From: <sv...@va...> - 2014-07-29 08:46:24
|
Author: florian
Date: Tue Jul 29 08:46:15 2014
New Revision: 14201
Log:
Back out r14186 as it was identified to have caused a performance regression.
Modified:
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_libcbase.c
Modified: trunk/coregrind/m_debuginfo/debuginfo.c
==============================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c (original)
+++ trunk/coregrind/m_debuginfo/debuginfo.c Tue Jul 29 08:46:15 2014
@@ -1870,6 +1870,7 @@
&& di->text_avma <= a
&& a < di->text_avma + di->text_size) {
VG_(strncpy_safely)(buf, di->fsm.filename, nbuf);
+ buf[nbuf-1] = 0;
return True;
}
}
Modified: trunk/coregrind/m_libcbase.c
==============================================================================
--- trunk/coregrind/m_libcbase.c (original)
+++ trunk/coregrind/m_libcbase.c Tue Jul 29 08:46:15 2014
@@ -304,8 +304,14 @@
{
libcbase_assert(ndest > 0);
- VG_(strncpy)(dest, src, ndest);
- dest[ndest - 1] = '\0';
+ SizeT i = 0;
+ while (True) {
+ dest[i] = 0;
+ if (src[i] == 0) return;
+ if (i >= ndest-1) return;
+ dest[i] = src[i];
+ i++;
+ }
}
HChar* VG_(strncpy) ( HChar* dest, const HChar* src, SizeT ndest )
|