diff options
| author | Jim Mussared <jim.mussared@gmail.com> | 2023-10-31 10:47:45 +1100 |
|---|---|---|
| committer | Jim Mussared <jim.mussared@gmail.com> | 2024-01-25 16:38:17 +1100 |
| commit | d4190815a3f0a3fd31c056db46cac3970395c586 (patch) | |
| tree | bf0856394eda20e819de599f58bee3c03f1c2e11 /py/mpconfig.h | |
| parent | 8486e28b1704ab2029d24476d78118bdfd56de1b (diff) | |
py/mpconfig: Disable qstr hashing at minimum feature level.
This will apply to bare-arm and minimal, as well as the minimal unix
variant.
Change the default to MICROPY_QSTR_BYTES_IN_HASH=1 for the CORE,BASIC
levels, 2 for >=EXTRA.
Removes explicit setting of MICROPY_QSTR_BYTES_IN_HASH==1 in ports that
don't set the feature level (because 1 is implied by the default level,
CORE). Applies to cc3200, pic16bt, powerpc.
Removes explicit setting for nRF (which sets feature level). Also for samd,
which sets CORE for d21 and FULL for d51. This means that d21 is unchanged
with MICROPY_QSTR_BYTES_IN_HASH==1, but d51 now moves from 1 to 2 (roughly
adds 1kiB).
The only remaining port which explicitly set bytes-in-hash is rp2 because
it's high-flash (hence CORE level) but lowish-SRAM, so it's worthwhile
saving the RAM for runtime qstrs.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py/mpconfig.h')
| -rw-r--r-- | py/mpconfig.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index a1e9660bf..9a1f04568 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -290,10 +290,12 @@ // Number of bytes used to store qstr hash #ifndef MICROPY_QSTR_BYTES_IN_HASH -#if MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES +#if MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES #define MICROPY_QSTR_BYTES_IN_HASH (2) -#else +#elif MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES #define MICROPY_QSTR_BYTES_IN_HASH (1) +#else +#define MICROPY_QSTR_BYTES_IN_HASH (0) #endif #endif |
