[Mesa-dev] [PATCH 1/5] util/disk_cache: seed rand

Timothy Arceri tarceri at itsqueeze.com
Tue Mar 14 02:08:08 UTC 2017


Otherwise we will always remove old cache entries from the same dirs.
---
 src/util/disk_cache.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index 2a1024a..dc65d52 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -402,20 +402,22 @@ disk_cache_create(const char *gpu_name, const char *timestamp)
    cache->max_size = max_size;
 
    /* A limit of 32 jobs was choosen as observations of Deus Ex start-up times
     * showed that we reached at most 11 jobs on an Intel i5-6400 CPU at 2.70GHz
     * (a fairly modist desktop CPU). 1 thread was choosen because we don't
     * really care about getting things to disk quickly just that it's not
     * blocking other tasks.
     */
    util_queue_init(&cache->cache_queue, "disk_cache", 32, 1);
 
+   srand(time(NULL));
+
    ralloc_free(local);
 
    return cache;
 
  fail:
    if (fd != -1)
       close(fd);
    if (cache)
       ralloc_free(cache);
    ralloc_free(local);
-- 
2.9.3



More information about the mesa-dev mailing list