lib: add internal object pool API and use it; adapt plugins/tests
[babeltrace.git] / include / babeltrace / graph / clock-class-priority-map-internal.h
index 049421458c0d7b64d551adff169e157b31a316f1..be6a9953d06872ac7bad7a41ba503ff48f061706 100644 (file)
 
 #include <stdint.h>
 #include <stddef.h>
-#include <stdbool.h>
-#include <assert.h>
+#include <babeltrace/assert-internal.h>
 #include <babeltrace/ctf-ir/clock-class.h>
 #include <babeltrace/object-internal.h>
+#include <babeltrace/types.h>
 #include <glib.h>
 
 struct bt_clock_class_priority_map {
        struct bt_object base;
 
-       /* Array of struct bt_ctf_clock_class *, owned by this */
+       /* Array of struct bt_clock_class *, owned by this */
        GPtrArray *entries;
 
-       /* struct bt_ctf_clock_class * (weak) to priority (uint64_t *) */
+       /* struct bt_clock_class * (weak) to priority (uint64_t *) */
        GHashTable *prios;
 
        /* Clock class (weak) with the currently highest priority */
-       struct bt_ctf_clock_class *highest_prio_cc;
+       struct bt_clock_class *highest_prio_cc;
 
-       bool frozen;
+       bt_bool frozen;
 };
 
 static inline
-void bt_clock_class_priority_map_freeze(
+void _bt_clock_class_priority_map_freeze(
                struct bt_clock_class_priority_map *cc_prio_map)
 {
-       assert(cc_prio_map);
-       cc_prio_map->frozen = true;
+       BT_ASSERT(cc_prio_map);
+       cc_prio_map->frozen = BT_TRUE;
 }
 
+#ifdef BT_DEV_MODE
+# define bt_clock_class_priority_map_freeze    _bt_clock_class_priority_map_freeze
+#else
+# define bt_clock_class_priority_map_freeze(_cc_prio_map)
+#endif /* BT_DEV_MODE */
+
 #endif /* BABELTRACE_GRAPH_CLOCK_CLASS_PRIORITY_MAP_INTERNAL_H */
This page took 0.030708 seconds and 4 git commands to generate.