replace XZALLOC with XCNEW

This replaces XZALLOC with XCNEW and removes XZALLOC.
This change is purely mechanical.

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

	* defs.h (XZALLOC): Remove.
	* ada-lang.c (get_ada_inferior_data): Use XCNEW, not XZALLOC.
	* ada-tasks.c (get_ada_tasks_pspace_data): Likewise.
	(get_ada_tasks_inferior_data): Likewise.
	* auto-load.c (get_auto_load_pspace_data): Likewise.
	* auxv.c (get_auxv_inferior_data): Likewise.
	* bfd-target.c (target_bfd_reopen): Likewise.
	* breakpoint.c (get_catch_syscall_inferior_data): Likewise.
	(deprecated_insert_raw_breakpoint): Likewise.
	* bsd-uthread.c (bsd_uthread_pid_to_str): Likewise.
	* corelow.c (core_open): Likewise.
	* darwin-nat.c (darwin_check_new_threads): Likewise.
	(darwin_attach_pid): Likewise.
	* dummy-frame.c (dummy_frame_push): Likewise.
	* dwarf2-frame.c (dwarf2_frame_cache): Likewise.
	* dwarf2loc.c (allocate_piece_closure): Likewise.
	* elfread.c (elf_symfile_segments): Likewise.
	* eval.c (ptrmath_type_p): Likewise.
	* exceptions.c (EXCEPTIONS_SIGJMP_BUF): Likewise.
	* gdbtypes.c (alloc_type_arch): Likewise.
	(alloc_type_instance): Likewise.
	* hppa-tdep.c (hppa_gdbarch_init): Likewise.
	* inf-child.c (inf_child_can_use_agent): Likewise.
	* inflow.c (get_inflow_inferior_data): Likewise.
	* infrun.c (save_infcall_suspend_state): Likewise.
	* jit.c (jit_reader_load): Likewise.
	(get_jit_objfile_data): Likewise.
	(get_jit_program_space_data): Likewise.
	(jit_object_open_impl): Likewise.
	(jit_symtab_open_impl): Likewise.
	(jit_block_open_impl): Likewise.
	(jit_frame_sniffer): Likewise.
	* linux-fork.c (add_fork): Likewise.
	* maint.c (make_command_stats_cleanup): Likewise.
	* objfiles.c (get_objfile_pspace_data): Likewise.
	* opencl-lang.c (struct lval_closure): Likewise.
	* osdata.c (osdata_start_osdata): Likewise.
	* progspace.c (new_address_space): Likewise.
	(add_program_space): Likewise.
	* remote-sim.c (get_sim_inferior_data): Likewise.
	* sh-tdep.c (sh_gdbarch_init): Likewise.
	* skip.c (Ignore): Likewise.
	(skip_delete_command): Likewise.
	* solib-aix.c (get_solib_aix_inferior_data): Likewise.
	(library_list_start_library): Likewise.
	(solib_aix_current_sos): Likewise.
	* solib-darwin.c (get_darwin_info): Likewise.
	(darwin_current_sos): Likewise.
	* solib-dsbt.c (get_dsbt_info): Likewise.
	* solib-ia64-hpux.c (new_so_list): Likewise.
	(ia64_hpux_get_solib_linkage_addr): Likewise.
	* solib-spu.c (append_ocl_sos): Likewise.
	(spu_current_sos): Likewise.
	* solib-svr4.c (get_svr4_info): Likewise.
	(svr4_keep_data_in_core): Likewise.
	(library_list_start_library): Likewise.
	(svr4_default_sos): Likewise.
	(svr4_read_so_list): Likewise.
	* solib-target.c (library_list_start_library): Likewise.
	(solib_target_current_sos): Likewise.
	* sparc-tdep.c (sparc32_gdbarch_init): Likewise.
	* symfile-debug.c (install_symfile_debug_logging): Likewise.
	* symfile.c (default_symfile_segments): Likewise.
	* target-descriptions.c (tdesc_data_init): Likewise.
	(tdesc_create_reg): Likewise.
	(struct tdesc_type *): Likewise.
	(tdesc_create_vector): Likewise.
	(tdesc_set_struct_size): Likewise.
	(struct tdesc_type *): Likewise.
	(tdesc_free_feature): Likewise.
	(tdesc_create_feature): Likewise.
	* windows-nat.c (windows_add_thread): Likewise.
	(windows_make_so): Likewise.
	* xml-support.c (gdb_xml_body_text): Likewise.
	(gdb_xml_create_parser_and_cleanup): Likewise.
	(xml_process_xincludes): Likewise.
	* xml-syscall.c (allocate_syscalls_info): Likewise.
	(syscall_create_syscall_desc): Likewise.
This commit is contained in:
Tom Tromey 2013-12-28 15:31:01 -07:00
parent aa726b9e09
commit 41bf6acad7
46 changed files with 163 additions and 83 deletions

View file

@ -1,3 +1,84 @@
2014-01-13 Tom Tromey <tromey@redhat.com>
* defs.h (XZALLOC): Remove.
* ada-lang.c (get_ada_inferior_data): Use XCNEW, not XZALLOC.
* ada-tasks.c (get_ada_tasks_pspace_data): Likewise.
(get_ada_tasks_inferior_data): Likewise.
* auto-load.c (get_auto_load_pspace_data): Likewise.
* auxv.c (get_auxv_inferior_data): Likewise.
* bfd-target.c (target_bfd_reopen): Likewise.
* breakpoint.c (get_catch_syscall_inferior_data): Likewise.
(deprecated_insert_raw_breakpoint): Likewise.
* bsd-uthread.c (bsd_uthread_pid_to_str): Likewise.
* corelow.c (core_open): Likewise.
* darwin-nat.c (darwin_check_new_threads): Likewise.
(darwin_attach_pid): Likewise.
* dummy-frame.c (dummy_frame_push): Likewise.
* dwarf2-frame.c (dwarf2_frame_cache): Likewise.
* dwarf2loc.c (allocate_piece_closure): Likewise.
* elfread.c (elf_symfile_segments): Likewise.
* eval.c (ptrmath_type_p): Likewise.
* exceptions.c (EXCEPTIONS_SIGJMP_BUF): Likewise.
* gdbtypes.c (alloc_type_arch): Likewise.
(alloc_type_instance): Likewise.
* hppa-tdep.c (hppa_gdbarch_init): Likewise.
* inf-child.c (inf_child_can_use_agent): Likewise.
* inflow.c (get_inflow_inferior_data): Likewise.
* infrun.c (save_infcall_suspend_state): Likewise.
* jit.c (jit_reader_load): Likewise.
(get_jit_objfile_data): Likewise.
(get_jit_program_space_data): Likewise.
(jit_object_open_impl): Likewise.
(jit_symtab_open_impl): Likewise.
(jit_block_open_impl): Likewise.
(jit_frame_sniffer): Likewise.
* linux-fork.c (add_fork): Likewise.
* maint.c (make_command_stats_cleanup): Likewise.
* objfiles.c (get_objfile_pspace_data): Likewise.
* opencl-lang.c (struct lval_closure): Likewise.
* osdata.c (osdata_start_osdata): Likewise.
* progspace.c (new_address_space): Likewise.
(add_program_space): Likewise.
* remote-sim.c (get_sim_inferior_data): Likewise.
* sh-tdep.c (sh_gdbarch_init): Likewise.
* skip.c (Ignore): Likewise.
(skip_delete_command): Likewise.
* solib-aix.c (get_solib_aix_inferior_data): Likewise.
(library_list_start_library): Likewise.
(solib_aix_current_sos): Likewise.
* solib-darwin.c (get_darwin_info): Likewise.
(darwin_current_sos): Likewise.
* solib-dsbt.c (get_dsbt_info): Likewise.
* solib-ia64-hpux.c (new_so_list): Likewise.
(ia64_hpux_get_solib_linkage_addr): Likewise.
* solib-spu.c (append_ocl_sos): Likewise.
(spu_current_sos): Likewise.
* solib-svr4.c (get_svr4_info): Likewise.
(svr4_keep_data_in_core): Likewise.
(library_list_start_library): Likewise.
(svr4_default_sos): Likewise.
(svr4_read_so_list): Likewise.
* solib-target.c (library_list_start_library): Likewise.
(solib_target_current_sos): Likewise.
* sparc-tdep.c (sparc32_gdbarch_init): Likewise.
* symfile-debug.c (install_symfile_debug_logging): Likewise.
* symfile.c (default_symfile_segments): Likewise.
* target-descriptions.c (tdesc_data_init): Likewise.
(tdesc_create_reg): Likewise.
(struct tdesc_type *): Likewise.
(tdesc_create_vector): Likewise.
(tdesc_set_struct_size): Likewise.
(struct tdesc_type *): Likewise.
(tdesc_free_feature): Likewise.
(tdesc_create_feature): Likewise.
* windows-nat.c (windows_add_thread): Likewise.
(windows_make_so): Likewise.
* xml-support.c (gdb_xml_body_text): Likewise.
(gdb_xml_create_parser_and_cleanup): Likewise.
(xml_process_xincludes): Likewise.
* xml-syscall.c (allocate_syscalls_info): Likewise.
(syscall_create_syscall_desc): Likewise.
2014-01-12 Sergio Durigan Junior <sergiodj@redhat.com> 2014-01-12 Sergio Durigan Junior <sergiodj@redhat.com>
* i386-tdep.c (i386_stap_parse_special_token_triplet): New * i386-tdep.c (i386_stap_parse_special_token_triplet): New

View file

@ -358,7 +358,7 @@ get_ada_inferior_data (struct inferior *inf)
data = inferior_data (inf, ada_inferior_data); data = inferior_data (inf, ada_inferior_data);
if (data == NULL) if (data == NULL)
{ {
data = XZALLOC (struct ada_inferior_data); data = XCNEW (struct ada_inferior_data);
set_inferior_data (inf, ada_inferior_data, data); set_inferior_data (inf, ada_inferior_data, data);
} }

View file

@ -251,7 +251,7 @@ get_ada_tasks_pspace_data (struct program_space *pspace)
data = program_space_data (pspace, ada_tasks_pspace_data_handle); data = program_space_data (pspace, ada_tasks_pspace_data_handle);
if (data == NULL) if (data == NULL)
{ {
data = XZALLOC (struct ada_tasks_pspace_data); data = XCNEW (struct ada_tasks_pspace_data);
set_program_space_data (pspace, ada_tasks_pspace_data_handle, data); set_program_space_data (pspace, ada_tasks_pspace_data_handle, data);
} }
@ -278,7 +278,7 @@ get_ada_tasks_inferior_data (struct inferior *inf)
data = inferior_data (inf, ada_tasks_inferior_data_handle); data = inferior_data (inf, ada_tasks_inferior_data_handle);
if (data == NULL) if (data == NULL)
{ {
data = XZALLOC (struct ada_tasks_inferior_data); data = XCNEW (struct ada_tasks_inferior_data);
set_inferior_data (inf, ada_tasks_inferior_data_handle, data); set_inferior_data (inf, ada_tasks_inferior_data_handle, data);
} }

View file

@ -595,7 +595,7 @@ get_auto_load_pspace_data (struct program_space *pspace)
info = program_space_data (pspace, auto_load_pspace_data); info = program_space_data (pspace, auto_load_pspace_data);
if (info == NULL) if (info == NULL)
{ {
info = XZALLOC (struct auto_load_pspace_info); info = XCNEW (struct auto_load_pspace_info);
set_program_space_data (pspace, auto_load_pspace_data, info); set_program_space_data (pspace, auto_load_pspace_data, info);
} }

View file

@ -341,7 +341,7 @@ get_auxv_inferior_data (struct target_ops *ops)
info = inferior_data (inf, auxv_inferior_data); info = inferior_data (inf, auxv_inferior_data);
if (info == NULL) if (info == NULL)
{ {
info = XZALLOC (struct auxv_info); info = XCNEW (struct auxv_info);
info->length = target_read_alloc (ops, TARGET_OBJECT_AUXV, info->length = target_read_alloc (ops, TARGET_OBJECT_AUXV,
NULL, &info->data); NULL, &info->data);
set_inferior_data (inf, auxv_inferior_data, info); set_inferior_data (inf, auxv_inferior_data, info);

View file

@ -83,12 +83,12 @@ target_bfd_reopen (struct bfd *abfd)
struct target_ops *t; struct target_ops *t;
struct target_bfd_data *data; struct target_bfd_data *data;
data = XZALLOC (struct target_bfd_data); data = XCNEW (struct target_bfd_data);
data->bfd = abfd; data->bfd = abfd;
gdb_bfd_ref (abfd); gdb_bfd_ref (abfd);
build_section_table (abfd, &data->table.sections, &data->table.sections_end); build_section_table (abfd, &data->table.sections, &data->table.sections_end);
t = XZALLOC (struct target_ops); t = XCNEW (struct target_ops);
t->to_shortname = "bfd"; t->to_shortname = "bfd";
t->to_longname = _("BFD backed target"); t->to_longname = _("BFD backed target");
t->to_doc = _("You should never see this"); t->to_doc = _("You should never see this");

View file

@ -8238,7 +8238,7 @@ get_catch_syscall_inferior_data (struct inferior *inf)
inf_data = inferior_data (inf, catch_syscall_inferior_data); inf_data = inferior_data (inf, catch_syscall_inferior_data);
if (inf_data == NULL) if (inf_data == NULL)
{ {
inf_data = XZALLOC (struct catch_syscall_inferior_data); inf_data = XCNEW (struct catch_syscall_inferior_data);
set_inferior_data (inf, catch_syscall_inferior_data, inf_data); set_inferior_data (inf, catch_syscall_inferior_data, inf_data);
} }
@ -14994,7 +14994,7 @@ deprecated_insert_raw_breakpoint (struct gdbarch *gdbarch,
{ {
struct bp_target_info *bp_tgt; struct bp_target_info *bp_tgt;
bp_tgt = XZALLOC (struct bp_target_info); bp_tgt = XCNEW (struct bp_target_info);
bp_tgt->placed_address_space = aspace; bp_tgt->placed_address_space = aspace;
bp_tgt->placed_address = pc; bp_tgt->placed_address = pc;

View file

@ -518,7 +518,7 @@ bsd_uthread_pid_to_str (struct target_ops *ops, ptid_t ptid)
static struct target_ops * static struct target_ops *
bsd_uthread_target (void) bsd_uthread_target (void)
{ {
struct target_ops *t = XZALLOC (struct target_ops); struct target_ops *t = XCNEW (struct target_ops);
t->to_shortname = "bsd-uthreads"; t->to_shortname = "bsd-uthreads";
t->to_longname = "BSD user-level threads"; t->to_longname = "BSD user-level threads";

View file

@ -348,7 +348,7 @@ core_open (char *filename, int from_tty)
validate_files (); validate_files ();
core_data = XZALLOC (struct target_section_table); core_data = XCNEW (struct target_section_table);
/* Find the data section */ /* Find the data section */
if (build_section_table (core_bfd, if (build_section_table (core_bfd,

View file

@ -350,7 +350,7 @@ darwin_check_new_threads (struct inferior *inf)
struct thread_info *tp; struct thread_info *tp;
struct private_thread_info *pti; struct private_thread_info *pti;
pti = XZALLOC (struct private_thread_info); pti = XCNEW (struct private_thread_info);
pti->gdb_port = new_id; pti->gdb_port = new_id;
pti->msg_state = DARWIN_RUNNING; pti->msg_state = DARWIN_RUNNING;
@ -1344,7 +1344,7 @@ darwin_attach_pid (struct inferior *inf)
mach_port_t prev_not; mach_port_t prev_not;
exception_mask_t mask; exception_mask_t mask;
inf->private = XZALLOC (darwin_inferior); inf->private = XCNEW (darwin_inferior);
kret = task_for_pid (gdb_task, inf->pid, &inf->private->task); kret = task_for_pid (gdb_task, inf->pid, &inf->private->task);
if (kret != KERN_SUCCESS) if (kret != KERN_SUCCESS)

View file

@ -556,7 +556,6 @@ extern int longest_to_int (LONGEST);
/* Utility macros to allocate typed memory. Avoids errors like: /* Utility macros to allocate typed memory. Avoids errors like:
struct foo *foo = xmalloc (sizeof struct bar); and memset (foo, struct foo *foo = xmalloc (sizeof struct bar); and memset (foo,
sizeof (struct foo), 0). */ sizeof (struct foo), 0). */
#define XZALLOC(TYPE) ((TYPE*) xzalloc (sizeof (TYPE)))
#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE))) #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
#define XCALLOC(NMEMB, TYPE) ((TYPE*) xcalloc ((NMEMB), sizeof (TYPE))) #define XCALLOC(NMEMB, TYPE) ((TYPE*) xcalloc ((NMEMB), sizeof (TYPE)))

View file

@ -56,7 +56,7 @@ dummy_frame_push (struct infcall_suspend_state *caller_state,
{ {
struct dummy_frame *dummy_frame; struct dummy_frame *dummy_frame;
dummy_frame = XZALLOC (struct dummy_frame); dummy_frame = XCNEW (struct dummy_frame);
dummy_frame->caller_state = caller_state; dummy_frame->caller_state = caller_state;
dummy_frame->id = (*dummy_id); dummy_frame->id = (*dummy_id);
dummy_frame->next = dummy_frame_stack; dummy_frame->next = dummy_frame_stack;

View file

@ -1045,7 +1045,7 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
reset_cache_cleanup = make_cleanup (clear_pointer_cleanup, this_cache); reset_cache_cleanup = make_cleanup (clear_pointer_cleanup, this_cache);
/* Allocate and initialize the frame state. */ /* Allocate and initialize the frame state. */
fs = XZALLOC (struct dwarf2_frame_state); fs = XCNEW (struct dwarf2_frame_state);
old_chain = make_cleanup (dwarf2_frame_state_free, fs); old_chain = make_cleanup (dwarf2_frame_state_free, fs);
/* Unwind the PC. /* Unwind the PC.

View file

@ -1414,7 +1414,7 @@ allocate_piece_closure (struct dwarf2_per_cu_data *per_cu,
int n_pieces, struct dwarf_expr_piece *pieces, int n_pieces, struct dwarf_expr_piece *pieces,
int addr_size) int addr_size)
{ {
struct piece_closure *c = XZALLOC (struct piece_closure); struct piece_closure *c = XCNEW (struct piece_closure);
int i; int i;
c->refc = 1; c->refc = 1;

View file

@ -105,7 +105,7 @@ elf_symfile_segments (bfd *abfd)
if (num_segments == 0) if (num_segments == 0)
return NULL; return NULL;
data = XZALLOC (struct symfile_segment_data); data = XCNEW (struct symfile_segment_data);
data->num_segments = num_segments; data->num_segments = num_segments;
data->segment_bases = XCALLOC (num_segments, CORE_ADDR); data->segment_bases = XCALLOC (num_segments, CORE_ADDR);
data->segment_sizes = XCALLOC (num_segments, CORE_ADDR); data->segment_sizes = XCALLOC (num_segments, CORE_ADDR);

View file

@ -660,8 +660,8 @@ ptrmath_type_p (const struct language_defn *lang, struct type *type)
static struct type * static struct type *
make_params (int num_types, struct type **param_types) make_params (int num_types, struct type **param_types)
{ {
struct type *type = XZALLOC (struct type); struct type *type = XCNEW (struct type);
TYPE_MAIN_TYPE (type) = XZALLOC (struct main_type); TYPE_MAIN_TYPE (type) = XCNEW (struct main_type);
TYPE_LENGTH (type) = 1; TYPE_LENGTH (type) = 1;
TYPE_CODE (type) = TYPE_CODE_METHOD; TYPE_CODE (type) = TYPE_CODE_METHOD;
TYPE_VPTR_FIELDNO (type) = -1; TYPE_VPTR_FIELDNO (type) = -1;

View file

@ -86,7 +86,7 @@ EXCEPTIONS_SIGJMP_BUF *
exceptions_state_mc_init (volatile struct gdb_exception *exception, exceptions_state_mc_init (volatile struct gdb_exception *exception,
return_mask mask) return_mask mask)
{ {
struct catcher *new_catcher = XZALLOC (struct catcher); struct catcher *new_catcher = XCNEW (struct catcher);
/* Start with no exception, save it's address. */ /* Start with no exception, save it's address. */
exception->reason = 0; exception->reason = 0;

View file

@ -201,8 +201,8 @@ alloc_type_arch (struct gdbarch *gdbarch)
/* Alloc the structure and start off with all fields zeroed. */ /* Alloc the structure and start off with all fields zeroed. */
type = XZALLOC (struct type); type = XCNEW (struct type);
TYPE_MAIN_TYPE (type) = XZALLOC (struct main_type); TYPE_MAIN_TYPE (type) = XCNEW (struct main_type);
TYPE_OBJFILE_OWNED (type) = 0; TYPE_OBJFILE_OWNED (type) = 0;
TYPE_OWNER (type).gdbarch = gdbarch; TYPE_OWNER (type).gdbarch = gdbarch;
@ -268,7 +268,7 @@ alloc_type_instance (struct type *oldtype)
/* Allocate the structure. */ /* Allocate the structure. */
if (! TYPE_OBJFILE_OWNED (oldtype)) if (! TYPE_OBJFILE_OWNED (oldtype))
type = XZALLOC (struct type); type = XCNEW (struct type);
else else
type = OBSTACK_ZALLOC (&TYPE_OBJFILE (oldtype)->objfile_obstack, type = OBSTACK_ZALLOC (&TYPE_OBJFILE (oldtype)->objfile_obstack,
struct type); struct type);

View file

@ -2997,7 +2997,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
return (arches->gdbarch); return (arches->gdbarch);
/* If none found, then allocate and initialize one. */ /* If none found, then allocate and initialize one. */
tdep = XZALLOC (struct gdbarch_tdep); tdep = XCNEW (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep); gdbarch = gdbarch_alloc (&info, tdep);
/* Determine from the bfd_arch_info structure if we are dealing with /* Determine from the bfd_arch_info structure if we are dealing with

View file

@ -386,7 +386,7 @@ inf_child_can_use_agent (void)
struct target_ops * struct target_ops *
inf_child_target (void) inf_child_target (void)
{ {
struct target_ops *t = XZALLOC (struct target_ops); struct target_ops *t = XCNEW (struct target_ops);
t->to_shortname = "child"; t->to_shortname = "child";
t->to_longname = "Unix child process"; t->to_longname = "Unix child process";

View file

@ -505,7 +505,7 @@ get_inflow_inferior_data (struct inferior *inf)
info = inferior_data (inf, inflow_inferior_data); info = inferior_data (inf, inflow_inferior_data);
if (info == NULL) if (info == NULL)
{ {
info = XZALLOC (struct terminal_info); info = XCNEW (struct terminal_info);
set_inferior_data (inf, inflow_inferior_data, info); set_inferior_data (inf, inflow_inferior_data, info);
} }

View file

@ -6851,7 +6851,7 @@ save_infcall_suspend_state (void)
} }
} }
inf_state = XZALLOC (struct infcall_suspend_state); inf_state = XCNEW (struct infcall_suspend_state);
if (siginfo_data) if (siginfo_data)
{ {

View file

@ -189,7 +189,7 @@ jit_reader_load (const char *file_name)
if (funcs->reader_version != GDB_READER_INTERFACE_VERSION) if (funcs->reader_version != GDB_READER_INTERFACE_VERSION)
error (_("Reader version does not match GDB version.")); error (_("Reader version does not match GDB version."));
new_reader = XZALLOC (struct jit_reader); new_reader = XCNEW (struct jit_reader);
new_reader->functions = funcs; new_reader->functions = funcs;
new_reader->handle = so; new_reader->handle = so;
@ -288,7 +288,7 @@ get_jit_objfile_data (struct objfile *objf)
objf_data = objfile_data (objf, jit_objfile_data); objf_data = objfile_data (objf, jit_objfile_data);
if (objf_data == NULL) if (objf_data == NULL)
{ {
objf_data = XZALLOC (struct jit_objfile_data); objf_data = XCNEW (struct jit_objfile_data);
set_objfile_data (objf, jit_objfile_data, objf_data); set_objfile_data (objf, jit_objfile_data, objf_data);
} }
@ -318,7 +318,7 @@ get_jit_program_space_data (void)
ps_data = program_space_data (current_program_space, jit_program_space_data); ps_data = program_space_data (current_program_space, jit_program_space_data);
if (ps_data == NULL) if (ps_data == NULL)
{ {
ps_data = XZALLOC (struct jit_program_space_data); ps_data = XCNEW (struct jit_program_space_data);
set_program_space_data (current_program_space, jit_program_space_data, set_program_space_data (current_program_space, jit_program_space_data,
ps_data); ps_data);
} }
@ -504,7 +504,7 @@ jit_object_open_impl (struct gdb_symbol_callbacks *cb)
/* CB is not required right now, but sometime in the future we might /* CB is not required right now, but sometime in the future we might
need a handle to it, and we'd like to do that without breaking need a handle to it, and we'd like to do that without breaking
the ABI. */ the ABI. */
return XZALLOC (struct gdb_object); return XCNEW (struct gdb_object);
} }
/* Readers call into this function to open a new gdb_symtab, which, /* Readers call into this function to open a new gdb_symtab, which,
@ -519,7 +519,7 @@ jit_symtab_open_impl (struct gdb_symbol_callbacks *cb,
/* CB stays unused. See comment in jit_object_open_impl. */ /* CB stays unused. See comment in jit_object_open_impl. */
ret = XZALLOC (struct gdb_symtab); ret = XCNEW (struct gdb_symtab);
ret->file_name = file_name ? xstrdup (file_name) : xstrdup (""); ret->file_name = file_name ? xstrdup (file_name) : xstrdup ("");
ret->next = object->symtabs; ret->next = object->symtabs;
object->symtabs = ret; object->symtabs = ret;
@ -557,7 +557,7 @@ jit_block_open_impl (struct gdb_symbol_callbacks *cb,
struct gdb_symtab *symtab, struct gdb_block *parent, struct gdb_symtab *symtab, struct gdb_block *parent,
GDB_CORE_ADDR begin, GDB_CORE_ADDR end, const char *name) GDB_CORE_ADDR begin, GDB_CORE_ADDR end, const char *name)
{ {
struct gdb_block *block = XZALLOC (struct gdb_block); struct gdb_block *block = XCNEW (struct gdb_block);
block->next = symtab->blocks; block->next = symtab->blocks;
block->begin = (CORE_ADDR) begin; block->begin = (CORE_ADDR) begin;
@ -1181,7 +1181,7 @@ jit_frame_sniffer (const struct frame_unwind *self,
gdb_assert (!*cache); gdb_assert (!*cache);
*cache = XZALLOC (struct jit_unwind_private); *cache = XCNEW (struct jit_unwind_private);
priv_data = *cache; priv_data = *cache;
priv_data->registers = priv_data->registers =
XCALLOC (gdbarch_num_regs (get_frame_arch (this_frame)), XCALLOC (gdbarch_num_regs (get_frame_arch (this_frame)),

View file

@ -81,7 +81,7 @@ add_fork (pid_t pid)
add_fork (ptid_get_pid (inferior_ptid)); /* safe recursion */ add_fork (ptid_get_pid (inferior_ptid)); /* safe recursion */
} }
fp = XZALLOC (struct fork_info); fp = XCNEW (struct fork_info);
fp->ptid = ptid_build (pid, pid, 0); fp->ptid = ptid_build (pid, pid, 0);
fp->num = ++highest_fork_num; fp->num = ++highest_fork_num;
fp->next = fork_list; fp->next = fork_list;

View file

@ -902,7 +902,7 @@ make_command_stats_cleanup (int msg_type)
&& !per_command_symtab) && !per_command_symtab)
return make_cleanup (null_cleanup, 0); return make_cleanup (null_cleanup, 0);
new_stat = XZALLOC (struct cmd_stats); new_stat = XCNEW (struct cmd_stats);
new_stat->msg_type = msg_type; new_stat->msg_type = msg_type;

View file

@ -102,7 +102,7 @@ get_objfile_pspace_data (struct program_space *pspace)
info = program_space_data (pspace, objfiles_pspace_data); info = program_space_data (pspace, objfiles_pspace_data);
if (info == NULL) if (info == NULL)
{ {
info = XZALLOC (struct objfile_pspace_info); info = XCNEW (struct objfile_pspace_info);
set_program_space_data (pspace, objfiles_pspace_data, info); set_program_space_data (pspace, objfiles_pspace_data, info);
} }

View file

@ -156,7 +156,7 @@ struct lval_closure
static struct lval_closure * static struct lval_closure *
allocate_lval_closure (int *indices, int n, struct value *val) allocate_lval_closure (int *indices, int n, struct value *val)
{ {
struct lval_closure *c = XZALLOC (struct lval_closure); struct lval_closure *c = XCNEW (struct lval_closure);
c->refc = 1; c->refc = 1;
c->n = n; c->n = n;

View file

@ -67,7 +67,7 @@ osdata_start_osdata (struct gdb_xml_parser *parser,
gdb_xml_error (parser, _("Seen more than on osdata element")); gdb_xml_error (parser, _("Seen more than on osdata element"));
type = xml_find_attribute (attributes, "type")->value; type = xml_find_attribute (attributes, "type")->value;
osdata = XZALLOC (struct osdata); osdata = XCNEW (struct osdata);
osdata->type = xstrdup (type); osdata->type = xstrdup (type);
data->osdata = osdata; data->osdata = osdata;
} }

View file

@ -70,7 +70,7 @@ new_address_space (void)
{ {
struct address_space *aspace; struct address_space *aspace;
aspace = XZALLOC (struct address_space); aspace = XCNEW (struct address_space);
aspace->num = ++highest_address_space_num; aspace->num = ++highest_address_space_num;
address_space_alloc_data (aspace); address_space_alloc_data (aspace);
@ -126,7 +126,7 @@ add_program_space (struct address_space *aspace)
{ {
struct program_space *pspace; struct program_space *pspace;
pspace = XZALLOC (struct program_space); pspace = XCNEW (struct program_space);
pspace->num = ++last_program_space_num; pspace->num = ++last_program_space_num;
pspace->aspace = aspace; pspace->aspace = aspace;

View file

@ -206,7 +206,7 @@ get_sim_inferior_data (struct inferior *inf, int sim_instance_needed)
if (sim_data == NULL) if (sim_data == NULL)
{ {
sim_data = XZALLOC(struct sim_inferior_data); sim_data = XCNEW(struct sim_inferior_data);
set_inferior_data (inf, sim_inferior_data_key, sim_data); set_inferior_data (inf, sim_inferior_data_key, sim_data);
/* Allocate a ptid for this inferior. */ /* Allocate a ptid for this inferior. */

View file

@ -2253,7 +2253,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* None found, create a new architecture from the information /* None found, create a new architecture from the information
provided. */ provided. */
tdep = XZALLOC (struct gdbarch_tdep); tdep = XCNEW (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep); gdbarch = gdbarch_alloc (&info, tdep);
set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT); set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);

View file

@ -101,7 +101,7 @@ Ignore file pending future shared library load? ")))
filename = arg; filename = arg;
} }
e = XZALLOC (struct skiplist_entry); e = XCNEW (struct skiplist_entry);
e->filename = xstrdup (filename); e->filename = xstrdup (filename);
e->enabled = 1; e->enabled = 1;
@ -295,7 +295,7 @@ skip_delete_command (char *arg, int from_tty)
static void static void
skip_function (const char *name) skip_function (const char *name)
{ {
struct skiplist_entry *e = XZALLOC (struct skiplist_entry); struct skiplist_entry *e = XCNEW (struct skiplist_entry);
e->enabled = 1; e->enabled = 1;
e->function_name = xstrdup (name); e->function_name = xstrdup (name);

View file

@ -115,7 +115,7 @@ get_solib_aix_inferior_data (struct inferior *inf)
data = inferior_data (inf, solib_aix_inferior_data_handle); data = inferior_data (inf, solib_aix_inferior_data_handle);
if (data == NULL) if (data == NULL)
{ {
data = XZALLOC (struct solib_aix_inferior_data); data = XCNEW (struct solib_aix_inferior_data);
set_inferior_data (inf, solib_aix_inferior_data_handle, data); set_inferior_data (inf, solib_aix_inferior_data_handle, data);
} }
@ -161,7 +161,7 @@ library_list_start_library (struct gdb_xml_parser *parser,
VEC (gdb_xml_value_s) *attributes) VEC (gdb_xml_value_s) *attributes)
{ {
VEC (lm_info_p) **list = user_data; VEC (lm_info_p) **list = user_data;
struct lm_info *item = XZALLOC (struct lm_info); struct lm_info *item = XCNEW (struct lm_info);
struct gdb_xml_value *attr; struct gdb_xml_value *attr;
attr = xml_find_attribute (attributes, "name"); attr = xml_find_attribute (attributes, "name");
@ -575,7 +575,7 @@ solib_aix_current_sos (void)
to the main executable, not a shared library. */ to the main executable, not a shared library. */
for (ix = 1; VEC_iterate (lm_info_p, library_list, ix, info); ix++) for (ix = 1; VEC_iterate (lm_info_p, library_list, ix, info); ix++)
{ {
struct so_list *new_solib = XZALLOC (struct so_list); struct so_list *new_solib = XCNEW (struct so_list);
char *so_name; char *so_name;
if (info->member_name == NULL) if (info->member_name == NULL)

View file

@ -103,7 +103,7 @@ get_darwin_info (void)
if (info != NULL) if (info != NULL)
return info; return info;
info = XZALLOC (struct darwin_info); info = XCNEW (struct darwin_info);
set_program_space_data (current_program_space, set_program_space_data (current_program_space,
solib_darwin_pspace_data, info); solib_darwin_pspace_data, info);
return info; return info;
@ -304,7 +304,7 @@ darwin_current_sos (void)
break; break;
/* Create and fill the new so_list element. */ /* Create and fill the new so_list element. */
dnew = XZALLOC (struct darwin_so_list); dnew = XCNEW (struct darwin_so_list);
new = &dnew->sl; new = &dnew->sl;
old_chain = make_cleanup (xfree, dnew); old_chain = make_cleanup (xfree, dnew);

View file

@ -181,7 +181,7 @@ get_dsbt_info (void)
if (info != NULL) if (info != NULL)
return info; return info;
info = XZALLOC (struct dsbt_info); info = XCNEW (struct dsbt_info);
set_program_space_data (current_program_space, solib_dsbt_pspace_data, info); set_program_space_data (current_program_space, solib_dsbt_pspace_data, info);
info->lm_base_cache = 0; info->lm_base_cache = 0;

View file

@ -86,8 +86,8 @@ new_so_list (char *so_name, struct load_module_desc module_desc)
{ {
struct so_list *new_so; struct so_list *new_so;
new_so = (struct so_list *) XZALLOC (struct so_list); new_so = (struct so_list *) XCNEW (struct so_list);
new_so->lm_info = (struct lm_info *) XZALLOC (struct lm_info); new_so->lm_info = (struct lm_info *) XCNEW (struct lm_info);
new_so->lm_info->module_desc = module_desc; new_so->lm_info->module_desc = module_desc;
strncpy (new_so->so_name, so_name, SO_NAME_MAX_PATH_SIZE - 1); strncpy (new_so->so_name, so_name, SO_NAME_MAX_PATH_SIZE - 1);
@ -677,7 +677,7 @@ ia64_hpux_get_solib_linkage_addr (CORE_ADDR faddr)
static struct target_so_ops * static struct target_so_ops *
ia64_hpux_target_so_ops (void) ia64_hpux_target_so_ops (void)
{ {
struct target_so_ops *ops = XZALLOC (struct target_so_ops); struct target_so_ops *ops = XCNEW (struct target_so_ops);
ops->relocate_section_addresses = ia64_hpux_relocate_section_addresses; ops->relocate_section_addresses = ia64_hpux_relocate_section_addresses;
ops->free_so = ia64_hpux_free_so; ops->free_so = ia64_hpux_free_so;

View file

@ -125,7 +125,7 @@ append_ocl_sos (struct so_list **link_ptr)
struct so_list *new; struct so_list *new;
/* Allocate so_list structure. */ /* Allocate so_list structure. */
new = XZALLOC (struct so_list); new = XCNEW (struct so_list);
/* Encode FD and object ID in path name. */ /* Encode FD and object ID in path name. */
xsnprintf (new->so_name, sizeof new->so_name, "@%s <%d>", xsnprintf (new->so_name, sizeof new->so_name, "@%s <%d>",
@ -217,7 +217,7 @@ spu_current_sos (void)
continue; continue;
/* Allocate so_list structure. */ /* Allocate so_list structure. */
new = XZALLOC (struct so_list); new = XCNEW (struct so_list);
/* Encode FD and object ID in path name. Choose the name so as not /* Encode FD and object ID in path name. Choose the name so as not
to conflict with any (normal) SVR4 library path name. */ to conflict with any (normal) SVR4 library path name. */

View file

@ -427,7 +427,7 @@ get_svr4_info (void)
if (info != NULL) if (info != NULL)
return info; return info;
info = XZALLOC (struct svr4_info); info = XCNEW (struct svr4_info);
set_program_space_data (current_program_space, solib_svr4_pspace_data, info); set_program_space_data (current_program_space, solib_svr4_pspace_data, info);
return info; return info;
} }
@ -949,7 +949,7 @@ svr4_keep_data_in_core (CORE_ADDR vaddr, unsigned long size)
if (!ldsomap) if (!ldsomap)
return 0; return 0;
new = XZALLOC (struct so_list); new = XCNEW (struct so_list);
old_chain = make_cleanup (xfree, new); old_chain = make_cleanup (xfree, new);
new->lm_info = lm_info_read (ldsomap); new->lm_info = lm_info_read (ldsomap);
make_cleanup (xfree, new->lm_info); make_cleanup (xfree, new->lm_info);
@ -1126,8 +1126,8 @@ library_list_start_library (struct gdb_xml_parser *parser,
ULONGEST *l_ldp = xml_find_attribute (attributes, "l_ld")->value; ULONGEST *l_ldp = xml_find_attribute (attributes, "l_ld")->value;
struct so_list *new_elem; struct so_list *new_elem;
new_elem = XZALLOC (struct so_list); new_elem = XCNEW (struct so_list);
new_elem->lm_info = XZALLOC (struct lm_info); new_elem->lm_info = XCNEW (struct lm_info);
new_elem->lm_info->lm_addr = *lmp; new_elem->lm_info->lm_addr = *lmp;
new_elem->lm_info->l_addr_inferior = *l_addrp; new_elem->lm_info->l_addr_inferior = *l_addrp;
new_elem->lm_info->l_ld = *l_ldp; new_elem->lm_info->l_ld = *l_ldp;
@ -1279,7 +1279,7 @@ svr4_default_sos (void)
if (!info->debug_loader_offset_p) if (!info->debug_loader_offset_p)
return NULL; return NULL;
new = XZALLOC (struct so_list); new = XCNEW (struct so_list);
new->lm_info = xzalloc (sizeof (struct lm_info)); new->lm_info = xzalloc (sizeof (struct lm_info));
@ -1316,7 +1316,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
int errcode; int errcode;
char *buffer; char *buffer;
new = XZALLOC (struct so_list); new = XCNEW (struct so_list);
old_chain = make_cleanup_free_so (new); old_chain = make_cleanup_free_so (new);
new->lm_info = lm_info_read (lm); new->lm_info = lm_info_read (lm);

View file

@ -119,7 +119,7 @@ library_list_start_library (struct gdb_xml_parser *parser,
void *user_data, VEC(gdb_xml_value_s) *attributes) void *user_data, VEC(gdb_xml_value_s) *attributes)
{ {
VEC(lm_info_p) **list = user_data; VEC(lm_info_p) **list = user_data;
struct lm_info *item = XZALLOC (struct lm_info); struct lm_info *item = XCNEW (struct lm_info);
const char *name = xml_find_attribute (attributes, "name")->value; const char *name = xml_find_attribute (attributes, "name")->value;
item->name = xstrdup (name); item->name = xstrdup (name);
@ -274,7 +274,7 @@ solib_target_current_sos (void)
/* Build a struct so_list for each entry on the list. */ /* Build a struct so_list for each entry on the list. */
for (ix = 0; VEC_iterate (lm_info_p, library_list, ix, info); ix++) for (ix = 0; VEC_iterate (lm_info_p, library_list, ix, info); ix++)
{ {
new_solib = XZALLOC (struct so_list); new_solib = XCNEW (struct so_list);
strncpy (new_solib->so_name, info->name, SO_NAME_MAX_PATH_SIZE - 1); strncpy (new_solib->so_name, info->name, SO_NAME_MAX_PATH_SIZE - 1);
new_solib->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; new_solib->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
strncpy (new_solib->so_original_name, info->name, strncpy (new_solib->so_original_name, info->name,

View file

@ -1653,7 +1653,7 @@ sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
return arches->gdbarch; return arches->gdbarch;
/* Allocate space for the new architecture. */ /* Allocate space for the new architecture. */
tdep = XZALLOC (struct gdbarch_tdep); tdep = XCNEW (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep); gdbarch = gdbarch_alloc (&info, tdep);
tdep->pc_regnum = SPARC32_PC_REGNUM; tdep->pc_regnum = SPARC32_PC_REGNUM;

View file

@ -575,7 +575,7 @@ install_symfile_debug_logging (struct objfile *objfile)
real_sf = objfile->sf; real_sf = objfile->sf;
/* Alas we have to preserve NULL entries in REAL_SF. */ /* Alas we have to preserve NULL entries in REAL_SF. */
debug_data = XZALLOC (struct debug_sym_fns_data); debug_data = XCNEW (struct debug_sym_fns_data);
#define COPY_SF_PTR(from, to, name, func) \ #define COPY_SF_PTR(from, to, name, func) \
do { \ do { \

View file

@ -799,7 +799,7 @@ default_symfile_segments (bfd *abfd)
low = bfd_get_section_vma (abfd, sect); low = bfd_get_section_vma (abfd, sect);
high = low + bfd_get_section_size (sect); high = low + bfd_get_section_size (sect);
data = XZALLOC (struct symfile_segment_data); data = XCNEW (struct symfile_segment_data);
data->num_segments = 1; data->num_segments = 1;
data->segment_bases = XCALLOC (1, CORE_ADDR); data->segment_bases = XCALLOC (1, CORE_ADDR);
data->segment_sizes = XCALLOC (1, CORE_ADDR); data->segment_sizes = XCALLOC (1, CORE_ADDR);

View file

@ -804,7 +804,7 @@ tdesc_data_init (struct obstack *obstack)
struct tdesc_arch_data * struct tdesc_arch_data *
tdesc_data_alloc (void) tdesc_data_alloc (void)
{ {
return XZALLOC (struct tdesc_arch_data); return XCNEW (struct tdesc_arch_data);
} }
/* Free something allocated by tdesc_data_alloc, if it is not going /* Free something allocated by tdesc_data_alloc, if it is not going
@ -1242,7 +1242,7 @@ tdesc_create_reg (struct tdesc_feature *feature, const char *name,
int regnum, int save_restore, const char *group, int regnum, int save_restore, const char *group,
int bitsize, const char *type) int bitsize, const char *type)
{ {
struct tdesc_reg *reg = XZALLOC (struct tdesc_reg); struct tdesc_reg *reg = XCNEW (struct tdesc_reg);
reg->name = xstrdup (name); reg->name = xstrdup (name);
reg->target_regnum = regnum; reg->target_regnum = regnum;
@ -1304,7 +1304,7 @@ struct tdesc_type *
tdesc_create_vector (struct tdesc_feature *feature, const char *name, tdesc_create_vector (struct tdesc_feature *feature, const char *name,
struct tdesc_type *field_type, int count) struct tdesc_type *field_type, int count)
{ {
struct tdesc_type *type = XZALLOC (struct tdesc_type); struct tdesc_type *type = XCNEW (struct tdesc_type);
type->name = xstrdup (name); type->name = xstrdup (name);
type->kind = TDESC_TYPE_VECTOR; type->kind = TDESC_TYPE_VECTOR;
@ -1318,7 +1318,7 @@ tdesc_create_vector (struct tdesc_feature *feature, const char *name,
struct tdesc_type * struct tdesc_type *
tdesc_create_struct (struct tdesc_feature *feature, const char *name) tdesc_create_struct (struct tdesc_feature *feature, const char *name)
{ {
struct tdesc_type *type = XZALLOC (struct tdesc_type); struct tdesc_type *type = XCNEW (struct tdesc_type);
type->name = xstrdup (name); type->name = xstrdup (name);
type->kind = TDESC_TYPE_STRUCT; type->kind = TDESC_TYPE_STRUCT;
@ -1341,7 +1341,7 @@ tdesc_set_struct_size (struct tdesc_type *type, LONGEST size)
struct tdesc_type * struct tdesc_type *
tdesc_create_union (struct tdesc_feature *feature, const char *name) tdesc_create_union (struct tdesc_feature *feature, const char *name)
{ {
struct tdesc_type *type = XZALLOC (struct tdesc_type); struct tdesc_type *type = XCNEW (struct tdesc_type);
type->name = xstrdup (name); type->name = xstrdup (name);
type->kind = TDESC_TYPE_UNION; type->kind = TDESC_TYPE_UNION;
@ -1354,7 +1354,7 @@ struct tdesc_type *
tdesc_create_flags (struct tdesc_feature *feature, const char *name, tdesc_create_flags (struct tdesc_feature *feature, const char *name,
LONGEST size) LONGEST size)
{ {
struct tdesc_type *type = XZALLOC (struct tdesc_type); struct tdesc_type *type = XCNEW (struct tdesc_type);
type->name = xstrdup (name); type->name = xstrdup (name);
type->kind = TDESC_TYPE_FLAGS; type->kind = TDESC_TYPE_FLAGS;
@ -1436,7 +1436,7 @@ tdesc_free_feature (struct tdesc_feature *feature)
struct tdesc_feature * struct tdesc_feature *
tdesc_create_feature (struct target_desc *tdesc, const char *name) tdesc_create_feature (struct target_desc *tdesc, const char *name)
{ {
struct tdesc_feature *new_feature = XZALLOC (struct tdesc_feature); struct tdesc_feature *new_feature = XCNEW (struct tdesc_feature);
new_feature->name = xstrdup (name); new_feature->name = xstrdup (name);
@ -1447,7 +1447,7 @@ tdesc_create_feature (struct target_desc *tdesc, const char *name)
struct target_desc * struct target_desc *
allocate_target_description (void) allocate_target_description (void)
{ {
return XZALLOC (struct target_desc); return XCNEW (struct target_desc);
} }
static void static void

View file

@ -341,7 +341,7 @@ windows_add_thread (ptid_t ptid, HANDLE h, void *tlb)
if ((th = thread_rec (id, FALSE))) if ((th = thread_rec (id, FALSE)))
return th; return th;
th = XZALLOC (thread_info); th = XCNEW (thread_info);
th->id = id; th->id = id;
th->h = h; th->h = h;
th->thread_local_base = (CORE_ADDR) (uintptr_t) tlb; th->thread_local_base = (CORE_ADDR) (uintptr_t) tlb;
@ -728,7 +728,7 @@ windows_make_so (const char *name, LPVOID load_addr)
#endif #endif
} }
#endif #endif
so = XZALLOC (struct so_list); so = XCNEW (struct so_list);
so->lm_info = (struct lm_info *) xmalloc (sizeof (struct lm_info)); so->lm_info = (struct lm_info *) xmalloc (sizeof (struct lm_info));
so->lm_info->load_addr = load_addr; so->lm_info->load_addr = load_addr;
strcpy (so->so_original_name, name); strcpy (so->so_original_name, name);

View file

@ -94,7 +94,7 @@ gdb_xml_body_text (void *data, const XML_Char *text, int length)
if (scope->body == NULL) if (scope->body == NULL)
{ {
scope->body = XZALLOC (struct obstack); scope->body = XCNEW (struct obstack);
obstack_init (scope->body); obstack_init (scope->body);
} }
@ -454,7 +454,7 @@ gdb_xml_create_parser_and_cleanup (const char *name,
struct cleanup *result; struct cleanup *result;
/* Initialize the parser. */ /* Initialize the parser. */
parser = XZALLOC (struct gdb_xml_parser); parser = XCNEW (struct gdb_xml_parser);
parser->expat_parser = XML_ParserCreateNS (NULL, '!'); parser->expat_parser = XML_ParserCreateNS (NULL, '!');
if (parser->expat_parser == NULL) if (parser->expat_parser == NULL)
{ {
@ -877,7 +877,7 @@ xml_process_xincludes (const char *name, const char *text,
struct cleanup *back_to; struct cleanup *back_to;
char *result = NULL; char *result = NULL;
data = XZALLOC (struct xinclude_parsing_data); data = XCNEW (struct xinclude_parsing_data);
obstack_init (&data->obstack); obstack_init (&data->obstack);
back_to = make_cleanup (xml_xinclude_cleanup, data); back_to = make_cleanup (xml_xinclude_cleanup, data);

View file

@ -126,7 +126,7 @@ static const char *xml_syscall_file = NULL;
static struct syscalls_info * static struct syscalls_info *
allocate_syscalls_info (void) allocate_syscalls_info (void)
{ {
return XZALLOC (struct syscalls_info); return XCNEW (struct syscalls_info);
} }
static void static void
@ -161,7 +161,7 @@ static void
syscall_create_syscall_desc (struct syscalls_info *sysinfo, syscall_create_syscall_desc (struct syscalls_info *sysinfo,
const char *name, int number) const char *name, int number)
{ {
struct syscall_desc *sysdesc = XZALLOC (struct syscall_desc); struct syscall_desc *sysdesc = XCNEW (struct syscall_desc);
sysdesc->name = xstrdup (name); sysdesc->name = xstrdup (name);
sysdesc->number = number; sysdesc->number = number;