|
From: <sv...@va...> - 2015-05-11 19:41:50
|
Author: philippe
Date: Mon May 11 20:41:43 2015
New Revision: 15211
Log:
Micro-optimisation following helgrind secmap gc
Checking the range in indexXA can be done with one comparison.
Modified:
trunk/coregrind/m_xarray.c
Modified: trunk/coregrind/m_xarray.c
==============================================================================
--- trunk/coregrind/m_xarray.c (original)
+++ trunk/coregrind/m_xarray.c Mon May 11 20:41:43 2015
@@ -127,9 +127,10 @@
inline void* VG_(indexXA) ( const XArray* xa, Word n )
{
- vg_assert(xa);
- vg_assert(n >= 0);
- vg_assert(n < xa->usedsizeE);
+ // vg_assert(xa);
+ // vg_assert(n >= 0); If n negative, the UWord conversion will make
+ // it bigger than usedsizeE.
+ vg_assert((UWord)n < xa->usedsizeE);
return ((char*)xa->arr) + n * xa->elemSzB;
}
|