Merged
Conversation
…mplete iovec support; other optimization
dyxushuai
reviewed
May 25, 2022
| } | ||
| _ => unsafe { std::hint::unreachable_unchecked() }, | ||
| } | ||
| me.index = usize::MAX; |
Member
Author
There was a problem hiding this comment.
返回 Ready 意味着这个 index 已经从 Slab 里删除,标记一下。当 Op Drop 时判断一下就不用从 Slab 里捞了(如果捞的话也捞不到因为是 usize::MAX)。
如果这里不改 index 就不太好标记,下次再捞到的可能是别人的。
| let stream = TcpStream::from_shared_fd(completion.data.fd); | ||
| // wait write ready | ||
| // TODO: not use write to detect writable | ||
| let _ = stream.write([]).await; |
dyxushuai
reviewed
May 30, 2022
dyxushuai
reviewed
May 30, 2022
dyxushuai
reviewed
May 30, 2022
| // But not all platforms have the `accept4(2)` call. Luckily BSD (derived) | ||
| // OSes inherit the non-blocking flag from the listener, so we just have to | ||
| // set `CLOEXEC`. | ||
| #[cfg(any( |
Collaborator
There was a problem hiding this comment.
比较复杂的条件编译可以用宏来包装,也不需要增加额外的 block
Member
Author
There was a problem hiding this comment.
目前还好,就 legacy、linux、iouring 几个 feature 组合的情况。这个后面有需求再另开 PR 搞吧。
(当前这个是从 mio fork 出来的代码,具体 syscall 具体分析,不太好复用)
dyxushuai
approved these changes
May 30, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR does many things: