]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Another performance optimization.
authorBart Van Assche <bvanassche@acm.org>
Thu, 23 Apr 2009 20:07:23 +0000 (20:07 +0000)
committerBart Van Assche <bvanassche@acm.org>
Thu, 23 Apr 2009 20:07:23 +0000 (20:07 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9595

drd/drd_bitmap.c

index f4c098912a0026f0a2f1ff72369535d6988af00d..a70a7e07fb446308ddf765303c703b27ac2c6317 100644 (file)
@@ -255,15 +255,14 @@ void DRD_(bm_access_store_8)(struct bitmap* const bm, const Addr a1)
 Bool DRD_(bm_has)(struct bitmap* const bm, const Addr a1, const Addr a2,
                   const BmAccessTypeT access_type)
 {
-   Addr b;
-   for (b = a1; b < a2; b++)
-   {
-      if (! DRD_(bm_has_1)(bm, b, access_type))
-      {
-         return False;
-      }
-   }
-   return True;
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+   tl_assert(access_type == eLoad || access_type == eStore);
+#endif
+
+   if (access_type == eLoad)
+      return DRD_(bm_has_any_load)(bm, a1, a2);
+   else
+      return DRD_(bm_has_any_store)(bm, a1, a2);
 }
 
 Bool