- struct type_class_struct *array_class =
- container_of(type_class, struct type_class_array, p);
- array_type_free(array_class);
+ struct type_array *array_type;
+ struct type *type;
+
+ array_type = g_new(struct type_array, 1);
+ type = &array_type->p;
+ array_type->len = len;
+ type_ref(elem_type);
+ array_type->elem = elem_type;
+ type->name = g_quark_from_string(name);
+ /* No need to align the array, the first element will align itself */
+ type->alignment = 1;
+ type->copy = array_copy;
+ type->type_free = _array_type_free;
+ type->declaration_new = _array_declaration_new;
+ type->declaration_free = _array_declaration_free;
+ type->ref = 1;
+ return array_type;