Relaxing the condition on pointer tags
jeehoonkang opened this issue · 0 comments
I am porting @stjepang 's channel
(https://github.com/stjepang/channel) from coco
to crossbeam-epoch
, and found out that channel
uses pointer tags >= 8
on x86-64: https://github.com/stjepang/channel/blob/master/src/flavors/list.rs#L102
It turns out that coco
allows tags >= 8
, while crossbeam-epoch
doesn't: https://github.com/stjepang/coco/blob/master/src/epoch/atomic.rs#L429 https://github.com/crossbeam-rs/crossbeam-epoch/blob/master/src/atomic.rs#L518
I am convinced that this relaxation of coco
is actually more ergonomic, as evidenced by the channel implementation. Though it may be a little bit more unsafe (in terms of surprising the users). In this tradeoff, I would like to prefer the usability to the safety. What do you think?
Also, if we will decide to be strict on pointer tags in this matter, I think it would be great to expose atomic.rs
's low_bits()
in the public interface, for supporting the use case in channel
.