Print this page
Address Robert's feedback

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libsysdemangle/common/util.c
          +++ new/usr/src/lib/libsysdemangle/common/util.c
↓ open down ↓ 48 lines elided ↑ open up ↑
  49   49  
  50   50          ops->free(p, len);
  51   51  }
  52   52  
  53   53  void *
  54   54  xrealloc(sysdem_ops_t *ops, void *p, size_t oldsz, size_t newsz)
  55   55  {
  56   56          if (newsz == oldsz)
  57   57                  return (p);
  58   58  
  59      -        ASSERT3U(newsz, >, oldsz);
       59 +        VERIFY3U(newsz, >, oldsz);
  60   60  
  61   61          void *temp = zalloc(ops, newsz);
  62   62  
  63   63          if (temp == NULL)
  64   64                  return (NULL);
  65   65  
  66   66          if (oldsz > 0) {
  67   67                  (void) memcpy(temp, p, oldsz);
  68   68                  xfree(ops, p, oldsz);
  69   69          }
↓ open down ↓ 1 lines elided ↑ open up ↑
  71   71          return (temp);
  72   72  }
  73   73  
  74   74  /*ARGSUSED*/
  75   75  static void
  76   76  def_free(void *p, size_t len)
  77   77  {
  78   78          free(p);
  79   79  }
  80   80  
  81      -/* BEGIN CSTYLED */
  82      -sysdem_ops_t *sysdem_ops_default = &(sysdem_ops_t){
       81 +static sysdem_ops_t i_sysdem_ops_default = {
  83   82          .alloc = malloc,
  84   83          .free = def_free
  85   84  };
  86      -/* END CSTYLED */
       85 +sysdem_ops_t *sysdem_ops_default = &i_sysdem_ops_default;
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX