Skip to content

Conversation

@dpgeorge
Copy link
Member

No description provided.

@dpgeorge dpgeorge added the py-core Relates to py/ directory in source label Oct 13, 2023
@github-actions
Copy link

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:   -24 -0.013% 
   unix x64:   -24 -0.003% standard
      stm32:    -8 -0.002% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    -8 -0.002% RPI_PICO
       samd:    -8 -0.003% ADAFRUIT_ITSYBITSY_M4_EXPRESS

@dpgeorge dpgeorge force-pushed the py-dynruntime-add-mp-get-buffer branch from 4b8f3ec to 3fb8d52 Compare October 13, 2023 07:32
@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Merging #12679 (a1be5e1) into master (516385c) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            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              
Files Coverage Δ
py/nativeglue.c 94.50% <ø> (ø)
py/obj.c 98.13% <100.00%> (-0.03%) ⬇️
py/obj.h 100.00% <100.00%> (ø)

@andrewleech
Copy link
Contributor

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?

@dpgeorge
Copy link
Member Author

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.

@dpgeorge dpgeorge force-pushed the py-dynruntime-add-mp-get-buffer branch from 3fb8d52 to 45ce84c Compare October 15, 2023 23:50
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>
@dpgeorge dpgeorge force-pushed the py-dynruntime-add-mp-get-buffer branch from 45ce84c to a1be5e1 Compare October 16, 2023 00:31
@dpgeorge dpgeorge merged commit a1be5e1 into micropython:master Oct 16, 2023
@dpgeorge dpgeorge deleted the py-dynruntime-add-mp-get-buffer branch October 16, 2023 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

py-core Relates to py/ directory in source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants