Print this page
Address Robert's feedback


  84 safe_malloc(size_t size)
  85 {
  86         void *ret;
  87 
  88         if ((ret = calloc(1, size)) == NULL)
  89                 die("Out of memory");
  90 
  91         return (ret);
  92 }
  93 
  94 
  95 /*
  96  * Since -C flag explicitly says C++, for now at least, force language to
  97  * C++
  98  */
  99 const char *
 100 dis_demangle(const char *name)
 101 {
 102         static char *demangled_name = NULL;
 103 





 104         free(demangled_name);
 105         demangled_name = sysdemangle(name, SYSDEM_LANG_CPP, NULL);
 106         return ((demangled_name != NULL) ? demangled_name : name);
 107 }


  84 safe_malloc(size_t size)
  85 {
  86         void *ret;
  87 
  88         if ((ret = calloc(1, size)) == NULL)
  89                 die("Out of memory");
  90 
  91         return (ret);
  92 }
  93 
  94 
  95 /*
  96  * Since -C flag explicitly says C++, for now at least, force language to
  97  * C++
  98  */
  99 const char *
 100 dis_demangle(const char *name)
 101 {
 102         static char *demangled_name = NULL;
 103 
 104         /*
 105          * Since demangled_name is static, it may be preserved across
 106          * invocations.  As such, make sure any memory that might be present
 107          * from previous invocations is freed.
 108          */
 109         free(demangled_name);
 110         demangled_name = sysdemangle(name, SYSDEM_LANG_CPP, NULL);
 111         return ((demangled_name != NULL) ? demangled_name : name);
 112 }