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

Comparing ray/src/common/bmalloc.c (file contents):
Revision 2.1 by greg, Tue Nov 12 16:55:20 1991 UTC vs.
Revision 2.2 by greg, Tue Mar 10 15:32:00 1992 UTC

# Line 30 | Line 30 | static unsigned  nremain = 0;
30  
31  
32   char *
33 < bmalloc(n)              /* allocate a block of n bytes, no refunds */
33 > bmalloc(n)              /* allocate a block of n bytes */
34   register unsigned  n;
35   {
36          if (n > nremain && (n > MBLKSIZ || nremain > MBLKSIZ/WASTEFRAC))
# Line 38 | Line 38 | register unsigned  n;
38  
39          n = (n+(BYTES_WORD-1))&~(BYTES_WORD-1);         /* word align */
40  
41 <        if (n > nremain) {
42 <                if ((bposition = malloc((unsigned)MBLKSIZ)) == NULL) {
43 <                        nremain = 0;
44 <                        return(NULL);
45 <                }
46 <                nremain = MBLKSIZ;
41 >        if (n > nremain && (bposition = malloc(nremain = MBLKSIZ)) == NULL) {
42 >                nremain = 0;
43 >                return(NULL);
44          }
45          bposition += n;
46          nremain -= n;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines