linecache was oversized

the linecache resizer forgot to take the strip height into account when
growing, causing mem use to be higher than necessary
This commit is contained in:
John Cupitt 2012-09-13 13:25:23 +01:00
parent 7a0441d455
commit b3a8ff3378
4 changed files with 18 additions and 10 deletions

View File

@ -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

2
TODO
View File

@ -1,5 +1,3 @@
- still deadlocks on example.rb
blocking bugs
=============

View File

@ -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)

View File

@ -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 );