portable-atomic icon indicating copy to clipboard operation
portable-atomic copied to clipboard

Add AtomicTwoPtr (or AtomicTaggedPtr)

Open taiki-e opened this issue 5 months ago • 0 comments

Similar to AtomicU128 for 64-bit systems and AtomicU64 for 32-bit systems, but strict-provenance compatible. (Although, at this time, there is no way to implement cfg(miri) code in lockfree way.)

Intended use case is construct of tagged ptr. (This type is two pointer not pointer and integer, because there is a use case of two pointers and one tag...: https://github.com/taiki-e/atomic-maybe-uninit/issues/23#issuecomment-2260921918 But we might want to ignore that use case and add AtomicTaggedPtr for now.)

This has been used in my private projects for a few years now and has been mentioned several times before. (https://github.com/taiki-e/atomic-maybe-uninit/issues/23#issuecomment-2260921918, https://github.com/taiki-e/portable-atomic/issues/116#issuecomment-2424794054)

Other name candidates: AtomicDoublePtr, AtomicPtrPair

taiki-e avatar Jul 02 '25 00:07 taiki-e