[BACK]Return to monitor_mm.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/Attic/monitor_mm.c between version 1.4.2.2 and 1.5

version 1.4.2.2, 2002/10/11 14:51:52 version 1.5, 2002/05/28 16:45:27
Line 36 
Line 36 
 static int  static int
 mm_compare(struct mm_share *a, struct mm_share *b)  mm_compare(struct mm_share *a, struct mm_share *b)
 {  {
         long diff = (char *)a->address - (char *)b->address;          return ((char *)a->address - (char *)b->address);
   
         if (diff == 0)  
                 return (0);  
         else if (diff < 0)  
                 return (-1);  
         else  
                 return (1);  
 }  }
   
 RB_GENERATE(mmtree, mm_share, next, mm_compare)  RB_GENERATE(mmtree, mm_share, next, mm_compare)
Line 146 
Line 139 
   
         address = mm_malloc(mm, size);          address = mm_malloc(mm, size);
         if (address == NULL)          if (address == NULL)
                 fatal("%s: mm_malloc(%lu)", __func__, (u_long)size);                  fatal("%s: mm_malloc(%lu)", __FUNCTION__, (u_long)size);
         return (address);          return (address);
 }  }
   
Line 160 
Line 153 
   
         if (size == 0)          if (size == 0)
                 fatal("mm_malloc: try to allocate 0 space");                  fatal("mm_malloc: try to allocate 0 space");
         if (size > SIZE_T_MAX - MM_MINSIZE + 1)  
                 fatal("mm_malloc: size too big");  
   
         size = ((size + (MM_MINSIZE - 1)) / MM_MINSIZE) * MM_MINSIZE;          size = ((size + MM_MINSIZE - 1) / MM_MINSIZE) * MM_MINSIZE;
   
         RB_FOREACH(mms, mmtree, &mm->rb_free) {          RB_FOREACH(mms, mmtree, &mm->rb_free) {
                 if (mms->size >= size)                  if (mms->size >= size)
Line 297 
Line 288 
         struct mm_master *mmold;          struct mm_master *mmold;
         struct mmtree rb_free, rb_allocated;          struct mmtree rb_free, rb_allocated;
   
         debug3("%s: Share sync", __func__);          debug3("%s: Share sync", __FUNCTION__);
   
         mm = *pmm;          mm = *pmm;
         mmold = mm->mmalloc;          mmold = mm->mmalloc;
Line 322 
Line 313 
         *pmm = mm;          *pmm = mm;
         *pmmalloc = mmalloc;          *pmmalloc = mmalloc;
   
         debug3("%s: Share sync end", __func__);          debug3("%s: Share sync end", __FUNCTION__);
 }  }
   
 void  void

Legend:
Removed from v.1.4.2.2  
changed lines
  Added in v.1.5