diff options
author | Damien George <damien@micropython.org> | 2021-02-04 16:39:09 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-02-04 22:46:42 +1100 |
commit | ad4656b861f94277bed9647ca176e662ce5119e3 (patch) | |
tree | 58ebc0b0a631c735e6d56a8815b85b3fdbccb8c1 /py/persistentcode.c | |
parent | 7e956fae28e4e3fdea30f834d448eacfc4429de7 (diff) |
all: Rename BYTES_PER_WORD to MP_BYTES_PER_OBJ_WORD.
The "word" referred to by BYTES_PER_WORD is actually the size of mp_obj_t
which is not always the same as the size of a pointer on the target
architecture. So rename this config value to better reflect what it
measures, and also prefix it with MP_.
For uses of BYTES_PER_WORD in setting the stack limit this has been
changed to sizeof(void *), because the stack usually grows with
machine-word sized values (eg an nlr_buf_t has many machine words in it).
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/persistentcode.c')
-rw-r--r-- | py/persistentcode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/persistentcode.c b/py/persistentcode.c index 084632a60..ac523990c 100644 --- a/py/persistentcode.c +++ b/py/persistentcode.c @@ -595,7 +595,7 @@ STATIC void mp_print_bytes(mp_print_t *print, const byte *data, size_t len) { print->print_strn(print->data, (const char *)data, len); } -#define BYTES_FOR_INT ((BYTES_PER_WORD * 8 + 6) / 7) +#define BYTES_FOR_INT ((MP_BYTES_PER_OBJ_WORD * 8 + 6) / 7) STATIC void mp_print_uint(mp_print_t *print, size_t n) { byte buf[BYTES_FOR_INT]; byte *p = buf + sizeof(buf); |