summaryrefslogtreecommitdiffhomepage
path: root/include/stc/carc.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-12-30 18:45:56 +0100
committerTyge Løvset <[email protected]>2022-12-30 18:45:56 +0100
commite124d8c7377de1dfce45790a196312596f6b9be5 (patch)
tree528ebcc735cdb5d958b987c886d369bc02a11320 /include/stc/carc.h
parent4f0f45422fb58e9b134445ad6a4ea96d806214e8 (diff)
downloadSTC-modified-e124d8c7377de1dfce45790a196312596f6b9be5.tar.gz
STC-modified-e124d8c7377de1dfce45790a196312596f6b9be5.zip
Fixed carc and cbox docs. Added cbox_X_assign() : transfer ownership between cboxes.
Diffstat (limited to 'include/stc/carc.h')
-rw-r--r--include/stc/carc.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/stc/carc.h b/include/stc/carc.h
index 7f7789ab..f14fdd65 100644
--- a/include/stc/carc.h
+++ b/include/stc/carc.h
@@ -157,17 +157,17 @@ STC_INLINE _cx_self _cx_memb(_clone)(_cx_self ptr) {
return ptr;
}
-STC_INLINE void _cx_memb(_copy)(_cx_self* self, _cx_self ptr) {
+STC_INLINE void _cx_memb(_assign)(_cx_self* self, _cx_self ptr) {
if (ptr.use_count)
_i_atomic_inc(ptr.use_count);
_cx_memb(_drop)(self);
*self = ptr;
}
-STC_INLINE void _cx_memb(_take)(_cx_self* self, _cx_self ptr) {
- if (self->get != ptr.get)
+STC_INLINE void _cx_memb(_take)(_cx_self* self, _cx_self unowned) {
+ if (self->get != unowned.get)
_cx_memb(_drop)(self);
- *self = ptr;
+ *self = unowned;
}
#ifndef i_no_cmp