20 |
|
#define vfork fork |
21 |
|
#endif |
22 |
|
|
23 |
< |
#define MAXSBUF 524268 /* maximum total size of scanline buffer */ |
23 |
> |
#define MAXSBUF 786432 /* maximum total size of scanline buffer */ |
24 |
|
#define HSIZE 317 /* size of scanline hash table */ |
25 |
|
#define NRETIRE 16 /* number of scanlines to retire at once */ |
26 |
|
|
49 |
|
|
50 |
|
static long ncall = 0L; /* number of calls to getpictscan */ |
51 |
|
static long nread = 0L; /* number of scanlines read */ |
52 |
+ |
static long nrecl = 0L; /* number of scanlines reclaimed */ |
53 |
|
|
54 |
|
static int wrongformat = 0; |
55 |
|
|
78 |
|
if (sl->y == y) { /* reclaim */ |
79 |
|
sl->next = hashtab[hi]; |
80 |
|
hashtab[hi] = sl; |
81 |
< |
#ifdef DEBUG |
81 |
< |
if (verbose) |
82 |
< |
fprintf(stderr, |
83 |
< |
"%s: scanline %d reclaimed\n", |
84 |
< |
progname, y); |
85 |
< |
#endif |
81 |
> |
nrecl++; |
82 |
|
} |
83 |
|
return(sl); |
84 |
|
} |
142 |
|
{ |
143 |
|
static long lastcall = 0L; /* ncall at last report */ |
144 |
|
static long lastread = 0L; /* nread at last report */ |
145 |
+ |
static long lastrecl = 0L; /* nrecl at last report */ |
146 |
|
|
147 |
|
if (ncall == lastcall) |
148 |
|
return; |
149 |
< |
fprintf(stderr, "%s: %ld scanlines read in %ld calls\n", |
150 |
< |
progname, nread-lastread, ncall-lastcall); |
149 |
> |
fprintf(stderr, "%s: %ld scanlines read (%ld reclaimed) in %ld calls\n", |
150 |
> |
progname, nread-lastread, nrecl-lastrecl, ncall-lastcall); |
151 |
|
lastcall = ncall; |
152 |
|
lastread = nread; |
153 |
+ |
lastrecl = nrecl; |
154 |
|
} |
155 |
|
#endif |
156 |
|
|
477 |
|
/* allocate scanline buffers */ |
478 |
|
scansize = sizeof(SCAN) + pxsiz*sizeof(COLR); |
479 |
|
#ifdef ALIGN |
480 |
< |
scansize = scansize+(sizeof(ALIGN)-1)) & ~(sizeof(ALIGN)-1); |
480 |
> |
scansize = scansize+(sizeof(ALIGN)-1) & ~(sizeof(ALIGN)-1); |
481 |
|
#endif |
482 |
|
i = MAXSBUF / scansize; /* compute number to allocate */ |
483 |
|
if (i > HSIZE) |