18 |
|
|
19 |
|
#ifndef CACHESIZE |
20 |
|
#ifdef SMLMEM |
21 |
< |
#define CACHESIZE 5 |
21 |
> |
#define CACHESIZE 10 |
22 |
|
#else |
23 |
< |
#define CACHESIZE 17 /* default cache size (Mbytes, 0==inf) */ |
23 |
> |
#define CACHESIZE 100 /* default cache size (Mbytes, 0==inf) */ |
24 |
|
#endif |
25 |
|
#endif |
26 |
|
#ifndef FREEBEAMS |
30 |
|
#define PCTFREE 15 /* maximum fraction to free (%) */ |
31 |
|
#endif |
32 |
|
#ifndef MAXFRAGB |
33 |
< |
#define MAXFRAGB 16 /* fragment blocks/file to track (0==inf) */ |
33 |
> |
#define MAXFRAGB 64 /* fragment blocks/file to track (0==inf) */ |
34 |
|
#endif |
35 |
|
#ifndef FF_DEFAULT |
36 |
|
/* when to free a beam fragment */ |
42 |
|
#endif |
43 |
|
|
44 |
|
#ifndef BSD |
45 |
+ |
#ifdef write /* platform.h renames those for Windows */ |
46 |
+ |
#undef write |
47 |
+ |
#endif |
48 |
|
#define write writebuf /* safe i/o routines */ |
49 |
+ |
#ifdef read |
50 |
+ |
#undef read |
51 |
+ |
#endif |
52 |
|
#define read readbuf |
53 |
|
#endif |
54 |
|
|
252 |
|
} |
253 |
|
if (rtrunc) { |
254 |
|
sprintf(errmsg, "truncated section, %ld rays lost (%.1f%%)", |
255 |
< |
rtrunc, 100.*rtrunc/(rtrunc+biglob(hp)->nrd)); |
255 |
> |
(long)rtrunc, |
256 |
> |
100.*rtrunc/(rtrunc+biglob(hp)->nrd)); |
257 |
|
error(WARNING, errmsg); |
258 |
|
} |
259 |
|
/* add to holodeck list */ |
410 |
|
|
411 |
|
extern off_t |
412 |
|
hdfiluse( /* compute file usage (in bytes) */ |
413 |
< |
int fd, /* open file descriptor to check */ |
407 |
< |
int all /* include overhead and unflushed data */ |
413 |
> |
int fd /* open file descriptor to check */ |
414 |
|
) |
415 |
|
{ |
416 |
|
off_t total = 0; |
417 |
< |
register int i, j; |
417 |
> |
register int j; |
418 |
|
|
419 |
|
for (j = 0; hdlist[j] != NULL; j++) { |
420 |
|
if (hdlist[j]->fd != fd) |
421 |
|
continue; |
422 |
|
total += biglob(hdlist[j])->nrd * sizeof(RAYVAL); |
423 |
< |
if (all) { |
424 |
< |
for (i = nbeams(hdlist[j]); i > 0; i--) |
425 |
< |
if (hdlist[j]->bl[i] != NULL) |
426 |
< |
total += sizeof(RAYVAL) * |
423 |
> |
total += nbeams(hdlist[j])*sizeof(BEAMI) + sizeof(HDGRID); |
424 |
> |
#if 0 |
425 |
> |
for (i = nbeams(hdlist[j]); i > 0; i--) |
426 |
> |
if (hdlist[j]->bl[i] != NULL) |
427 |
> |
total += sizeof(RAYVAL) * |
428 |
|
(hdlist[j]->bl[i]->nrm - |
429 |
|
hdlist[j]->bi[i].nrd); |
430 |
< |
total += sizeof(HDGRID) + |
424 |
< |
nbeams(hdlist[j])*sizeof(BEAMI); |
425 |
< |
} |
430 |
> |
#endif |
431 |
|
} |
432 |
< |
return(total); /* does not include fragments */ |
432 |
> |
return(total); /* doesn't include fragments, unflushed rays */ |
433 |
|
} |
434 |
|
|
435 |
|
|