ALLOCATE_CPLUS_STRUCT_TYPE (type);
TYPE_FN_FIELDLISTS (type) = (struct fn_fieldlist *)
- TYPE_ALLOC (type,
- sizeof (struct fn_fieldlist) * fip->fnfieldlists.size ());
+ TYPE_ZALLOC (type,
+ sizeof (struct fn_fieldlist) * fip->fnfieldlists.size ());
for (int i = 0; i < fip->fnfieldlists.size (); i++)
{
TYPE_FN_FIELDLIST_NAME (type, i) = nf.name;
TYPE_FN_FIELDLIST_LENGTH (type, i) = nf.fnfields.size ();
+ /* No need to zero-initialize, initialization is done by the copy in
+ the loop below. */
fn_flp->fn_fields = (struct fn_field *)
TYPE_ALLOC (type, sizeof (struct fn_field) * nf.fnfields.size ());
int count = fi.typedef_field_list.size ();
ALLOCATE_CPLUS_STRUCT_TYPE (type);
+ /* No zero-initialization is needed, the elements are initialized by
+ the copy in the loop below. */
TYPE_TYPEDEF_FIELD_ARRAY (type)
= ((struct decl_field *)
TYPE_ALLOC (type,
int count = fi.nested_types_list.size ();
ALLOCATE_CPLUS_STRUCT_TYPE (type);
+ /* No zero-initialization is needed, the elements are initialized by
+ the copy in the loop below. */
TYPE_NESTED_TYPES_ARRAY (type)
= ((struct decl_field *)
TYPE_ALLOC (type, sizeof (struct decl_field) * count));
/* We need one extra slot, for the THIS pointer. */
argtypes = (struct field *)
- TYPE_ALLOC (type, (argcount + 1) * sizeof (struct field));
+ TYPE_ZALLOC (type, (argcount + 1) * sizeof (struct field));
p = argtypetext;
/* Add THIS pointer for non-static methods. */
TYPE_SPECIFIC_FIELD (type) = TYPE_SPECIFIC_CPLUS_STUFF;
TYPE_RAW_CPLUS_SPECIFIC (type) = (struct cplus_struct_type *)
- TYPE_ALLOC (type, sizeof (struct cplus_struct_type));
+ TYPE_ZALLOC (type, sizeof (struct cplus_struct_type));
*(TYPE_RAW_CPLUS_SPECIFIC (type)) = cplus_struct_default;
set_type_vptr_fieldno (type, -1);
}
{
TYPE_SPECIFIC_FIELD (type) = TYPE_SPECIFIC_GNAT_STUFF;
TYPE_GNAT_SPECIFIC (type) = (struct gnat_aux_type *)
- TYPE_ALLOC (type, sizeof (struct gnat_aux_type));
+ TYPE_ZALLOC (type, sizeof (struct gnat_aux_type));
*(TYPE_GNAT_SPECIFIC (type)) = gnat_aux_default;
}
{
if (name == nullptr && target_type->name () != nullptr)
{
+ /* No zero-initialization required, initialized by strcpy/strcat
+ below. */
char *new_name
= (char *) TYPE_ALLOC (target_type,
strlen (target_type->name ())