replace XMALLOC with XNEW
authorTom Tromey <tromey@redhat.com>
Sat, 28 Dec 2013 22:31:23 +0000 (15:31 -0700)
committerTom Tromey <tromey@redhat.com>
Mon, 13 Jan 2014 14:31:28 +0000 (07:31 -0700)
This replaces XMALLOC with XNEW, and removes XMALLOC.  The only
non-mechanical bit here was remembering to edit gdbarch.sh.

2014-01-13  Tom Tromey  <tromey@redhat.com>

* defs.h (XMALLOC): Remove.
* avr-tdep.c (avr_gdbarch_init): Use XNEW, not XMALLOC.
* bfin-tdep.c (bfin_gdbarch_init): Likewise.
* cli-out.c (struct ui_out *): Likewise.
* cli/cli-dump.c (add_dump_command): Likewise.
(add_dump_command): Likewise.
* complaints.c (get_complaints): Likewise.
(find_complaint): Likewise.
* dwarf2-frame.c (execute_cfa_program): Likewise.
* dwarf2read.c (abbrev_table_read_table): Likewise.
* gdbarch.sh: Likewise.
* gdbarch.c: Rebuild.
* inf-ttrace.c (inf_ttrace_add_page): Likewise.
* interps.c (interp_new): Likewise.
* lm32-tdep.c (lm32_gdbarch_init): Likewise.
* m32r-tdep.c (m32r_gdbarch_init): Likewise.
* mi/mi-console.c (mi_console_file_new): Likewise.
* mi/mi-interp.c (mi_interpreter_init): Likewise.
* mi/mi-out.c (mi_out_new): Likewise.
* mi/mi-parse.c (mi_parse): Likewise.
* microblaze-tdep.c (microblaze_gdbarch_init): Likewise.
* moxie-tdep.c (moxie_gdbarch_init): Likewise.
* observer.c (xalloc_observer_list_node): Likewise.
* regcache.c (regcache_xmalloc_1): Likewise.
* reggroups.c (reggroup_new): Likewise.
(_initialize_reggroup): Likewise.
* registry.c (register_data_with_cleanup): Likewise.
* remote.c (remote_notif_stop_alloc_reply): Likewise.
* ser-base.c (serial_ttystate): Likewise.
* ser-mingw.c (make_pipe_state): Likewise.
* ser-pipe.c (pipe_open): Likewise.
* serial.c (serial_open): Likewise.
* sh64-tdep.c (sh64_gdbarch_init): Likewise.
* tui/tui-data.c (tui_alloc_generic_win_info): Likewise.
(tui_alloc_win_info): Likewise.
(tui_add_content_elements): Likewise.
* tui/tui-file.c (tui_file_new): Likewise.
* tui/tui-out.c (tui_out_new): Likewise.
* ui-file.c (mem_file_new): Likewise.
* ui-out.c (push_level): Likewise.
(make_cleanup_ui_out_end): Likewise.
(append_header_to_list): Likewise.
(ui_out_new): Likewise.
* user-regs.c (user_reg_add_builtin): Likewise.

37 files changed:
gdb/ChangeLog
gdb/avr-tdep.c
gdb/bfin-tdep.c
gdb/cli-out.c
gdb/cli/cli-dump.c
gdb/complaints.c
gdb/defs.h
gdb/dwarf2-frame.c
gdb/dwarf2read.c
gdb/gdbarch.c
gdb/gdbarch.sh
gdb/inf-ttrace.c
gdb/interps.c
gdb/lm32-tdep.c
gdb/m32r-tdep.c
gdb/mi/mi-console.c
gdb/mi/mi-interp.c
gdb/mi/mi-out.c
gdb/mi/mi-parse.c
gdb/microblaze-tdep.c
gdb/moxie-tdep.c
gdb/observer.c
gdb/regcache.c
gdb/reggroups.c
gdb/registry.c
gdb/remote.c
gdb/ser-base.c
gdb/ser-mingw.c
gdb/ser-pipe.c
gdb/serial.c
gdb/sh64-tdep.c
gdb/tui/tui-data.c
gdb/tui/tui-file.c
gdb/tui/tui-out.c
gdb/ui-file.c
gdb/ui-out.c
gdb/user-regs.c

index debaaff93cb2023ea654e94c1941320bbb5cea11..a55e19db2dd2dcda677a0c032144a1611735a691 100644 (file)
@@ -1,3 +1,50 @@
+2014-01-13  Tom Tromey  <tromey@redhat.com>
+
+       * defs.h (XMALLOC): Remove.
+       * avr-tdep.c (avr_gdbarch_init): Use XNEW, not XMALLOC.
+       * bfin-tdep.c (bfin_gdbarch_init): Likewise.
+       * cli-out.c (struct ui_out *): Likewise.
+       * cli/cli-dump.c (add_dump_command): Likewise.
+       (add_dump_command): Likewise.
+       * complaints.c (get_complaints): Likewise.
+       (find_complaint): Likewise.
+       * dwarf2-frame.c (execute_cfa_program): Likewise.
+       * dwarf2read.c (abbrev_table_read_table): Likewise.
+       * gdbarch.sh: Likewise.
+       * gdbarch.c: Rebuild.
+       * inf-ttrace.c (inf_ttrace_add_page): Likewise.
+       * interps.c (interp_new): Likewise.
+       * lm32-tdep.c (lm32_gdbarch_init): Likewise.
+       * m32r-tdep.c (m32r_gdbarch_init): Likewise.
+       * mi/mi-console.c (mi_console_file_new): Likewise.
+       * mi/mi-interp.c (mi_interpreter_init): Likewise.
+       * mi/mi-out.c (mi_out_new): Likewise.
+       * mi/mi-parse.c (mi_parse): Likewise.
+       * microblaze-tdep.c (microblaze_gdbarch_init): Likewise.
+       * moxie-tdep.c (moxie_gdbarch_init): Likewise.
+       * observer.c (xalloc_observer_list_node): Likewise.
+       * regcache.c (regcache_xmalloc_1): Likewise.
+       * reggroups.c (reggroup_new): Likewise.
+       (_initialize_reggroup): Likewise.
+       * registry.c (register_data_with_cleanup): Likewise.
+       * remote.c (remote_notif_stop_alloc_reply): Likewise.
+       * ser-base.c (serial_ttystate): Likewise.
+       * ser-mingw.c (make_pipe_state): Likewise.
+       * ser-pipe.c (pipe_open): Likewise.
+       * serial.c (serial_open): Likewise.
+       * sh64-tdep.c (sh64_gdbarch_init): Likewise.
+       * tui/tui-data.c (tui_alloc_generic_win_info): Likewise.
+       (tui_alloc_win_info): Likewise.
+       (tui_add_content_elements): Likewise.
+       * tui/tui-file.c (tui_file_new): Likewise.
+       * tui/tui-out.c (tui_out_new): Likewise.
+       * ui-file.c (mem_file_new): Likewise.
+       * ui-out.c (push_level): Likewise.
+       (make_cleanup_ui_out_end): Likewise.
+       (append_header_to_list): Likewise.
+       (ui_out_new): Likewise.
+       * user-regs.c (user_reg_add_builtin): Likewise.
+
 2014-01-13  Tom Tromey  <tromey@redhat.com>
 
        * defs.h (XZALLOC): Remove.
index cb330ea54f7a04b9ffc06b0e79ddbabbec12f003..e8636785d6dd81da9fa92c17cd12d737184861b6 100644 (file)
@@ -1377,7 +1377,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     }
 
   /* None found, create a new architecture from the information provided.  */
-  tdep = XMALLOC (struct gdbarch_tdep);
+  tdep = XNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
   
   tdep->call_length = call_length;
index d64da0d4415012c1b65b8aad75e04327be0ef8e1..3fa81732c66d06ad1366964363b888f17219d26f 100644 (file)
@@ -818,7 +818,7 @@ bfin_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       return arches->gdbarch;
     }
 
-  tdep = XMALLOC (struct gdbarch_tdep);
+  tdep = XNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
 
   tdep->bfin_abi = abi;
