lib: use object pool for event and packet notifications
[babeltrace.git] / lib / graph / port.c
index 43f3134ce938fb21fde27b5c67f523a9782b02be..950a0a26528133327ffc8675beb3cd40b87f1f9a 100644 (file)
@@ -35,6 +35,7 @@
 #include <babeltrace/graph/connection-internal.h>
 #include <babeltrace/object-internal.h>
 #include <babeltrace/compiler-internal.h>
+#include <babeltrace/assert-internal.h>
 
 static
 void bt_port_destroy(struct bt_object *obj)
@@ -51,10 +52,10 @@ void bt_port_destroy(struct bt_object *obj)
        g_free(port);
 }
 
-struct bt_port *bt_port_from_private(
+struct bt_port *bt_port_borrow_from_private(
                struct bt_private_port *private_port)
 {
-       return bt_get(bt_port_borrow_from_private(private_port));
+       return (void *) private_port;
 }
 
 BT_HIDDEN
@@ -63,9 +64,9 @@ struct bt_port *bt_port_create(struct bt_component *parent_component,
 {
        struct bt_port *port = NULL;
 
-       assert(name);
-       assert(parent_component);
-       assert(type == BT_PORT_TYPE_INPUT || type == BT_PORT_TYPE_OUTPUT);
+       BT_ASSERT(name);
+       BT_ASSERT(parent_component);
+       BT_ASSERT(type == BT_PORT_TYPE_INPUT || type == BT_PORT_TYPE_OUTPUT);
 
        if (strlen(name) == 0) {
                BT_LOGW_STR("Invalid parameter: name is an empty string.");
@@ -193,7 +194,7 @@ enum bt_port_status bt_private_port_remove_from_component(
 
        /* bt_component_remove_port() logs details */
        comp_status = bt_component_remove_port(comp, port);
-       assert(comp_status != BT_COMPONENT_STATUS_INVALID);
+       BT_ASSERT(comp_status != BT_COMPONENT_STATUS_INVALID);
        if (comp_status < 0) {
                status = BT_PORT_STATUS_ERROR;
                goto end;
This page took 0.029939 seconds and 4 git commands to generate.