- const obj_info_t *info = &obj_info[kind];
- arch_header_t *data = alloca(size);
- arch_header_t *res = NULL;
-
- memset(data, 0, size);
- data->kind = kind;
- data->isa = isa;
- data->name = get_id_str(new_id_from_str(name));
- data->is_new = 1;
-
- res = set_insert(get_arch_data(), data, size, hash_header(data));
-
- /* If the object is newly created and thus not yet present
- * in the set, add it to the isa */
- if(res->is_new) {
-
- /*
- * The inserted object was no isa, list it in the isa if this is
- * desired.
- */
- if(isa && info->listed_in_isa)
- list_add(&res->list, &isa->heads[kind]);
-
- /* The inserted object is an isa, so initialize all its list heads. */
- else {
- int i;
- arch_isa_t *isa = (arch_isa_t *) res;
-
- for(i = 0; i < arch_kind_last; ++i)
- INIT_LIST_HEAD(&isa->heads[i]);
- }
- }