From: Bart Van Assche Date: Thu, 23 Apr 2009 20:07:23 +0000 (+0000) Subject: Another performance optimization. X-Git-Tag: svn/VALGRIND_3_5_0~793 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=15a369d177399ed9168baab2fe4554607185801b;p=thirdparty%2Fvalgrind.git Another performance optimization. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9595 --- diff --git a/drd/drd_bitmap.c b/drd/drd_bitmap.c index f4c098912a..a70a7e07fb 100644 --- a/drd/drd_bitmap.c +++ b/drd/drd_bitmap.c @@ -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