"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "zopfli/src/zopfli/cache.c" between
pigz-2.5.tar.gz and pigz-2.6.tar.gz

About: pigz is a parallel implementation of gzip for modern multi-processor, multi-core machines.

cache.c  (pigz-2.5):cache.c  (pigz-2.6)
skipping to change at line 36 skipping to change at line 36
#ifdef ZOPFLI_LONGEST_MATCH_CACHE #ifdef ZOPFLI_LONGEST_MATCH_CACHE
void ZopfliInitCache(size_t blocksize, ZopfliLongestMatchCache* lmc) { void ZopfliInitCache(size_t blocksize, ZopfliLongestMatchCache* lmc) {
size_t i; size_t i;
lmc->length = (unsigned short*)malloc(sizeof(unsigned short) * blocksize); lmc->length = (unsigned short*)malloc(sizeof(unsigned short) * blocksize);
lmc->dist = (unsigned short*)malloc(sizeof(unsigned short) * blocksize); lmc->dist = (unsigned short*)malloc(sizeof(unsigned short) * blocksize);
/* Rather large amount of memory. */ /* Rather large amount of memory. */
lmc->sublen = (unsigned char*)malloc(ZOPFLI_CACHE_LENGTH * 3 * blocksize); lmc->sublen = (unsigned char*)malloc(ZOPFLI_CACHE_LENGTH * 3 * blocksize);
if(lmc->sublen == NULL) { if(lmc->sublen == NULL) {
fprintf(stderr, fprintf(stderr,
"Error: Out of memory. Tried allocating %lu bytes of memory.\n", "Error: Out of memory. Tried allocating %zu bytes of memory.\n",
ZOPFLI_CACHE_LENGTH * 3 * blocksize); ZOPFLI_CACHE_LENGTH * 3 * blocksize);
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
/* length > 0 and dist 0 is invalid combination, which indicates on purpose /* length > 0 and dist 0 is invalid combination, which indicates on purpose
that this cache value is not filled in yet. */ that this cache value is not filled in yet. */
for (i = 0; i < blocksize; i++) lmc->length[i] = 1; for (i = 0; i < blocksize; i++) lmc->length[i] = 1;
for (i = 0; i < blocksize; i++) lmc->dist[i] = 0; for (i = 0; i < blocksize; i++) lmc->dist[i] = 0;
for (i = 0; i < ZOPFLI_CACHE_LENGTH * blocksize * 3; i++) lmc->sublen[i] = 0; for (i = 0; i < ZOPFLI_CACHE_LENGTH * blocksize * 3; i++) lmc->sublen[i] = 0;
} }
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)