mirror of
https://github.com/micropython/micropython.git
synced 2025-09-04 08:50:27 +02:00
py: Put all global state together in state structures.
This patch consolidates all global variables in py/ core into one place, in a global structure. Root pointers are all located together to make GC tracing easier and more efficient.
This commit is contained in:
@@ -46,6 +46,14 @@ enum {
|
||||
|
||||
typedef mp_uint_t qstr;
|
||||
|
||||
typedef struct _qstr_pool_t {
|
||||
struct _qstr_pool_t *prev;
|
||||
mp_uint_t total_prev_len;
|
||||
mp_uint_t alloc;
|
||||
mp_uint_t len;
|
||||
const byte *qstrs[];
|
||||
} qstr_pool_t;
|
||||
|
||||
#define QSTR_FROM_STR_STATIC(s) (qstr_from_strn((s), strlen(s)))
|
||||
|
||||
void qstr_init(void);
|
||||
|
Reference in New Issue
Block a user