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

Comparing ray/src/util/rcollate.c (file contents):
Revision 2.37 by greg, Fri Jan 15 17:22:23 2021 UTC vs.
Revision 2.38 by greg, Thu Jan 20 17:35:03 2022 UTC

# Line 87 | Line 87 | load_stream(MEMLOAD *mp, FILE *fp)
87          return(mp->len > 0);
88   }
89  
90 + #if defined(_WIN32) || defined(_WIN64)
91 +                                /* too difficult to fix this */
92 + #define load_file       load_stream
93 + #else
94   /* load a file into memory */
95   static int
96   load_file(MEMLOAD *mp, FILE *fp)
97   {
98          int     fd;
99          off_t   skip, flen, fpos;
96
97 #if defined(_WIN32) || defined(_WIN64)
98                                /* too difficult to fix this */
99        return load_stream(mp, fp);
100 #endif
100          if (mp == NULL)
101                  return(-1);
102          mp->mapped = NULL;
# Line 112 | Line 111 | load_file(MEMLOAD *mp, FILE *fp)
111                  return((int)(flen - skip));
112          mp->len = (size_t)(flen - skip);
113   #ifdef MAP_FILE
114 <        if (mp->len > 1L<<20) {         /* map file if > 1 MByte */
114 >        if (mp->len >= 1L<<20) {        /* map file if >= 1 MByte */
115                  mp->mapped = mmap(NULL, flen, PROT_READ, MAP_PRIVATE, fd, 0);
116                  if (mp->mapped != MAP_FAILED) {
117                          mp->base = (char *)mp->mapped + skip;
# Line 138 | Line 137 | load_file(MEMLOAD *mp, FILE *fp)
137          }
138          return(1);
139   }
140 + #endif
141  
142   /* free a record index */
143   #define free_records(rp)        free(rp)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines