From b03d48e24bd12ddafe3043b0400665d8c8069c4f Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 12 Nov 2012 14:17:21 +0000 Subject: [PATCH] make linecache 50% larger thanks ferryfax, see: https://github.com/jcupitt/libvips/issues/36 --- ChangeLog | 1 + libvips/conversion/tilecache.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60ba5434..58d9dde6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ - remove options from format string in .dzi (thanks Martin) - vipsCC.pc required the wrong version of vips (thanks Alessandro) - larger max tile size for dzsave +- linecache is 50% larger to leave some slop room 13/9/12 started 7.30.3 - linecache sized itself too large diff --git a/libvips/conversion/tilecache.c b/libvips/conversion/tilecache.c index a153adb1..8c29d075 100644 --- a/libvips/conversion/tilecache.c +++ b/libvips/conversion/tilecache.c @@ -21,6 +21,8 @@ * - use a hash table instead of a list * 13/9/12 * - oops, linecache was oversized + * 12/11/12 + * - make linecache 50% larger to give some slop room */ /* @@ -662,13 +664,14 @@ vips_line_cache_build( VipsObject *object ) */ block_cache->tile_width = block_cache->in->Xsize; - /* Enough lines for two complete buffers. + /* Enough lines for two complete buffers would be exactly right. Make + * it 3 to give us some slop room. * * This can go up with request size, see vips_line_cache_gen(). */ vips_get_tile_size( block_cache->in, &tile_width, &tile_height, &nlines ); - block_cache->max_tiles = 2 * (1 + nlines / block_cache->tile_height); + block_cache->max_tiles = 3 * (1 + nlines / block_cache->tile_height); VIPS_DEBUG_MSG( "vips_line_cache_build: max_tiles = %d, " "tile_height = %d\n",