X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=types%2Fstruct.c;h=779cca5c504064d3c03bb4a86962ab58a1917808;hp=baedbddb5f4ba6a08b58201cc29da9673a3e7b27;hb=05628561ca57ff5d269571a72a12cb86854c5f70;hpb=ac88af7594050b366fadec583e60ac26bb2aff75 diff --git a/types/struct.c b/types/struct.c index baedbddb..779cca5c 100644 --- a/types/struct.c +++ b/types/struct.c @@ -60,6 +60,7 @@ void _struct_type_free(struct type *type) container_of(type, struct type_struct, p); unsigned long i; + free_type_scope(struct_type->scope); g_hash_table_destroy(struct_type->fields_by_name); for (i = 0; i < struct_type->fields->len; i++) { @@ -72,7 +73,8 @@ void _struct_type_free(struct type *type) g_free(struct_type); } -struct type_struct *struct_type_new(const char *name) +struct type_struct *struct_type_new(const char *name, + struct type_scope *parent_scope) { struct type_struct *struct_type; struct type *type; @@ -84,6 +86,8 @@ struct type_struct *struct_type_new(const char *name) struct_type->fields = g_array_sized_new(FALSE, TRUE, sizeof(struct type_field), DEFAULT_NR_STRUCT_FIELDS); + struct_type->scope = new_type_scope(parent_scope); + type->id = CTF_TYPE_STRUCT; type->name = g_quark_from_string(name); type->alignment = 1; type->copy = struct_copy;