BT_HIDDEN
void bt_ctf_event_class_freeze(struct bt_ctf_event_class *event_class)
{
	assert(event_class);
	event_class->frozen = 1;
	bt_ctf_field_type_freeze(event_class->context);
	bt_ctf_field_type_freeze(event_class->fields);
	bt_ctf_attributes_freeze(event_class->attributes);
}
struct bt_ctf_field *bt_ctf_field_create(struct bt_ctf_field_type *type)
{
	struct bt_ctf_field *field = NULL;
	enum ctf_type_id type_id;

	if (!type) {
		goto error;
	}

	type_id = bt_ctf_field_type_get_type_id(type);
	if (type_id <= CTF_TYPE_UNKNOWN || type_id >= NR_CTF_TYPES ||
		bt_ctf_field_type_validate(type)) {
		goto error;
	}

	field = field_create_funcs[type_id](type);
	if (!field) {
		goto error;
	}

	/* The type's declaration can't change after this point */
	bt_ctf_field_type_freeze(type);
	bt_ctf_field_type_get(type);
	bt_ctf_ref_init(&field->ref_count);
	field->type = type;
error:
	return field;
}