py/smallint: Introduce MP_SMALL_INT_BITS macro. - #8443
Closed
dlech wants to merge 1 commit into
Closed
Conversation
dpgeorge
reviewed
Mar 24, 2022
This adds a new `MP_SMALL_INT_BITS` macro that is a compile-time constant that contains the number of bits available in an `MP_SMALL_INT`. We can use this in place of the runtime function `mp_small_int_bits()`. Signed-off-by: David Lechner <david@pybricks.com>
dlech
force-pushed
the
mp-small-int-bits
branch
from
March 24, 2022 17:33
26441ad to
11aafbe
Compare
Member
|
Thanks, merged in 768879f Note: the compiler was actually optimising |
Contributor
Author
👍 I was wondering why the code size diff was 0. |
tannewt
added a commit
to tannewt/circuitpython
that referenced
this pull request
Feb 16, 2024
Doing it implicitly can lead to mistaken socket leaks and reuse. It now matches CPython. Fixes micropython#8443
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8443 +/- ##
==========================================
- Coverage 98.25% 98.25% -0.01%
==========================================
Files 154 154
Lines 20284 20277 -7
==========================================
- Hits 19931 19924 -7
Misses 353 353 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 adds a new
MP_SMALL_INT_BITSmacro that is a compile-time constant that contains the number of bits available in anMP_SMALL_INT.We can use this in place of the runtime function
mp_small_int_bits().