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

Comparing ray/src/common/malloc.c (file contents):
Revision 2.2 by greg, Fri Dec 13 10:28:42 1991 UTC vs.
Revision 2.3 by greg, Fri Feb 7 15:10:32 1992 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1991 Regents of the University of California */
1 > /* Copyright (c) 1992 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 233 | Line 233 | register unsigned  n;
233                  pagesz = amnt = getpagesize();
234                  nrem = (int)sbrk(0);                    /* page align break */
235                  nrem = pagesz - (nrem&(pagesz-1));
236 <                bpos = sbrk(nrem);                      /* word aligned! */
236 >                bpos = sbrk(nrem);
237                  if ((int)bpos == -1)
238                          return(NULL);
239   #ifdef MSTATS
240                  b_nsbrked += nrem;
241   #endif
242 +                thisamnt = BYTES_WORD - ((unsigned)bpos&(BYTES_WORD-1));
243 +                if (thisamnt < BYTES_WORD) {            /* align pointer */
244 +                        bpos += thisamnt;
245 +                        nrem -= thisamnt;
246 +                }
247          }
248  
249          n = (n+(BYTES_WORD-1))&~(BYTES_WORD-1);         /* word align rqst. */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines