From b3a8ff33780f2432451ea1a66c17ec42ef4a1b7b Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 13 Sep 2012 13:25:23 +0100 Subject: [PATCH] linecache was oversized the linecache resizer forgot to take the strip height into account when growing, causing mem use to be higher than necessary --- ChangeLog | 3 +++ TODO | 2 -- configure.in | 8 ++++---- libvips/conversion/tilecache.c | 15 +++++++++++---- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c353bd6..a09a0844 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +13/9/12 started 7.30.3 +- linecache sized itself too large + 4/9/12 started 7.30.2 - sequential stops all threads on error - sequential delays ahead threads rather than blocking them completely diff --git a/TODO b/TODO index 1d0c4cf4..e4e24aca 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,3 @@ -- still deadlocks on example.rb - blocking bugs ============= diff --git a/configure.in b/configure.in index 636544a2..b7dcfc32 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ # also update the version number in the m4 macros below -AC_INIT([vips], [7.30.2], [vipsip@jiscmail.ac.uk]) +AC_INIT([vips], [7.30.3], [vipsip@jiscmail.ac.uk]) # required for gobject-introspection AC_PREREQ(2.62) @@ -17,7 +17,7 @@ AC_CONFIG_MACRO_DIR([m4]) # user-visible library versioning m4_define([vips_major_version], [7]) m4_define([vips_minor_version], [30]) -m4_define([vips_micro_version], [2]) +m4_define([vips_micro_version], [3]) m4_define([vips_version], [vips_major_version.vips_minor_version.vips_micro_version]) @@ -37,8 +37,8 @@ VIPS_VERSION_STRING=$VIPS_VERSION-`date` # binary interface changes not backwards compatible?: reset age to 0 LIBRARY_CURRENT=33 -LIBRARY_REVISION=5 -LIBRARY_AGE=1 +LIBRARY_REVISION=6 +LIBRARY_AGE=2 # patched into include/vips/version.h AC_SUBST(VIPS_VERSION) diff --git a/libvips/conversion/tilecache.c b/libvips/conversion/tilecache.c index d8f82a61..a153adb1 100644 --- a/libvips/conversion/tilecache.c +++ b/libvips/conversion/tilecache.c @@ -19,6 +19,8 @@ * 23/8/12 * - split to line and tile cache * - use a hash table instead of a list + * 13/9/12 + * - oops, linecache was oversized */ /* @@ -628,8 +630,11 @@ vips_line_cache_gen( VipsRegion *or, /* We size up the cache to the largest request. */ - if( or->valid.height > block_cache->max_tiles ) - block_cache->max_tiles = or->valid.height; + if( or->valid.height > + block_cache->max_tiles * block_cache->tile_height ) { + block_cache->max_tiles = + 1 + (or->valid.height / block_cache->tile_height); + } g_mutex_unlock( block_cache->lock ); @@ -665,8 +670,10 @@ vips_line_cache_build( VipsObject *object ) &tile_width, &tile_height, &nlines ); block_cache->max_tiles = 2 * (1 + nlines / block_cache->tile_height); - VIPS_DEBUG_MSG( "vips_line_cache_build: max_tiles = %d\n", - block_cache->max_tiles ); + VIPS_DEBUG_MSG( "vips_line_cache_build: max_tiles = %d, " + "tile_height = %d\n", + block_cache->max_tiles, + block_cache->tile_height ); if( vips_image_pio_input( block_cache->in ) ) return( -1 );