mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
py/runtime: Make sys.modules preallocate to a configurable size.
This allows configuring the pre-allocated size of sys.modules dict, in order to prevent unwanted reallocations at run-time (3 sys-modules is really not quite enough for a larger project).
This commit is contained in:
@@ -229,6 +229,11 @@
|
||||
#define MICROPY_MODULE_DICT_SIZE (1)
|
||||
#endif
|
||||
|
||||
// Initial size of sys.modules dict
|
||||
#ifndef MICROPY_LOADED_MODULES_DICT_SIZE
|
||||
#define MICROPY_LOADED_MODULES_DICT_SIZE (3)
|
||||
#endif
|
||||
|
||||
// Whether realloc/free should be passed allocated memory region size
|
||||
// You must enable this if MICROPY_MEM_STATS is enabled
|
||||
#ifndef MICROPY_MALLOC_USES_ALLOCATED_SIZE
|
||||
|
||||
Reference in New Issue
Block a user