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

Comparing ray/src/rt/data.c (file contents):
Revision 2.6 by greg, Sun Nov 22 10:47:51 1992 UTC vs.
Revision 2.7 by greg, Mon Feb 8 13:12:28 1993 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1992 Regents of the University of California */
1 > /* Copyright (c) 1993 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 18 | Line 18 | static char SCCSid[] = "$SunId$ LBL";
18  
19   #include  "data.h"
20  
21 +                                /* picture memory usage before warning */
22 + #ifndef PSIZWARN
23 + #ifdef BIGMEM
24 + #define PSIZWARN        3000000
25 + #else
26 + #define PSIZWARN        1000000
27 + #endif
28 + #endif
29  
30 + #ifndef TABSIZ
31   #define TABSIZ          97              /* table size (prime) */
32 + #endif
33  
34   #define hash(s)         (shash(s)%TABSIZ)
35  
# Line 198 | Line 208 | char  *pname;
208          getheader(fp, headaspect, &inpaspect);
209          if (!fgetsresolu(&inpres, fp))
210                  goto readerr;
211 + #if PSIZWARN
212 +                                                /* check memory usage */
213 +        i = 3*sizeof(DATATYPE)*inpres.xr*inpres.yr;
214 +        if (i > PSIZWARN) {
215 +                sprintf(errmsg, "picture file \"%s\" using %d bytes of memory",
216 +                                pname, i);
217 +                error(WARNING, errmsg);
218 +        }
219 + #endif
220          for (i = 0; i < 3; i++) {
221                  pp[i].nd = 2;
222                  pp[i].dim[0].ne = inpres.yr;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines