From ad4656b861f94277bed9647ca176e662ce5119e3 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 4 Feb 2021 16:39:09 +1100 Subject: 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 --- mpy-cross/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mpy-cross') diff --git a/mpy-cross/main.c b/mpy-cross/main.c index a403c0504..635e53a71 100644 --- a/mpy-cross/main.c +++ b/mpy-cross/main.c @@ -170,7 +170,7 @@ STATIC void pre_process_options(int argc, char **argv) { heap_size *= 1024 * 1024; } if (word_adjust) { - heap_size = heap_size * BYTES_PER_WORD / 4; + heap_size = heap_size * MP_BYTES_PER_OBJ_WORD / 4; } } else { exit(usage(argv)); @@ -182,7 +182,7 @@ STATIC void pre_process_options(int argc, char **argv) { } MP_NOINLINE int main_(int argc, char **argv) { - mp_stack_set_limit(40000 * (BYTES_PER_WORD / 4)); + mp_stack_set_limit(40000 * (sizeof(void *) / 4)); pre_process_options(argc, argv); -- cgit v1.2.3