-
Notifications
You must be signed in to change notification settings - Fork 90
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
Update documentation of avail_idx & used_idx #174
Conversation
02a92c8
to
1c7a6f1
Compare
1c7a6f1
to
c925b82
Compare
How abouting using "debug_assert()" instead of runtime checking? |
@jiangliu this will still cause a panic. In case we don't want to fix this by checking the operation, than we can just leave it as is and add a comment to the function specifying that the function panics in case it's called with unsupported ordering. WDYT? |
I feel it's a type of program error instead of a runtime error, so not sure about the runtime performance impact. |
These methods panic if the ordering is not the expected one. Make this clear in the documentation as well. Signed-off-by: Andreea Florescu <[email protected]>
c925b82
to
97df1ac
Compare
Summary of the PR
The
avail_idx
andused_idx
methods panic if the ordering is not the right one. As checking the ordering incurs a performance degradation, the VMM will be responsible for calling these functions only with the right ordering. We're now making this panic explicit by adding it to the public documentation.Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s
), and the commitmessage has max 60 characters for the summary and max 75 characters for each
description line.
test.
unsafe
code is properly documented.