index 491d77b5d5de24b782f5a6dba4ec7fbe6e8e928d..b936f30a93d6ff755af4bef41781314699a8d44f 100644 (file)
@@ -393,7 +393,7 @@ struct ui_out *
 cli_out_new (struct ui_file *stream)
 {
   int flags = ui_source_list;
-  cli_out_data *data = XMALLOC (cli_out_data);
+  cli_out_data *data = XNEW (cli_out_data);
 
   cli_out_data_ctor (data, stream);
   return ui_out_new (&cli_ui_out_impl, data, flags);
index c3c220059bfa9a471c2c77f63fb887f0baa90f2a..005e207a113b8fb7a987adfcdf26edf5d5fc2ac9 100644 (file)
@@ -396,7 +396,7 @@ add_dump_command (char *name, void (*func) (char *args, char *mode),
 
   c = add_cmd (name, all_commands, NULL, descr, &dump_cmdlist);
   c->completer =  filename_completer;
-  d = XMALLOC (struct dump_context);
+  d = XNEW (struct dump_context);
   d->func = func;
   d->mode = FOPEN_WB;
   set_cmd_context (c, d);
@@ -404,7 +404,7 @@ add_dump_command (char *name, void (*func) (char *args, char *mode),
 
   c = add_cmd (name, all_commands, NULL, descr, &append_cmdlist);
   c->completer =  filename_completer;
-  d = XMALLOC (struct dump_context);
+  d = XNEW (struct dump_context);
   d->func = func;
   d->mode = FOPEN_AB;
   set_cmd_context (c, d);
index 64a1bc11e03422342d0a6db166c7869c2ad3574c..92a3ef6bdef40772af12156e85d25ab1baf01ca8 100644 (file)
@@ -112,7 +112,7 @@ get_complaints (struct complaints **c)
 {
   if ((*c) != NULL)
     return (*c);
-  (*c) = XMALLOC (struct complaints);
+  (*c) = XNEW (struct complaints);
   (*c)->root = &complaint_sentinel;
   (*c)->series = ISOLATED_MESSAGE;
   (*c)->explanation = NULL;
@@ -140,7 +140,7 @@ find_complaint (struct complaints *complaints, const char *file,
     }
 
   /* Oops not seen before, fill in a new complaint.  */
-  complaint = XMALLOC (struct complain);
+  complaint = XNEW (struct complain);
   complaint->fmt = fmt;
   complaint->file = file;
   complaint->line = line;
index 4c70cf67ece42f39945b0bd04c448f9504e43e84..a4770efb9b2ce78067efae7fd9c9e60356f05789 100644 (file)
@@ -556,7 +556,6 @@ extern int longest_to_int (LONGEST);
 /* Utility macros to allocate typed memory.  Avoids errors like:
    struct foo *foo = xmalloc (sizeof struct bar); and memset (foo,
    sizeof (struct foo), 0).  */
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
 #define XCALLOC(NMEMB, TYPE) ((TYPE*) xcalloc ((NMEMB), sizeof (TYPE)))
 
 #include "common-utils.h"
index 3dcaf27580c4fac0ec45febc7dc638441bb8fb80..d6d1bf75c4d40533092616888e314ef5400ea719 100644 (file)
@@ -518,7 +518,7 @@ execute_cfa_program (struct dwarf2_fde *fde, const gdb_byte *insn_ptr,
              {
                struct dwarf2_frame_state_reg_info *new_rs;
 
-               new_rs = XMALLOC (struct dwarf2_frame_state_reg_info);
+               new_rs = XNEW (struct dwarf2_frame_state_reg_info);
                *new_rs = fs->regs;
                fs->regs.reg = dwarf2_frame_state_copy_regs (&fs->regs);
                fs->regs.prev = new_rs;
index 23bcfe07f0e1ee6a2c8aa9654b7890728c18e834..cbe04bead360f732ff29b5bfb042465d24eade9b 100644 (file)
@@ -14724,7 +14724,7 @@ abbrev_table_read_table (struct dwarf2_section_info *section,
   struct attr_abbrev *cur_attrs;
   unsigned int allocated_attrs;
 
-  abbrev_table = XMALLOC (struct abbrev_table);
+  abbrev_table = XNEW (struct abbrev_table);
   abbrev_table->offset = offset;
   obstack_init (&abbrev_table->abbrev_obstack);
   abbrev_table->abbrevs = obstack_alloc (&abbrev_table->abbrev_obstack,
index a605c7d03ec8b07ab1d04291bb6c483754db52db..694fc0df12b35339a8617cd59826c2a7a8da2f17 100644 (file)
@@ -505,7 +505,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
 
   /* Create an obstack for allocating all the per-architecture memory,
      then use that to allocate the architecture vector.  */
-  struct obstack *obstack = XMALLOC (struct obstack);
+  struct obstack *obstack = XNEW (struct obstack);
   obstack_init (obstack);
   gdbarch = obstack_alloc (obstack, sizeof (*gdbarch));
   memset (gdbarch, 0, sizeof (*gdbarch));
@@ -4490,9 +4490,9 @@ gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
   for (curr = &gdbarch_data_registry.registrations;
        (*curr) != NULL;
        curr = &(*curr)->next);
-  (*curr) = XMALLOC (struct gdbarch_data_registration);
+  (*curr) = XNEW (struct gdbarch_data_registration);
   (*curr)->next = NULL;
-  (*curr)->data = XMALLOC (struct gdbarch_data);
+  (*curr)->data = XNEW (struct gdbarch_data);
   (*curr)->data->index = gdbarch_data_registry.nr++;
   (*curr)->data->pre_init = pre_init;
   (*curr)->data->post_init = post_init;
@@ -4661,7 +4661,7 @@ gdbarch_register (enum bfd_architecture bfd_architecture,
                        bfd_arch_info->printable_name,
                        host_address_to_string (init));
   /* Append it */
-  (*curr) = XMALLOC (struct gdbarch_registration);
+  (*curr) = XNEW (struct gdbarch_registration);
   (*curr)->bfd_architecture = bfd_architecture;
   (*curr)->init = init;
   (*curr)->dump_tdep = dump_tdep;
@@ -4805,7 +4805,7 @@ gdbarch_find_by_info (struct gdbarch_info info)
   /* Insert the new architecture into the front of the architecture
      list (keep the list sorted Most Recently Used).  */
   {
-    struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
+    struct gdbarch_list *this = XNEW (struct gdbarch_list);
     this->next = rego->arches;
     this->gdbarch = new_gdbarch;
     rego->arches = this;
index ecbede63672ac2b9fca332bab17e63ec46aa7a0e..ec54d6fb40d0199bf2e4cd21f1aa8e7ceb434312 100755 (executable)
@@ -1645,7 +1645,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
 
   /* Create an obstack for allocating all the per-architecture memory,
      then use that to allocate the architecture vector.  */
-  struct obstack *obstack = XMALLOC (struct obstack);
+  struct obstack *obstack = XNEW (struct obstack);
   obstack_init (obstack);
   gdbarch = obstack_alloc (obstack, sizeof (*gdbarch));
   memset (gdbarch, 0, sizeof (*gdbarch));
@@ -2005,9 +2005,9 @@ gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
   for (curr = &gdbarch_data_registry.registrations;
        (*curr) != NULL;
        curr = &(*curr)->next);
-  (*curr) = XMALLOC (struct gdbarch_data_registration);
+  (*curr) = XNEW (struct gdbarch_data_registration);
   (*curr)->next = NULL;
-  (*curr)->data = XMALLOC (struct gdbarch_data);
+  (*curr)->data = XNEW (struct gdbarch_data);
   (*curr)->data->index = gdbarch_data_registry.nr++;
   (*curr)->data->pre_init = pre_init;
   (*curr)->data->post_init = post_init;
@@ -2176,7 +2176,7 @@ gdbarch_register (enum bfd_architecture bfd_architecture,
                        bfd_arch_info->printable_name,
                        host_address_to_string (init));
   /* Append it */
-  (*curr) = XMALLOC (struct gdbarch_registration);
+  (*curr) = XNEW (struct gdbarch_registration);
   (*curr)->bfd_architecture = bfd_architecture;
   (*curr)->init = init;
   (*curr)->dump_tdep = dump_tdep;
@@ -2320,7 +2320,7 @@ gdbarch_find_by_info (struct gdbarch_info info)
   /* Insert the new architecture into the front of the architecture
      list (keep the list sorted Most Recently Used).  */
   {
-    struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
+    struct gdbarch_list *this = XNEW (struct gdbarch_list);
     this->next = rego->arches;
     this->gdbarch = new_gdbarch;
     rego->arches = this;
index a1c761b03e428ee9770de863d8e76a26a047f7c5..fbc7ed3193ff5b43ae55bcef43a14049250b3186 100644 (file)
@@ -195,7 +195,7 @@ inf_ttrace_add_page (pid_t pid, CORE_ADDR addr)
                  addr, 0, (uintptr_t)&prot) == -1)
        perror_with_name (("ttrace"));
       
-      page = XMALLOC (struct inf_ttrace_page);
+      page = XNEW (struct inf_ttrace_page);
       page->addr = addr;
       page->prot = prot;
       page->refcount = 0;
index 6d0a76f33ecc4313fc482fc9bbf78f44977bba29..e446747085db9ed640eea9e6b160c5c744c9f47c 100644 (file)
@@ -93,7 +93,7 @@ interp_new (const char *name, const struct interp_procs *procs)
 {
   struct interp *new_interp;
 
-  new_interp = XMALLOC (struct interp);
+  new_interp = XNEW (struct interp);
 
   new_interp->name = xstrdup (name);
   new_interp->data = NULL;
index 3ac7f89d5d971a4661d4dbf6f7b511110a33d2ef..bdd5477a9a90d550f44dd88bc3d8295c51ac46da 100644 (file)
@@ -527,7 +527,7 @@ lm32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     return arches->gdbarch;
 
   /* None found, create a new architecture from the information provided.  */
-  tdep = XMALLOC (struct gdbarch_tdep);
+  tdep = XNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
 
   /* Type sizes.  */
index efea81666f9b40f6a7c604681ac807d9228440f2..0ba12768aeef5e25a4949a9a9cd3a15f4ec37204 100644 (file)
@@ -917,7 +917,7 @@ m32r_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     return arches->gdbarch;
 
   /* Allocate space for the new architecture.  */
-  tdep = XMALLOC (struct gdbarch_tdep);
+  tdep = XNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
 
   set_gdbarch_read_pc (gdbarch, m32r_read_pc);
index d2b84912a9a97d2ab80be83502c8d5a194452181..dbad19932cd02eb80538a0f245e1fe972969d249 100644 (file)
@@ -52,7 +52,7 @@ struct ui_file *
 mi_console_file_new (struct ui_file *raw, const char *prefix, char quote)
 {
   struct ui_file *ui_file = ui_file_new ();
-  struct mi_console_file *mi_console = XMALLOC (struct mi_console_file);
+  struct mi_console_file *mi_console = XNEW (struct mi_console_file);
 
   mi_console->magic = &mi_console_file_magic;
   mi_console->raw = raw;
index c13c0f1d9a713bb4b80351a1e7d343b1bc8fc82c..25bf0a12470a376200da34a399563c7b33339c88 100644 (file)
@@ -83,7 +83,7 @@ static int report_initial_inferior (struct inferior *inf, void *closure);
 static void *
 mi_interpreter_init (struct interp *interp, int top_level)
 {
-  struct mi_interp *mi = XMALLOC (struct mi_interp);
+  struct mi_interp *mi = XNEW (struct mi_interp);
   const char *name;
   int mi_version;
 
index 4723d06946253a437ab478a6d4d7999ade3d9b59..a8a3d8dcde3664dc9bf955caa4a7d0976ea110e4 100644 (file)
@@ -411,7 +411,7 @@ mi_out_new (int mi_version)
 {
   int flags = 0;
 
-  mi_out_data *data = XMALLOC (mi_out_data);
+  mi_out_data *data = XNEW (mi_out_data);
   data->suppress_field_separator = 0;
   data->suppress_output = 0;
   data->mi_version = mi_version;
index 73151c20dc02c288f6062a007ec4a11df6662d61..161a16a622c395ebc89bd06ef59557c43b6c9249 100644 (file)
@@ -237,7 +237,7 @@ struct mi_parse *
 mi_parse (const char *cmd, char **token)
 {
   const char *chp;
-  struct mi_parse *parse = XMALLOC (struct mi_parse);
+  struct mi_parse *parse = XNEW (struct mi_parse);
   struct cleanup *cleanup;
 
   memset (parse, 0, sizeof (*parse));
index efca90d67ab817dbc37ab47f86ff1acc20666167..14c1b52e1f5467ebc0767b63c7895b68cba128a0 100644 (file)
@@ -676,7 +676,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     return arches->gdbarch;
 
   /* Allocate space for the new architecture.  */
-  tdep = XMALLOC (struct gdbarch_tdep);
+  tdep = XNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
 
   set_gdbarch_long_double_bit (gdbarch, 128);
index e1992f9343a3420e8fe318e200b85c05482746c9..793e7a475cebed5957ebee4097b7add1c72ff72a 100644 (file)
@@ -1112,7 +1112,7 @@ moxie_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     return arches->gdbarch;
 
   /* Allocate space for the new architecture.  */
-  tdep = XMALLOC (struct gdbarch_tdep);
+  tdep = XNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
 
   set_gdbarch_read_pc (gdbarch, moxie_read_pc);
index 6217c6b14a2694acc3e49de1b4ea2cc7bd7c464d..bd7b7ec0f0b5ba0ef58861e753f80db8f8199be0 100644 (file)
@@ -89,9 +89,9 @@ struct observer_list
 static struct observer_list *
 xalloc_observer_list_node (void)
 {
-  struct observer_list *node = XMALLOC (struct observer_list);
+  struct observer_list *node = XNEW (struct observer_list);
 
-  node->observer = XMALLOC (struct observer);
+  node->observer = XNEW (struct observer);
   return node;
 }
 
index 6c5915b414e6719d61a4bd1f030e36758ebe3b3d..1ddf9b025aef19d0ce44982202352d42044f75dd 100644 (file)
@@ -217,7 +217,7 @@ regcache_xmalloc_1 (struct gdbarch *gdbarch, struct address_space *aspace,
 
   gdb_assert (gdbarch != NULL);
   descr = regcache_descr (gdbarch);
-  regcache = XMALLOC (struct regcache);
+  regcache = XNEW (struct regcache);
   regcache->descr = descr;
   regcache->readonly_p = readonly_p;
   if (readonly_p)
index 94f2a4810f4e388a509dfe7dbe40cb07a65f7938..41ec41a523fc8ec79a21769d2308cdbd5103f96a 100644 (file)
@@ -39,7 +39,7 @@ struct reggroup
 struct reggroup *
 reggroup_new (const char *name, enum reggroup_type type)
 {
-  struct reggroup *group = XMALLOC (struct reggroup);
+  struct reggroup *group = XNEW (struct reggroup);
 
   group->name = name;
   group->type = type;
@@ -277,13 +277,13 @@ _initialize_reggroup (void)
   reggroups_data = gdbarch_data_register_post_init (reggroups_init);
 
   /* The pre-defined list of groups.  */
-  add_group (&default_groups, general_reggroup, XMALLOC (struct reggroup_el));
-  add_group (&default_groups, float_reggroup, XMALLOC (struct reggroup_el));
-  add_group (&default_groups, system_reggroup, XMALLOC (struct reggroup_el));
-  add_group (&default_groups, vector_reggroup, XMALLOC (struct reggroup_el));
-  add_group (&default_groups, all_reggroup, XMALLOC (struct reggroup_el));
-  add_group (&default_groups, save_reggroup, XMALLOC (struct reggroup_el));
-  add_group (&default_groups, restore_reggroup, XMALLOC (struct reggroup_el));
+  add_group (&default_groups, general_reggroup, XNEW (struct reggroup_el));
+  add_group (&default_groups, float_reggroup, XNEW (struct reggroup_el));
+  add_group (&default_groups, system_reggroup, XNEW (struct reggroup_el));
+  add_group (&default_groups, vector_reggroup, XNEW (struct reggroup_el));
+  add_group (&default_groups, all_reggroup, XNEW (struct reggroup_el));
+  add_group (&default_groups, save_reggroup, XNEW (struct reggroup_el));
+  add_group (&default_groups, restore_reggroup, XNEW (struct reggroup_el));
 
   add_cmd ("reggroups", class_maintenance,
           maintenance_print_reggroups, _("\
index 1a3c295908637b2f8625e58e642e3f6d2db0ef51..ed614b9ba6458f6058c262211ce0cc9a6e52d9f3 100644 (file)
@@ -35,9 +35,9 @@ register_data_with_cleanup (struct registry_data_registry *registry,
        curr = &(*curr)->next)
     ;
 
-  *curr = XMALLOC (struct registry_data_registration);
+  *curr = XNEW (struct registry_data_registration);
   (*curr)->next = NULL;
-  (*curr)->data = XMALLOC (struct registry_data);
+  (*curr)->data = XNEW (struct registry_data);
   (*curr)->data->index = registry->num_registrations++;
   (*curr)->data->save = save;
   (*curr)->data->free = free;
index 17edbd241a08e9467a997ec7dd94f93e36778ce0..6560918e3ac271353808c1b9260de3a297c75219 100644 (file)
@@ -5408,7 +5408,7 @@ static struct notif_event *
 remote_notif_stop_alloc_reply (void)
 {
   struct notif_event *r
-    = (struct notif_event *) XMALLOC (struct stop_reply);
+    = (struct notif_event *) XNEW (struct stop_reply);
 
   r->dtr = stop_reply_dtr;
 
index ae92dfb91a63f256f399d7cb7c98c16bdff51b3c..b8f7fd2bf5ffe7cab37311400440df44a57bc469 100644 (file)
@@ -498,14 +498,14 @@ serial_ttystate
 ser_base_get_tty_state (struct serial *scb)
 {
   /* Allocate a dummy.  */
-  return (serial_ttystate) XMALLOC (int);
+  return (serial_ttystate) XNEW (int);
 }
 
 serial_ttystate
 ser_base_copy_tty_state (struct serial *scb, serial_ttystate ttystate)
 {
   /* Allocate another dummy.  */
-  return (serial_ttystate) XMALLOC (int);
+  return (serial_ttystate) XNEW (int);
 }
 
 int
index 7247f50e100b2cdaf379337f63c98b43f1f8c10c..db049991e87c1bd4f8fca770cbd9c50415150677 100644 (file)
@@ -788,7 +788,7 @@ struct pipe_state
 static struct pipe_state *
 make_pipe_state (void)
 {
-  struct pipe_state *ps = XMALLOC (struct pipe_state);
+  struct pipe_state *ps = XNEW (struct pipe_state);
 
   memset (ps, 0, sizeof (*ps));
   ps->wait.read_event = INVALID_HANDLE_VALUE;
index 9c5b99b45c980d00a46842994470d18106076392..9568a26c0ee7a3d968851f33c3db2420a86649ba 100644 (file)
@@ -134,7 +134,7 @@ pipe_open (struct serial *scb, const char *name)
   if (err_pdes[1] != -1)
     close (err_pdes[1]);
   /* :end chunk */
-  state = XMALLOC (struct pipe_state);
+  state = XNEW (struct pipe_state);
   state->pid = pid;
   scb->fd = pdes[0];
   scb->error_fd = err_pdes[0];
index 99e33ab568c51cff0c179acd515926ddf2501884..c87875fc96b7c415791aebbef194fa1d886072b6 100644 (file)
@@ -211,7 +211,7 @@ serial_open (const char *name)
   if (!ops)
     return NULL;
 
-  scb = XMALLOC (struct serial);
+  scb = XNEW (struct serial);
 
   scb->ops = ops;
 
index 547f1390ac07096c8b6a0de0c9458694ed0eb766..262de84cf99a53bd3d606a65c403866760fd31e4 100644 (file)
@@ -2370,7 +2370,7 @@ sh64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   /* None found, create a new architecture from the information
      provided.  */
-  tdep = XMALLOC (struct gdbarch_tdep);
+  tdep = XNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
 
   /* Determine the ABI */
index 1ceb80fef00eb37050a88779cef206cfc8600867..4deb006028b7110c0dacc568e5c66f4de50fea8d 100644 (file)
@@ -447,7 +447,7 @@ tui_alloc_generic_win_info (void)
 {
   struct tui_gen_win_info *win;
 
-  if ((win = XMALLOC (struct tui_gen_win_info)) != NULL)
+  if ((win = XNEW (struct tui_gen_win_info)) != NULL)
     tui_init_generic_part (win);
 
   return win;
@@ -570,7 +570,7 @@ tui_alloc_win_info (enum tui_win_type type)
 {
   struct tui_win_info *win_info;
 
-  win_info = XMALLOC (struct tui_win_info);
+  win_info = XNEW (struct tui_win_info);
   if (win_info != NULL)
     {
       win_info->generic.type = type;
@@ -647,7 +647,7 @@ tui_add_content_elements (struct tui_gen_win_info *win_info,
     {
       for (i = index_start; (i < num_elements + index_start); i++)
        {
-         if ((element_ptr = XMALLOC (struct tui_win_element)) != NULL)
+         if ((element_ptr = XNEW (struct tui_win_element)) != NULL)
            {
              win_info->content[i] = (void *) element_ptr;
              init_content_element (element_ptr, win_info->type);
index c86e2603e0333ac731e506407feca961f2d814ea..8e84fc53a1bfaea4b6aee116cefc708f1be4d586 100644 (file)
@@ -57,7 +57,7 @@ static int tui_file_magic;
 static struct ui_file *
 tui_file_new (void)
 {
-  struct tui_stream *tui = XMALLOC (struct tui_stream);
+  struct tui_stream *tui = XNEW (struct tui_stream);
   struct ui_file *file = ui_file_new ();
 
   set_ui_file_data (file, tui, tui_file_delete);
index 9e89419ce11e2e14018b794701e2c056b9c72354..44f76a26feddfe445ee376dc729d35ea4629243a 100644 (file)
@@ -150,7 +150,7 @@ tui_out_new (struct ui_file *stream)
 {
   int flags = 0;
 
-  tui_out_data *data = XMALLOC (tui_out_data);
+  tui_out_data *data = XNEW (tui_out_data);
 
   /* Initialize base "class".  */
   cli_out_data_ctor (&data->base, stream);
index 4de5785f558e52550aa9dadd643934c72d2d3081..e59d70ba0c80f54b5c6e88fe1d2f266a960bfe65 100644 (file)
@@ -393,7 +393,7 @@ static int mem_file_magic;
 static struct ui_file *
 mem_file_new (void)
 {
-  struct mem_file *stream = XMALLOC (struct mem_file);
+  struct mem_file *stream = XNEW (struct mem_file);
   struct ui_file *file = ui_file_new ();
 
   set_ui_file_data (file, stream, mem_file_delete);
index d0dc2f470b371770c28a7ae4691257121b1b5d8e..a5913527ddb3e2ba754f730c8aa5a31e6ea3cfe4 100644 (file)
@@ -131,7 +131,7 @@ push_level (struct ui_out *uiout,
   struct ui_out_level *current;
 
   uiout->level++;
-  current = XMALLOC (struct ui_out_level);
+  current = XNEW (struct ui_out_level);
   current->field_count = 0;
   current->type = type;
   VEC_safe_push (ui_out_level_p, uiout->levels, current);
@@ -443,7 +443,7 @@ make_cleanup_ui_out_end (struct ui_out *uiout,
 {
   struct ui_out_end_cleanup_data *end_cleanup_data;
 
-  end_cleanup_data = XMALLOC (struct ui_out_end_cleanup_data);
+  end_cleanup_data = XNEW (struct ui_out_end_cleanup_data);
   end_cleanup_data->uiout = uiout;
   end_cleanup_data->type = type;
   return make_cleanup (do_cleanup_end, end_cleanup_data);
@@ -964,7 +964,7 @@ append_header_to_list (struct ui_out *uiout,
 {
   struct ui_out_hdr *temphdr;
 
-  temphdr = XMALLOC (struct ui_out_hdr);
+  temphdr = XNEW (struct ui_out_hdr);
   temphdr->width = width;
   temphdr->alignment = alignment;
   /* We have to copy the column title as the original may be an
@@ -1098,8 +1098,8 @@ struct ui_out *
 ui_out_new (struct ui_out_impl *impl, void *data,
            int flags)
 {
-  struct ui_out *uiout = XMALLOC (struct ui_out);
-  struct ui_out_level *current = XMALLOC (struct ui_out_level);
+  struct ui_out *uiout = XNEW (struct ui_out);
+  struct ui_out_level *current = XNEW (struct ui_out_level);
 
   uiout->data = data;
   uiout->impl = impl;
index 480c968c81031e1b7cc3508b406d6a959354fa08..db0cac8e6916d10b99fa9f2c73ecd9326e591fad 100644 (file)
@@ -85,7 +85,7 @@ user_reg_add_builtin (const char *name, user_reg_read_ftype *read,
                      const void *baton)
 {
   append_user_reg (&builtin_user_regs, name, read, baton,
-                  XMALLOC (struct user_reg));
+                  XNEW (struct user_reg));
 }
 
 /* Per-architecture user registers.  Start with the builtin user
This page took 0.053806 seconds and 4 git commands to generate.