aboutsummaryrefslogtreecommitdiff
path: root/py/qstr.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-01 23:30:53 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-07 20:33:00 +0000
commitb4b10fd350852e321624d74983cca286091b55a1 (patch)
tree7ac4aa40d70be0170a61f649e9d73c42faa4ba33 /py/qstr.h
parentad2307c92c15f0aa90dbd0741fd2538719d0b5e1 (diff)
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.
Diffstat (limited to 'py/qstr.h')
-rw-r--r--py/qstr.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/py/qstr.h b/py/qstr.h
index a383452b8..d5ec1fed6 100644
--- a/py/qstr.h
+++ b/py/qstr.h
@@ -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);