Ownership tag pointers
Swift Forums
Ownership tag pointers
Hi, I would like to share a concept that I implemented and works, maybe could work in swift since it is about ref-counting objects. The idea is every ref object pointer carries a one‑bit tag in its lowest bit: Own_Ref (bit = 1) – owns the object; responsible for decrementing the reference count on release. Borrow_Ref (bit = 0) – a non‑owning view; release is a no‑op, meaning after checking the bit. The api is Operation Meaning Input → Output RC Change borrow(x) Create a borrowe...
0 comments
No comments yet.