-
Notifications
You must be signed in to change notification settings - Fork 2k
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
core: assert correct msq queue size on creation #5295
Conversation
ACK. |
wow, someone actually did check the return value:
|
Should we grant an award for this? Like "World-1st-msg_init_queue-Checker"? Fixed. |
cib_init(&(me->msg_queue), num); | ||
return 0; | ||
} | ||
assert(num && ((num & (num - 1)) == 0)); |
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.
why? cib_init
is already asserting that. And the only reason for asserting that here is, because the msg_queue uses cib?
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.
Ah, didn't check this. Well, then I think we can remove the check completely. 👍
addressed |
pls squash! |
regarding the assert: the cib only checks for power of 2 values, but also allows |
I noticed that, but I came to the conclusion that calling |
ACK by @kaspar030 seconded. |
The return value was never checked. Hence, this runtime check was rather pointless. Better assert the correct size during development.
ed47281
to
bb35913
Compare
squashed |
The return value was never checked. Hence, this runtime check was rather pointless. Better assert the correct size during development.