summaryrefslogtreecommitdiff
path: root/py/qstr.h
diff options
context:
space:
mode:
Diffstat (limited to 'py/qstr.h')
-rw-r--r--py/qstr.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/py/qstr.h b/py/qstr.h
index 0ef861f33..0c4fc4632 100644
--- a/py/qstr.h
+++ b/py/qstr.h
@@ -38,9 +38,21 @@
// first entry in enum will be MP_QSTRnull=0, which indicates invalid/no qstr
enum {
#ifndef NO_QSTR
-#define QDEF(id, hash, len, str) id,
+#define QDEF0(id, hash, len, str) id,
+#define QDEF1(id, hash, len, str)
#include "genhdr/qstrdefs.generated.h"
-#undef QDEF
+#undef QDEF0
+#undef QDEF1
+ #endif
+ MP_QSTRnumber_of_static,
+ MP_QSTRstart_of_main = MP_QSTRnumber_of_static - 1, // unused but shifts the enum counter back one
+
+ #ifndef NO_QSTR
+#define QDEF0(id, hash, len, str)
+#define QDEF1(id, hash, len, str) id,
+ #include "genhdr/qstrdefs.generated.h"
+#undef QDEF0
+#undef QDEF1
#endif
MP_QSTRnumber_of, // no underscore so it can't clash with any of the above
};
@@ -66,7 +78,8 @@ typedef uint16_t qstr_len_t;
typedef struct _qstr_pool_t {
const struct _qstr_pool_t *prev;
- size_t total_prev_len;
+ size_t total_prev_len : (8 * sizeof(size_t) - 1);
+ size_t is_sorted : 1;
size_t alloc;
size_t len;
qstr_hash_t *hashes;