minimum bytes for mmap windows
This commit is contained in:
parent
3ebc6d947f
commit
3894464e42
@ -4,6 +4,8 @@
|
|||||||
- argh, im_measure() was not looping over bands correctly (thanks Peter)
|
- argh, im_measure() was not looping over bands correctly (thanks Peter)
|
||||||
- removed mmap_limit, we now always use windows ... reduces VM use hugely,
|
- removed mmap_limit, we now always use windows ... reduces VM use hugely,
|
||||||
because mmap windows are freed when their regions are freed
|
because mmap windows are freed when their regions are freed
|
||||||
|
- have a min bytes for mmap windows as well, so we don't make too many tiny
|
||||||
|
windows
|
||||||
|
|
||||||
26/11/09 started 7.20.3
|
26/11/09 started 7.20.3
|
||||||
- updated en_GB.po translation
|
- updated en_GB.po translation
|
||||||
|
7
TODO
7
TODO
@ -1,6 +1,3 @@
|
|||||||
WONTFIX for 7.20
|
|
||||||
================
|
|
||||||
|
|
||||||
- some of deprecated.h repeats stuff we do better in image.h, eg. addr()
|
- some of deprecated.h repeats stuff we do better in image.h, eg. addr()
|
||||||
should just call IM_REGION_ADDR()
|
should just call IM_REGION_ADDR()
|
||||||
|
|
||||||
@ -63,10 +60,6 @@ Actions:
|
|||||||
|
|
||||||
how can we move them to im_affinei ?
|
how can we move them to im_affinei ?
|
||||||
|
|
||||||
- make a "deprecated" package too
|
|
||||||
|
|
||||||
- update the Portfiles on the mac and on the website from the macports ones
|
|
||||||
|
|
||||||
- radiance read/write needs docs
|
- radiance read/write needs docs
|
||||||
|
|
||||||
maybe have an im_format(3) page with all the built-in formats?
|
maybe have an im_format(3) page with all the built-in formats?
|
||||||
|
@ -41,10 +41,15 @@ extern "C" {
|
|||||||
|
|
||||||
#define IM_SPARE (8)
|
#define IM_SPARE (8)
|
||||||
|
|
||||||
/* Private to iofuncs: the image size above which we switch from
|
/* Private to iofuncs: the minimum number of scanlines we add above and below
|
||||||
* mmap()-whole-image behaviour to mmap()-window, plus window margins.
|
* the window as a margin for slop.
|
||||||
*/
|
*/
|
||||||
#define IM__WINDOW_MARGIN (128)
|
#define IM__WINDOW_MARGIN_PIXELS (128)
|
||||||
|
|
||||||
|
/* Private to iofuncs: add at least this many bytes above and below the window.
|
||||||
|
* There's no point mapping just a few KB of a small image.
|
||||||
|
*/
|
||||||
|
#define IM__WINDOW_MARGIN_BYTES (1024 * 1024 * 10)
|
||||||
|
|
||||||
/* sizeof() a VIPS header on disc.
|
/* sizeof() a VIPS header on disc.
|
||||||
*/
|
*/
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#define DEBUG_ENVIRONMENT
|
|
||||||
#define DEBUG_TOTAL
|
#define DEBUG_TOTAL
|
||||||
#define DEBUG
|
#define DEBUG
|
||||||
*/
|
*/
|
||||||
@ -74,7 +73,12 @@ int im__read_test;
|
|||||||
|
|
||||||
/* Add this many lines above and below the mmap() window.
|
/* Add this many lines above and below the mmap() window.
|
||||||
*/
|
*/
|
||||||
int im__window_margin = IM__WINDOW_MARGIN;
|
int im__window_margin_pixels = IM__WINDOW_MARGIN_PIXELS;
|
||||||
|
|
||||||
|
/* Always map at least this many bytes. There's no point making tiny windows
|
||||||
|
* on small files.
|
||||||
|
*/
|
||||||
|
int im__window_margin_bytes = IM__WINDOW_MARGIN_BYTES;
|
||||||
|
|
||||||
/* Track global mmap usage.
|
/* Track global mmap usage.
|
||||||
*/
|
*/
|
||||||
@ -219,7 +223,7 @@ im_window_set( im_window_t *window, int top, int height )
|
|||||||
gint64 start, end, pagestart;
|
gint64 start, end, pagestart;
|
||||||
size_t length, pagelength;
|
size_t length, pagelength;
|
||||||
|
|
||||||
/* Calculate start and length for our window.
|
/* Calculate start and length for our window.
|
||||||
*/
|
*/
|
||||||
start = window->im->sizeof_header +
|
start = window->im->sizeof_header +
|
||||||
(gint64) IM_IMAGE_SIZEOF_LINE( window->im ) * top;
|
(gint64) IM_IMAGE_SIZEOF_LINE( window->im ) * top;
|
||||||
@ -347,31 +351,20 @@ im_window_t *
|
|||||||
im_window_ref( IMAGE *im, int top, int height )
|
im_window_ref( IMAGE *im, int top, int height )
|
||||||
{
|
{
|
||||||
im_window_t *window;
|
im_window_t *window;
|
||||||
#ifdef DEBUG_ENVIRONMENT
|
|
||||||
static const char *str = NULL;
|
|
||||||
#endif /*DEBUG_ENVIRONMENT*/
|
|
||||||
|
|
||||||
#ifdef DEBUG_ENVIRONMENT
|
|
||||||
if( !str ) {
|
|
||||||
if( (str = g_getenv( "IM_WINDOW_MARGIN" )) ) {
|
|
||||||
printf( "iofuncs/region.c: "
|
|
||||||
"compiled with DEBUG_ENVIRONMENT enabled\n" );
|
|
||||||
im__window_margin = atoi( str );
|
|
||||||
printf( "im_region_create: setting window margin to %d "
|
|
||||||
"from environment\n", im__window_margin );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
str = "done";
|
|
||||||
}
|
|
||||||
#endif /*DEBUG_ENVIRONMENT*/
|
|
||||||
|
|
||||||
g_mutex_lock( im->sslock );
|
g_mutex_lock( im->sslock );
|
||||||
|
|
||||||
if( !(window = im_window_find( im, top, height )) ) {
|
if( !(window = im_window_find( im, top, height )) ) {
|
||||||
/* No existing window ... make a new one.
|
/* No existing window ... make a new one. Ask for a larger
|
||||||
|
* window than we strictly need. There's no point making tiny
|
||||||
|
* windows.
|
||||||
*/
|
*/
|
||||||
top -= im__window_margin;
|
int margin = IM_MIN( im__window_margin_pixels,
|
||||||
height += im__window_margin * 2;
|
im__window_margin_bytes / IM_IMAGE_SIZEOF_LINE( im ) );
|
||||||
|
|
||||||
|
top -= margin;
|
||||||
|
height += margin * 2;
|
||||||
|
|
||||||
top = IM_CLIP( 0, top, im->Ysize - 1 );
|
top = IM_CLIP( 0, top, im->Ysize - 1 );
|
||||||
height = IM_CLIP( 0, height, im->Ysize - top );
|
height = IM_CLIP( 0, height, im->Ysize - top );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user