-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: graph API: return borrowed references when adding to an object
Before this patch, the following functions return a new reference when their last parameter is not `NULL`: * bt_graph_add_filter_component() * bt_graph_add_filter_component_with_initialize_method_data() * bt_graph_add_simple_sink_component() * bt_graph_add_sink_component() * bt_graph_add_sink_component_with_initialize_method_data() * bt_graph_add_source_component() * bt_graph_add_source_component_with_initialize_method_data() * bt_graph_connect_ports() * bt_self_component_filter_add_input_port() * bt_self_component_filter_add_output_port() * bt_self_component_sink_add_input_port() * bt_self_component_source_add_output_port() I'm changing this so that they return a borrowed reference instead. This is more in line with other non-creating functions which always return borrowed references. It's okay to borrow here because the object to which you add an object becomes its owner anyway. Most sites are updated by removing the *_put_ref() call as the reference is now borrowed. Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com> Change-Id: I71a5e18760504d8f8610162e3f6d7bd8d87474f9 Reviewed-on: https://review.lttng.org/c/babeltrace/+/2762 Tested-by: jenkins <jenkins@lttng.org> Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
- Loading branch information
Showing
11 changed files
with
20 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters