Fix: lib: do not check the frozen state in bt_X_set_is_frozen()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 7 Aug 2018 23:32:16 +0000 (19:32 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 2 May 2019 04:07:36 +0000 (00:07 -0400)
Some freezing functions were called bt_X_freeze() and were transformed
into freezing/thawing functions bt_X_set_is_frozen(), accepting the
frozen state as a parameter. The optimization checks to avoid refreezing
when the object is already frozen were left, but we can thaw now, so we
must not check this.

It could be optimized again, but those specific freezing functions are
only enabled in developer mode, so it's not a complete catastrophe.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
lib/ctf-ir/event.c
lib/ctf-ir/fields.c
lib/ctf-ir/packet.c

index 9337c4b3c23dc1517615753b9da94b70d6a30a4c..115158c3e6a4e2289290b844b85cb7bec2026d1c 100644 (file)
@@ -282,11 +282,6 @@ void _bt_event_common_set_is_frozen(struct bt_event_common *event,
                bool is_frozen)
 {
        BT_ASSERT(event);
-
-       if (event->frozen) {
-               return;
-       }
-
        BT_LOGD("Freezing event: addr=%p, "
                "event-class-name=\"%s\", event-class-id=%" PRId64,
                event, bt_event_class_common_get_name(event->class),
index 7ed1d73844a546d57afa48bf386e0008e6ff639e..d235f1b45f8aeb84d10b14f9deb260b630e783e0 100644 (file)
@@ -1218,10 +1218,6 @@ void _bt_field_common_set_is_frozen_recursive(struct bt_field_common *field,
                goto end;
        }
 
-       if (field->frozen) {
-               goto end;
-       }
-
        BT_LOGD("Setting field object's frozen state: addr=%p, is-frozen=%d",
                field, is_frozen);
        BT_ASSERT(field_type_common_has_known_id(field->type));
index ad09416bc52af2209b2fe1fd24f759c5dfcb6da8..8a892669714466991f99bcf5c5d275bef3a2a0e7 100644 (file)
@@ -64,7 +64,7 @@ struct bt_field *bt_packet_borrow_context(struct bt_packet *packet)
 BT_HIDDEN
 void _bt_packet_set_is_frozen(struct bt_packet *packet, bool is_frozen)
 {
-       if (!packet || packet->frozen) {
+       if (!packet) {
                return;
        }
 
This page took 0.02871 seconds and 4 git commands to generate.