From 18c12fd66d244dd3ea0f57a0244f309b547225de Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 20 Mar 2019 16:28:22 +0000 Subject: [PATCH] remove some old sanity-checks regions can have null generate now --- libvips/iofuncs/region.c | 23 ----------------------- tools/vipsprofile | 8 +++++--- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/libvips/iofuncs/region.c b/libvips/iofuncs/region.c index 1ada63f3..d8a12af9 100644 --- a/libvips/iofuncs/region.c +++ b/libvips/iofuncs/region.c @@ -364,28 +364,6 @@ vips_region_summary( VipsObject *object, VipsBuf *buf ) VIPS_OBJECT_CLASS( vips_region_parent_class )->summary( object, buf ); } -static void -vips_region_sanity( VipsObject *object, VipsBuf *buf ) -{ - VipsRegion *region = VIPS_REGION( object ); - - (void) vips_object_sanity( VIPS_OBJECT( region->im ) ); - - switch( region->im->dtype ) { - case VIPS_IMAGE_PARTIAL: - /* Start and stop can be NULL, but not generate. - */ - if( !region->im->generate_fn ) - vips_buf_appends( buf, "generate NULL in partial\n" ); - break; - - default: - break; - } - - VIPS_OBJECT_CLASS( vips_region_parent_class )->sanity( object, buf ); -} - /* If a region is being created in one thread (eg. the main thread) and then * used in another (eg. a worker thread), the new thread needs to tell VIPS * to stop sanity g_assert() fails. The previous owner needs to @@ -491,7 +469,6 @@ vips_region_class_init( VipsRegionClass *class ) vobject_class->summary = vips_region_summary; vobject_class->dump = vips_region_dump; - vobject_class->sanity = vips_region_sanity; vobject_class->build = vips_region_build; } diff --git a/tools/vipsprofile b/tools/vipsprofile index 6864535d..f9bbb9f9 100644 --- a/tools/vipsprofile +++ b/tools/vipsprofile @@ -1,4 +1,5 @@ #!/usr/bin/python + from __future__ import division from __future__ import print_function @@ -6,7 +7,6 @@ import re import cairo from io import open - class ReadFile: def __init__(self, filename): self.filename = filename @@ -212,7 +212,8 @@ for thread in threads: unkn_percent = 100 - 100 * (thread.work + thread.wait) / thread.alive print('%13s\t%6.2g\t' % (thread.thread_name, thread.alive), end=' ') - print('%.3g\t%.3g\t%.3g\t' % (wait_percent, work_percent, unkn_percent), end=' ') + print('%.3g\t%.3g\t%.3g\t' % + (wait_percent, work_percent, unkn_percent), end=' ') print('%.3g\t' % (thread.mem / (1024 * 1024)), end=' ') print('%.3g\t' % (thread.peak_mem / (1024 * 1024))) @@ -302,7 +303,8 @@ for thread in threads: if gate_positions[gate_name] != gate_y: continue - if gates_overlap(thread.other_events, event.gate_name, gate_name): + if gates_overlap(thread.other_events, + event.gate_name, gate_name): found_overlap = True break