On Wed, Mar 1, 2017 at 7:25 AM, Timothy Arceri <tarc...@itsqueeze.com> wrote: > ... > diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c > index 2a0edca..03aae02 100644 > --- a/src/util/disk_cache.c > +++ b/src/util/disk_cache.c > @@ -30,20 +30,21 @@ > #include <stdio.h> > #include <sys/file.h> > #include <sys/types.h> > #include <sys/stat.h> > #include <sys/mman.h> > #include <unistd.h> > #include <fcntl.h> > #include <pwd.h> > #include <errno.h> > #include <dirent.h> > +#include "zlib.h" > > #include "util/crc32.h" > #include "util/u_atomic.h" > #include "util/mesa-sha1.h" > #include "util/ralloc.h" > #include "main/errors.h" > > #include "disk_cache.h" > > /* Number of bits to mask off from a cache key to get an index. */ > @@ -638,30 +639,106 @@ disk_cache_remove(struct disk_cache *cache, cache_key > key) > return; > } > > unlink(filename); > free(filename); > > if (sb.st_size) > p_atomic_add(cache->size, - sb.st_size); > } > > +/* From the zlib docs: > + * "If the memory is available, buffers sizes on the order of 128K or 256K > + * bytes should be used." > + */ > +#define BUFSIZE 256 * 1024 > + > +/** > + * Compresses cache entry in memeory and writes it to disk. Returns the size
typo: memory _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev