From 53dac98b553d7fafef6b27171443093575bd36c4 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 19 Dec 2019 15:26:10 +0000 Subject: [PATCH] larger seq cache Make the seq cache 50% larger to allow for rounding with some image widths, tile sizes and thread numbers. See https://github.com/libvips/libvips/issues/1494#issuecomment-567190830 --- libvips/conversion/tilecache.c | 5 ++--- libvips/iofuncs/sinkdisc.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libvips/conversion/tilecache.c b/libvips/conversion/tilecache.c index 76fdc848..c458254f 100644 --- a/libvips/conversion/tilecache.c +++ b/libvips/conversion/tilecache.c @@ -937,8 +937,7 @@ vips_line_cache_build( VipsObject *object ) block_cache->tile_width = block_cache->in->Xsize; /* Output has two buffers n_lines height, so 2 * n_lines is the maximum - * non-locality from threading. Add another n_lines for conv / reducev - * etc. + * non-locality from threading. Double again for conv, rounding, etc. * * tile_height can be huge for things like tiff read, where we can * have a whole strip in a single tile ... we still need to have a @@ -946,7 +945,7 @@ vips_line_cache_build( VipsObject *object ) * tile boundary. */ block_cache->max_tiles = VIPS_MAX( 2, - 3 * n_lines / block_cache->tile_height ); + 4 * n_lines / block_cache->tile_height ); VIPS_DEBUG_MSG( "vips_line_cache_build: n_lines = %d\n", n_lines ); diff --git a/libvips/iofuncs/sinkdisc.c b/libvips/iofuncs/sinkdisc.c index acf3ff5e..33647b63 100644 --- a/libvips/iofuncs/sinkdisc.c +++ b/libvips/iofuncs/sinkdisc.c @@ -254,7 +254,7 @@ wbuffer_flush( Write *write ) if( write->buf->area.top > 0 ) { vips_semaphore_down( &write->buf_back->done ); - /* Previous write suceeded? + /* Previous write succeeded? */ if( write->buf_back->write_errno ) { vips_error_system( write->buf_back->write_errno,