From 5e3f868171b6d4ec85c84ced904590193cfdfef2 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 11 May 2013 16:31:18 +0100 Subject: [PATCH] don't cache vips_copy() or im_copy() --- ChangeLog | 2 ++ libvips/conversion/conver_dispatch.c | 4 +++- libvips/conversion/copy.c | 7 ++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3d3a0182..25787bad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 12/3/13 started 7.33.0 - vipsthumbnail lets you specify the sharpening mask +- turn off caching for im_copy()/vips_copy(), we use copy to stop sharing, and +it's cheap so caching doesn't help anyway 16/4/13 started 7.32.3 - rename GETTEXT_PACKAGE as vips7.32 to help Debian (thanks Jay) diff --git a/libvips/conversion/conver_dispatch.c b/libvips/conversion/conver_dispatch.c index 07428d9d..ed55fceb 100644 --- a/libvips/conversion/conver_dispatch.c +++ b/libvips/conversion/conver_dispatch.c @@ -751,8 +751,10 @@ static im_function copy_desc = { /* Can't set PTOP ... we don't want to zap the LUT, we want the real * image. + * + * Don't cache, since we use copy to stop sharing. */ - IM_FN_PIO, /* Flags */ + IM_FN_PIO | IM_FN_NOCACHE, copy_vec, /* Dispatch function */ IM_NUMBER( one_in_one_out ), /* Size of arg list */ diff --git a/libvips/conversion/copy.c b/libvips/conversion/copy.c index 625d267d..7cb18d73 100644 --- a/libvips/conversion/copy.c +++ b/libvips/conversion/copy.c @@ -316,7 +316,12 @@ vips_copy_class_init( VipsCopyClass *class ) vobject_class->description = _( "copy an image" ); vobject_class->build = vips_copy_build; - operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + /* We use copy to make fresh vipsimages to stop sharing, so don't + * cache it. Plus copy is cheap. + */ + operation_class->flags = + VIPS_OPERATION_SEQUENTIAL | + VIPS_OPERATION_NOCACHE; VIPS_ARG_IMAGE( class, "in", 1, _( "Input" ),