-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement intrusive mailbox #127
Conversation
b6d107a
to
beabaf8
Compare
21cf5bb
to
e9e3987
Compare
/// | ||
/// Common safety requirements for all functions: | ||
/// * input pointers (`ptr`) must be [valid] for reading `MessageRepr<M>`. | ||
/// * output pointers (`out_ptr`) must be [valid] for writing `MessageRepr<M>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Output pointers also should not contain any previous values, given that ptr::write()
will discard them without running destructors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if maybe having a separate type for an “uninit MessageRepr
” would make more sense here (so alloc_repr()
would return UninitMessageRepr
, and e.g. clone()
would accept one as out_ptr
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TLDR: It's nice idea, but leads to overcomplicated code
ec6eac2
to
629bd0a
Compare
785adf5
to
60956ff
Compare
* remove excessive unsafe code in `MessageVTable::lookup()` * more accurate unsafe comments * remove obsolete hack `Message::_touch()` * `ResponseToken::forget()` consume `self` * avoid needless pointer casts
60956ff
to
13ff047
Compare
It's better to start the review with
mailbox.rs
, thenmessage/repr.rs
,message/any.rs
, andenvelope.rs
.Closes #52