Skip to content

位运算的请教继续 #81

Answered by Codesire-Deng
KleinSteven asked this question in Q&A
Discussion options

You must be logged in to vote

io_info.as_user_data() 的低 3 位保证为 0,这是由 static_assert 确保的,进而后面的位运算可以成立。

原理是在 64 位机器上,io_info 内含一个指针,所以至少是按 8 字节对齐的,其地址的低 3 位总是 0。

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@KleinSteven
Comment options

Answer selected by KleinSteven
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants