Repository navigation
py: clean up calls to gc_alloc(), reorder setting of FTB, use mp_obj_malloc() to allocate array object - #19707
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19707 +/- ##
==========================================
+ Coverage 98.55% 98.59% +0.03%
==========================================
Files 182 182
Lines 23335 23344 +9
Branches 5 5
==========================================
+ Hits 22998 23015 +17
+ Misses 336 328 -8
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Code size report: |
projectgus
left a comment
There was a problem hiding this comment.
Cleanups look good to me!
The API of `gc_alloc()` was changed long ago in commit 5ed578e to take flags instead of a bool. Update the remaining instances to use flags. Signed-off-by: Damien George <[email protected]>
Should be equivalent logic, and prevents needing to reacquire the GC lock. Signed-off-by: Damien George <[email protected]>
Makes it easier to track which allocations are for Python objects. Signed-off-by: Damien George <[email protected]>
1f6ba49 to
6dc11be
Compare
Useful for diagnostics and coverage testing. Signed-off-by: Damien George <[email protected]>
Signed-off-by: Damien George <[email protected]>
|
I just realised that the CI coverage test here is telling the truth: coverage decreased due to this PR. That's because there's no test for a relocation of a GC block that has the finaliser bit set (that feature is never used by the codebase). I've now added a coverage test for that, including a new function |
projectgus
left a comment
There was a problem hiding this comment.
Oh, yes! Good catch by the coverage test.
Summary
A few small changes that came up while reviewing #19367:
gc_alloc()was changed long ago in commit 5ed578e to take flags instead of a bool).mp_obj_mallocto allocate array object.Testing
To be tested by CI.
Generative AI
I did not use generative AI tools when creating this PR.