nordic, stm, mimxrt10xx, analog: shrink property objects - #11371
Open
lynt-smitka wants to merge 1 commit into
Open
nordic, stm, mimxrt10xx, analog: shrink property objects#11371lynt-smitka wants to merge 1 commit into
lynt-smitka wants to merge 1 commit into
Conversation
These ports never opted into CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE, so every read-only property carries two unused slots and every getter/setter pair one. Give the two sections a home in the linker script, the way atmel-samd and raspberrypi do, and turn the option on. The section bounds decide how many slots an object has, so a misplaced section would be read as a full property. The linker now asserts that each section is a whole number of objects.
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.
A read-only property carries two slots it never uses, and a getter/setter pair one. atmel-samd and raspberrypi already put these objects in their own linker sections and drop the unused slots: 8 bytes instead of 16, or 12 for a pair.
The other ARM ports never turned it on.
This adds the sections to their linker scripts and enables the option for nordic, stm, mimxrt10xx and analog.
The section bounds tell the runtime how many slots an object has, so a section with anything else between the bounds would read an 8-byte object as a full property. The linker now asserts that each section holds whole objects.
I have no board for these ports. Verified: the sizes above, the assert, the section geometry in the map, and the property paths on a raspberrypi board, where this is already on.
This was found and fixed by AI.