-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
py/dynruntime: add mp get buffer #12679
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
py/dynruntime: add mp get buffer #12679
Conversation
|
Code size report: |
4b8f3ec to
3fb8d52
Compare
Codecov Report
@@ Coverage Diff @@
## master #12679 +/- ##
==========================================
- Coverage 98.39% 98.39% -0.01%
==========================================
Files 158 158
Lines 20951 20950 -1
==========================================
- Hits 20614 20613 -1
Misses 337 337
|
|
This looks like a nice optimisation on the get_buffer function, I like the idea of just being able to pass a flag to raise or return. Am I right in assuming this change would break existing built dynamic C modules? Is that what the updated sub_version is flagging, to raise an error on import of older mpy files that have C code? |
Yes, that's correct. |
3fb8d52 to
45ce84c
Compare
This allows mp_get_buffer_raise() to be changed to a simple inline function that in the majority of cases costs the same (in code size) to call as the original mp_get_buffer_raise(), because the flags argument is a constant. Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
This is required because the previous commit changed the .mpy native ABI. Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
45ce84c to
a1be5e1
Compare
No description provided.