The Wayback Machine - https://web.archive.org/web/20230301143233/https://github.com/adafruit/circuitpython/issues/5276
Skip to content
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

Compress QSTR pointer pool #5276

Open
tannewt opened this issue Aug 31, 2021 · 0 comments
Open

Compress QSTR pointer pool #5276

tannewt opened this issue Aug 31, 2021 · 0 comments

Comments

@tannewt
Copy link
Member

tannewt commented Aug 31, 2021

The QSTR pool is a bunch of 32-bit pointers. We could store them as 16 bit offsets from a base pointer for the whole pool instead.

Doing this for the const pool built into the firmware would save ~1300 bytes of flash but require a post-processing step after the link. The linker places all of strings so it can't be done earlier. I tried to subtract the start of rodata in the initializer list but the compiler complained. Post processing it would require placing the pool as the last thing in flash so that none of the other locations change.

We could probably do the same trick for the in-memory pools too. Micros with <64k RAM will always work because we know the loaded strings will all be in 16-bit range of one another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment