Skip to content

Compress QSTR pointer pool #5276

Open
Open
@tannewt

Description

@tannewt

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions