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.
diff --git a/py/qstr.h b/py/qstr.h
index a383452..d5ec1fe 100644
--- a/py/qstr.h
+++ b/py/qstr.h
@@ -46,6 +46,14 @@
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);