lib: make public reference count functions have strict types
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 7 Dec 2018 22:33:41 +0000 (17:33 -0500)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 2 May 2019 20:50:15 +0000 (20:50 +0000)
commitc5b9b4417bedfbec9b5dd23b8395ccdd4eeffc44
treeb7c681f9c64bb639a1e382c00bc3566bed4bde96
parente2f7325d1e58710ee928373592adcee466f93d06
lib: make public reference count functions have strict types

Instead of having generic bt_object_get_ref() and bt_object_put_ref()
accepting `const void *`, have one pair of such functions for each
shared object API.

This can help catch reference count bugs (not putting or getting the
correct object type) and makes it illegal at build time to get or put a
unique object's reference.

Each shared object API also has its own BT_X_PUT_REF_AND_RESET() and
BT_X_MOVE_REF() macros.

bt_object_get_ref() and bt_object_put_ref() are now internal and only
used by the library's implementation.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
116 files changed:
cli/babeltrace-cfg-cli-args-connect.c
cli/babeltrace-cfg-cli-args-default.c
cli/babeltrace-cfg-cli-args.c
cli/babeltrace-cfg-cli-args.h
cli/babeltrace-cfg.h
cli/babeltrace.c
include/Makefile.am
include/babeltrace/assert-pre-internal.h
include/babeltrace/babeltrace.h
include/babeltrace/graph/component-class-const.h
include/babeltrace/graph/component-class-filter-const.h
include/babeltrace/graph/component-class-sink-const.h
include/babeltrace/graph/component-class-source-const.h
include/babeltrace/graph/component-const.h
include/babeltrace/graph/component-filter-const.h
include/babeltrace/graph/component-sink-const.h
include/babeltrace/graph/component-source-const.h
include/babeltrace/graph/connection-const.h
include/babeltrace/graph/const-notification.h [deleted file]
include/babeltrace/graph/graph-const.h
include/babeltrace/graph/notification-const.h
include/babeltrace/graph/port-const.h
include/babeltrace/graph/port-input-const.h
include/babeltrace/graph/port-output-const.h
include/babeltrace/graph/port-output-notification-iterator.h
include/babeltrace/graph/query-executor-const.h
include/babeltrace/graph/self-component-port-input-notification-iterator.h
include/babeltrace/object-internal.h
include/babeltrace/object.h [deleted file]
include/babeltrace/plugin/plugin-const.h
include/babeltrace/plugin/plugin-internal.h
include/babeltrace/plugin/plugin-set-const.h
include/babeltrace/trace-ir/clock-class-const.h
include/babeltrace/trace-ir/event-class-const.h
include/babeltrace/trace-ir/field-class-const.h
include/babeltrace/trace-ir/field-path-const.h
include/babeltrace/trace-ir/packet-const.h
include/babeltrace/trace-ir/stream-class-const.h
include/babeltrace/trace-ir/stream-const.h
include/babeltrace/trace-ir/trace-class-const.h
include/babeltrace/trace-ir/trace-const.h
include/babeltrace/value-const.h
lib/Makefile.am
lib/graph/component-class-sink-colander.c
lib/graph/component-class.c
lib/graph/component-filter.c
lib/graph/component-sink.c
lib/graph/component-source.c
lib/graph/component.c
lib/graph/connection.c
lib/graph/graph.c
lib/graph/iterator.c
lib/graph/notification/event.c
lib/graph/notification/inactivity.c
lib/graph/notification/notification.c
lib/graph/notification/packet.c
lib/graph/notification/stream.c
lib/graph/port.c
lib/graph/query-executor.c
lib/lib-logging.c
lib/object-pool.c
lib/object.c [deleted file]
lib/plugin/plugin-so.c
lib/plugin/plugin.c
lib/trace-ir/attributes.c
lib/trace-ir/clock-class.c
lib/trace-ir/clock-value.c
lib/trace-ir/event-class.c
lib/trace-ir/event.c
lib/trace-ir/field-class.c
lib/trace-ir/field-path.c
lib/trace-ir/field.c
lib/trace-ir/packet.c
lib/trace-ir/resolve-field-path.c
lib/trace-ir/stream-class.c
lib/trace-ir/stream.c
lib/trace-ir/trace-class.c
lib/trace-ir/trace.c
lib/trace-ir/utils.c
lib/value.c
plugins/ctf/common/bfcr/bfcr.c
plugins/ctf/common/metadata/ctf-meta-translate.c
plugins/ctf/common/metadata/ctf-meta-update-default-clock-classes.c
plugins/ctf/common/metadata/ctf-meta.h
plugins/ctf/common/metadata/visitor-generate-ir.c
plugins/ctf/common/notif-iter/notif-iter.c
plugins/ctf/fs-sink/write.c
plugins/ctf/fs-sink/writer.c
plugins/ctf/fs-src/data-stream-file.c
plugins/ctf/fs-src/fs.c
plugins/ctf/fs-src/metadata.c
plugins/ctf/fs-src/query.c
plugins/ctf/lttng-live/lttng-live.c
plugins/ctf/lttng-live/metadata.c
plugins/ctf/lttng-live/viewer-connection.c
plugins/libctfcopytrace/clock-fields.c
plugins/libctfcopytrace/ctfcopytrace.c
plugins/lttng-utils/copy.c
plugins/lttng-utils/debug-info.c
plugins/lttng-utils/plugin.c
plugins/text/dmesg/dmesg.c
plugins/text/pretty/pretty.c
plugins/utils/counter/counter.c
plugins/utils/dummy/dummy.c
plugins/utils/muxer/muxer.c
plugins/utils/trimmer/copy.c
plugins/utils/trimmer/iterator.c
plugins/utils/trimmer/trimmer.c
python-plugin-provider/python-plugin-provider.c
tests/lib/test-plugin-plugins/sfs.c
tests/lib/test_bt_notification_iterator.c
tests/lib/test_bt_values.c
tests/lib/test_ctf_writer.c
tests/lib/test_graph_topo.c
tests/lib/test_plugin.c
tests/lib/test_trace_ir_ref.c
This page took 0.035903 seconds and 4 git commands to generate.