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 1.15 by greg, Mon Aug 26 10:49:08 1991 UTC vs.
Revision 2.2 by greg, Fri Dec 13 10:28:42 1991 UTC

# Line 43 | Line 43 | static unsigned        m_nwasted = 0;
43   #endif
44   #define  BYTES_WORD     sizeof(ALIGN)
45  
46 + #ifndef  MAXINCR
47   #define  MAXINCR        (1<<16)                 /* largest sbrk(2) increment */
47
48 #ifdef  NOVMEM
49 #define  getpagesize()  1024
48   #endif
49                                          /* malloc free lists */
50   typedef union m_head {
# Line 381 | Line 379 | char   *p;
379          register M_HEAD *mp;
380          register int    bucket;
381  
382 <        if (p == NULL || p == DUMMYLOC)
382 >        if (p == NULL | p == DUMMYLOC)
383                  return(1);
384          mp = (M_HEAD *)p - 1;
385          if (mp->a.magic != MAGIC)               /* sanity check */
386                  return(0);
387          bucket = mp->a.bucket;
388 +        if (bucket < FIRSTBUCKET | bucket >= NBUCKETS)
389 +                return(0);
390          mp->next = free_list[bucket];
391          free_list[bucket] = mp;
392   #ifdef MSTATS
# Line 394 | Line 394 | char   *p;
394   #endif
395          return(1);
396   }
397
398
399 #ifndef NOVMEM
400 #ifndef BSD
401 #include <sys/var.h>
402 int
403 getpagesize()                   /* use SYSV var structure to get page size */
404 {
405        struct var  v;
406
407        uvar(&v);
408        return(1 << v.v_pageshift);
409 }
410 #endif
411 #endif
397  
398  
399   #ifdef MSTATS

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines