/* Support functions for general registry objects.
- Copyright (C) 2011-2013 Free Software Foundation, Inc.
+ Copyright (C) 2011-2022 Free Software Foundation, Inc.
This file is part of GDB.
#include "defs.h"
#include "registry.h"
-#include "gdb_assert.h"
-#include "gdb_string.h"
-
const struct registry_data *
register_data_with_cleanup (struct registry_data_registry *registry,
registry_data_callback save,
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;
{
gdb_assert (fields->data == NULL);
fields->num_data = registry->num_registrations;
- fields->data = XCALLOC (fields->num_data, void *);
+ fields->data = XCNEWVEC (void *, fields->num_data);
}
void