mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-04-15 23:05:45 +00:00
fix(core): presize __main__
module to avoid heap fragmentation
[no changelog]
This commit is contained in:
parent
101d584aa4
commit
ec87d2d21d
@ -41,6 +41,7 @@
|
||||
#define MICROPY_ALLOC_PATH_MAX (128)
|
||||
#define MICROPY_ENABLE_PYSTACK (1)
|
||||
#define MICROPY_LOADED_MODULES_DICT_SIZE (160)
|
||||
#define MICROPY_MAIN_DICT_SIZE (8)
|
||||
|
||||
// emitters
|
||||
#define MICROPY_PERSISTENT_CODE_LOAD (0)
|
||||
|
@ -46,6 +46,7 @@
|
||||
#define MICROPY_MEM_STATS (1)
|
||||
#define MICROPY_ENABLE_PYSTACK (1)
|
||||
#define MICROPY_LOADED_MODULES_DICT_SIZE (160)
|
||||
#define MICROPY_MAIN_DICT_SIZE (8)
|
||||
|
||||
// emitters
|
||||
#define MICROPY_PERSISTENT_CODE_LOAD (0)
|
||||
|
@ -49,6 +49,8 @@ Micropython to preallocate 160 slots in `mpconfigport.h` variable
|
||||
`trezor.utils`, so if we ever need more modules than that, the test suite _should_ catch
|
||||
it.
|
||||
|
||||
Presizing is also applied to `__main__` module by setting `MICROPY_MAIN_DICT_SIZE`.
|
||||
|
||||
## Top-level and function-local imports
|
||||
|
||||
In order to keep the imported image size in check, in certain places we avoid importing
|
||||
|
Loading…
Reference in New Issue
Block a user