Mesa (master): gallium/util: Fix deviation calculation in u_cache.
Vinson Lee
vlee at kemper.freedesktop.org
Thu Apr 22 01:48:24 UTC 2010
Module: Mesa
Branch: master
Commit: 7a0b48e3492e8d8f0b5d1cc882eed2b0f51c3dd8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7a0b48e3492e8d8f0b5d1cc882eed2b0f51c3dd8
Author: Vinson Lee <vlee at vmware.com>
Date: Wed Apr 21 18:45:44 2010 -0700
gallium/util: Fix deviation calculation in u_cache.
The approximate deviation calculation was using the entire cache's total
instead of each cache entry's total.
---
src/gallium/auxiliary/util/u_cache.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_cache.c b/src/gallium/auxiliary/util/u_cache.c
index 47c16b1..15f4a88 100644
--- a/src/gallium/auxiliary/util/u_cache.c
+++ b/src/gallium/auxiliary/util/u_cache.c
@@ -202,7 +202,7 @@ util_cache_destroy(struct util_cache *cache)
double stddev = sqrt(mean);
unsigned i;
for(i = 0; i < cache->size; ++i) {
- double z = fabs(cache->count - mean)/stddev;
+ double z = fabs(cache->entries[i].count - mean)/stddev;
/* This assert should not fail 99.9999998027% of the times, unless
* the hash function is a poor one */
assert(z <= 6.0);
More information about the mesa-commit
mailing list