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:
Damien George
2015-01-01 23:30:53 +00:00
parent ad2307c92c
commit b4b10fd350
34 changed files with 464 additions and 295 deletions

View File

@@ -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);