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

Comparing ray/src/common/octree.c (file contents):
Revision 1.2 by greg, Sat Oct 14 10:56:32 1989 UTC vs.
Revision 2.4 by gwlarson, Mon Aug 24 16:38:44 1998 UTC

# Line 33 | Line 33 | octalloc()                     /* allocate an octree */
33                  errno = 0;
34                  if (octbi(freet) >= MAXOBLK)
35                          return(EMPTY);
36 <                if ((octblock[octbi(freet)] = (OCTREE *)malloc(
37 <                                (unsigned)256*8*sizeof(OCTREE))) == NULL)
36 >                if ((octblock[octbi(freet)] = (OCTREE *)bmalloc(
37 >                                (unsigned)OCTBLKSIZ*8*sizeof(OCTREE))) == NULL)
38                          return(EMPTY);
39          }
40          treetop += 8;
# Line 53 | Line 53 | register OCTREE  ot;
53                  octfree(octkid(ot, i));
54          octkid(ot, 0) = ofreelist;
55          ofreelist = ot;
56 + }
57 +
58 +
59 + octdone()                       /* free EVERYTHING */
60 + {
61 +        register int    i;
62 +
63 +        for (i = 0; i < MAXOBLK; i++) {
64 +                if (octblock[i] == NULL)
65 +                        break;
66 +                bfree((char *)octblock[i], (unsigned)256*8*sizeof(OCTREE));
67 +                octblock[i] = NULL;
68 +        }
69 +        ofreelist = EMPTY;
70 +        treetop = 0;
71   }
72  
73  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines