[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.16.16.1 and 1.17

version 1.16.16.1, 2013/11/08 05:52:21 version 1.17, 2013/05/17 00:13:13
Line 31 
Line 31 
   
 #include <errno.h>  #include <errno.h>
 #include <stdarg.h>  #include <stdarg.h>
   #include <stdlib.h>
 #include <string.h>  #include <string.h>
   
 #include "xmalloc.h"  #include "xmalloc.h"
Line 60 
Line 61 
         struct mm_share *tmp, *tmp2;          struct mm_share *tmp, *tmp2;
   
         if (mm->mmalloc == NULL)          if (mm->mmalloc == NULL)
                 tmp = xcalloc(1, sizeof(struct mm_share));                  tmp = xmalloc(sizeof(struct mm_share));
         else          else
                 tmp = mm_xmalloc(mm->mmalloc, sizeof(struct mm_share));                  tmp = mm_xmalloc(mm->mmalloc, sizeof(struct mm_share));
         tmp->address = address;          tmp->address = address;
Line 83 
Line 84 
         struct mm_master *mm;          struct mm_master *mm;
   
         if (mmalloc == NULL)          if (mmalloc == NULL)
                 mm = xcalloc(1, sizeof(struct mm_master));                  mm = xmalloc(sizeof(struct mm_master));
         else          else
                 mm = mm_xmalloc(mmalloc, sizeof(struct mm_master));                  mm = mm_xmalloc(mmalloc, sizeof(struct mm_master));
   
Line 121 
Line 122 
                 next = RB_NEXT(mmtree, head, mms);                  next = RB_NEXT(mmtree, head, mms);
                 RB_REMOVE(mmtree, head, mms);                  RB_REMOVE(mmtree, head, mms);
                 if (mmalloc == NULL)                  if (mmalloc == NULL)
                         xfree(mms);                          free(mms);
                 else                  else
                         mm_free(mmalloc, mms);                          mm_free(mmalloc, mms);
         }          }
Line 139 
Line 140 
                 fatal("munmap(%p, %lu): %s", mm->address, (u_long)mm->size,                  fatal("munmap(%p, %lu): %s", mm->address, (u_long)mm->size,
                     strerror(errno));                      strerror(errno));
         if (mm->mmalloc == NULL)          if (mm->mmalloc == NULL)
                 xfree(mm);                  free(mm);
         else          else
                 mm_free(mm->mmalloc, mm);                  mm_free(mm->mmalloc, mm);
 }  }
Line 152 
Line 153 
         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)", __func__, (u_long)size);
         memset(address, 0, size);  
         return (address);          return (address);
 }  }
   
Line 191 
Line 191 
         if (mms->size == 0) {          if (mms->size == 0) {
                 RB_REMOVE(mmtree, &mm->rb_free, mms);                  RB_REMOVE(mmtree, &mm->rb_free, mms);
                 if (mm->mmalloc == NULL)                  if (mm->mmalloc == NULL)
                         xfree(mms);                          free(mms);
                 else                  else
                         mm_free(mm->mmalloc, mms);                          mm_free(mm->mmalloc, mms);
         }          }
Line 247 
Line 247 
                 prev->size += mms->size;                  prev->size += mms->size;
                 RB_REMOVE(mmtree, &mm->rb_free, mms);                  RB_REMOVE(mmtree, &mm->rb_free, mms);
                 if (mm->mmalloc == NULL)                  if (mm->mmalloc == NULL)
                         xfree(mms);                          free(mms);
                 else                  else
                         mm_free(mm->mmalloc, mms);                          mm_free(mm->mmalloc, mms);
         } else          } else
Line 271 
Line 271 
         RB_REMOVE(mmtree, &mm->rb_free, mms);          RB_REMOVE(mmtree, &mm->rb_free, mms);
   
         if (mm->mmalloc == NULL)          if (mm->mmalloc == NULL)
                 xfree(mms);                  free(mms);
         else          else
                 mm_free(mm->mmalloc, mms);                  mm_free(mm->mmalloc, mms);
 }  }

Legend:
Removed from v.1.16.16.1  
changed lines
  Added in v.1.17