Skip to content
Snippets Groups Projects
Commit 26a0d4f4 authored by Damien George's avatar Damien George
Browse files

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.
parent 69b7dae3
No related branches found
No related tags found
No related merge requests found
...@@ -26,10 +26,9 @@ ...@@ -26,10 +26,9 @@
typedef struct _mp_obj_str_t { typedef struct _mp_obj_str_t {
mp_obj_base_t base; 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;
mp_uint_t hash : 16;
// len == number of bytes used in data, alloc = len + 1 because (at the moment) we also append a null byte // 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; const byte *data;
} mp_obj_str_t; } mp_obj_str_t;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment