ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/holofile.c
(Generate patch)

Comparing ray/src/hd/holofile.c (file contents):
Revision 3.24 by gwlarson, Tue Sep 15 14:26:23 1998 UTC vs.
Revision 3.25 by gwlarson, Fri Sep 18 13:51:01 1998 UTC

# Line 16 | Line 16 | static char SCCSid[] = "$SunId$ SGI";
16   #define CACHESIZE       16      /* default cache size (Mbytes, 0==inf) */
17   #endif
18   #ifndef FREEBEAMS
19 < #define FREEBEAMS       1024    /* maximum beams to free at a time */
19 > #define FREEBEAMS       1500    /* maximum beams to free at a time */
20   #endif
21   #ifndef PCTFREE
22   #define PCTFREE         15      /* maximum fraction to free (%) */
# Line 316 | Line 316 | int    nr;                     /* number of new rays desired */
316          p = hdbray(hp->bl[i]) + hp->bl[i]->nrm;
317          hp->bl[i]->nrm += nr;                   /* update in-core structure */
318          bzero((char *)p, nr*sizeof(RAYVAL));
319 <        hp->bl[i]->tick = hdclock;              /* update LRU clock */
320 <        blglob(hp)->tick = hdclock++;
319 >        blglob(hp)->tick = hp->bl[i]->tick = hdclock++; /* update LRU clock */
320          return(p);                              /* point to new rays */
321   memerr:
322          error(SYSTEM, "out of memory in hdnewrays");
# Line 348 | Line 347 | register int   i;
347                  if (read(hp->fd, (char *)hdbray(hp->bl[i]), n) != n)
348                          error(SYSTEM, "error reading beam from holodeck file");
349          }
350 <        hp->bl[i]->tick = hdclock;      /* update LRU clock */
352 <        blglob(hp)->tick = hdclock++;
350 >        blglob(hp)->tick = hp->bl[i]->tick = hdclock++; /* update LRU clock */
351          return(hp->bl[i]);
352   }
353  
# Line 383 | Line 381 | int    (*bf)();                /* callback function (optional) */
381          register BEAM   *bp;
382          register int    i;
383                                          /* precheck consistency */
384 +        if (n <= 0) return;
385          for (i = n; i--; )
386                  if (hb[i].h == NULL || hb[i].b < 1 | hb[i].b > nbeams(hb[i].h))
387                          error(CONSISTENCY, "bad beam in hdloadbeams");
# Line 680 | Line 679 | register HOLO  *honly;                 /* NULL means check all */
679          int     freetarget;
680          int     n;
681          register int    i;
682 + #ifdef DEBUG
683 +        unsigned        membefore;
684 +
685 +        membefore = hdmemuse(0);
686 + #endif
687                                                  /* compute free target */
688          freetarget = (honly != NULL) ? blglob(honly)->nrm :
689                          hdmemuse(0)/sizeof(RAYVAL) ;
# Line 700 | Line 704 | register HOLO  *honly;                 /* NULL means check all */
704                          break;
705          }
706          hdsync(honly, 0);       /* synchronize directories as necessary */
707 + #ifdef DEBUG
708 +        sprintf(errmsg,
709 +        "%dK before, %dK after hdfreecache (%dK total), %d rays short\n",
710 +                membefore>>10, hdmemuse(0)>>10, hdmemuse(1)>>10, freetarget);
711 +        wputs(errmsg);
712 + #endif
713          return(-freetarget);    /* return how far past goal we went */
714   }
715  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines