-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
BorrowedCursor: make init a boolean
#150129
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
009a5d1 to
469a6d6
Compare
EDIT: That's fully addressed by keeping |
| filled: usize, | ||
| /// The length of `self.buf` which is known to be initialized. | ||
| init: usize, | ||
| /// Whether the unfilled part of `self.buf` is known to be initialized. |
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.
| /// Whether the unfilled part of `self.buf` is known to be initialized. | |
| /// Whether the entire unfilled part of `self.buf` is known to be initialized. |
| /// | ||
| /// `BorrowedBuf` assumes that bytes are never de-initialized, so this method does nothing when called with fewer | ||
| /// bytes than are already known to be initialized. | ||
| /// Asserts unfilled part of the buffer is initialized. |
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.
| /// Asserts unfilled part of the buffer is initialized. | |
| /// Asserts that the unfilled part of the buffer is initialized. |
This PR changes uninitialized bytes tracking in
BorrowedBuffrom being byte-wise to being buffer-wise.I've put all the API around
inita new unstable featureborrowed_buf_init, to split the part that needs it and the part that doesn't. It will avoids accidental stabilization of this part.I'm not really convinced of the rename of
advance_uncheckedtoadvance, but I did it anyway. The oldadvancewas kept asadvance_checked.Alternative of #148937
Cc #78485 #117693
Cc @joshtriplett
r? @Amanieu