Mesa (master): util/disk_cache: fix compressed size calculation

Timothy Arceri tarceri at kemper.freedesktop.org
Thu Mar 9 09:26:47 UTC 2017


Module: Mesa
Branch: master
Commit: 926bcacfd3f9025007455c026d44f810018cf787
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=926bcacfd3f9025007455c026d44f810018cf787

Author: Grazvydas Ignotas <notasas at gmail.com>
Date:   Thu Mar  9 02:54:52 2017 +0200

util/disk_cache: fix compressed size calculation

It incorrectly doubles the size on each iteration.

Fixes: 85a9b1b5 "util/disk_cache: compress individual cache entries"

Signed-off-by: Grazvydas Ignotas <notasas at gmail.com>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

---

 src/util/disk_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index 31a9336..5470688 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -696,7 +696,7 @@ deflate_and_write_to_disk(const void *in_data, size_t in_data_size, int dest,
          assert(ret != Z_STREAM_ERROR);  /* state not clobbered */
 
          size_t have = BUFSIZE - strm.avail_out;
-         compressed_size += compressed_size + have;
+         compressed_size += have;
 
          size_t written = 0;
          for (size_t len = 0; len < have; len += written) {




More information about the mesa-commit mailing list