summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-08-22 18:34:28 +0100
committerDamien George <damien.p.george@gmail.com>2014-08-22 18:34:28 +0100
commit26a0d4f4f1d780039a1697c6aba6e53799913745 (patch)
treec84d88f5f11e9749aba78dca655ed9926c1399f8
parent69b7dae36227f7c41fc1e8a3ef3fe3889ac1c7df (diff)
downloadmicropython-26a0d4f4f1d780039a1697c6aba6e53799913745.tar.gz
micropython-26a0d4f4f1d780039a1697c6aba6e53799913745.zip
py: Change hash and len members of str from 16 bit to full word.
This allows to make strings longer than 64k. It doesn't use any more RAM with current GC because a str object still fits in a GC block.
-rw-r--r--py/objstr.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/py/objstr.h b/py/objstr.h
index 6818b4603e..76e41d385d 100644
--- a/py/objstr.h
+++ b/py/objstr.h
@@ -26,10 +26,9 @@
typedef struct _mp_obj_str_t {
mp_obj_base_t base;
- // XXX here we assume the hash size is 16 bits (it is at the moment; see qstr.c)
- mp_uint_t hash : 16;
+ mp_uint_t hash;
// len == number of bytes used in data, alloc = len + 1 because (at the moment) we also append a null byte
- mp_uint_t len : 16;
+ mp_uint_t len;
const byte *data;
} mp_obj_str_t;