summaryrefslogtreecommitdiff
path: root/include/refcount.h
AgeCommit message (Collapse)Author
2014-08-31include: detect use-after-free errors using the reference countsJustus Winter
* include/refcount.h (refcount_init): There must be at least one reference at initialization time. (refcounts_init): Likewise. (refcount_unsafe_ref): New function retaining the previous functionality of refcount_ref. It is occasionally useful to raise the reference count again after it dropped to zero. (refcounts_unsafe_ref): Likewise. (refcounts_unsafe_weak_ref): Likewise. (refcount_ref): Detect use-after-free errors. (refcounts_ref): Likewise. (refcounts_ref_weak): Likewise. * libtrivfs/protid-clean.c (trivfs_clean_protid): Use refcount_unsafe_ref.
2014-06-06include: use unsigned literal in combination with binary notJustus Winter
* include/refcount.h (refcounts_promote): Use ~0U. (refcounts_demote): Likewise.
2014-05-22include: add lock-less reference counting primitivesJustus Winter
* include/refcount.h: New file.