projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Validate ref count opt-in in bt_ref_get
[babeltrace.git]
/
include
/
babeltrace
/
ref-internal.h
diff --git
a/include/babeltrace/ref-internal.h
b/include/babeltrace/ref-internal.h
index 8578de97b2ec1808eded8e9887961c1e3e7f4644..3a8b39f4136139807ba6c207b77725fe8554a499 100644
(file)
--- a/
include/babeltrace/ref-internal.h
+++ b/
include/babeltrace/ref-internal.h
@@
-50,9
+50,12
@@
static inline
void bt_ref_get(struct bt_ref *ref)
{
assert(ref);
void bt_ref_get(struct bt_ref *ref)
{
assert(ref);
- ref->count++;
- /* Overflow check. */
- assert(ref->count);
+ if (ref->release) {
+ /* Object has opted-in reference counting. */
+ ref->count++;
+ /* Overflow check. */
+ assert(ref->count);
+ }
}
static inline
}
static inline
This page took
0.023834 seconds
and
4
git commands to generate.