+ if (!--type->ref)
+ free_type(type);
+}
+
+struct declaration_scope *
+new_declaration_scope(struct declaration_scope *parent_scope)
+{
+ struct declaration_scope *scope = g_new(struct declaration_scope, 1);
+
+ scope->type_classes = g_hash_table_new_full(g_direct_hash,
+ g_direct_equal, NULL,
+ (GDestroyNotify) type_class_unref);
+ scope->parent_scope = parent_scope;
+ return scope;
+}
+
+void free_declaration_scope(struct declaration_scope *scope)
+{
+ g_hash_table_destroy(scope->type_classes);
+ g_free(scope);