From d2311ae104b51d9b9de4d7cb894902f1a9b6ca5a Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 19 Jul 2018 13:36:11 +1000 Subject: [PATCH] microbit: Tune parser memory allocation policy. Combined with the previous change to rule_stack_t, this makes sure that the number of bytes allocated for the parser's rule stack is unchanged for the initial allocation, and for subsequent resizes of the stack. What does change is that now the rules stack can hold more entries for the same number of bytes. The result is that there will be less resizes of the rule stack. --- inc/microbit/mpconfigport.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/inc/microbit/mpconfigport.h b/inc/microbit/mpconfigport.h index 5402d949e..6d7dc62b2 100644 --- a/inc/microbit/mpconfigport.h +++ b/inc/microbit/mpconfigport.h @@ -33,6 +33,8 @@ // memory allocation policies #define MICROPY_ALLOC_GC_STACK_SIZE (32) +#define MICROPY_ALLOC_PARSE_RULE_INIT (96) +#define MICROPY_ALLOC_PARSE_RULE_INC (24) #define MICROPY_ALLOC_PATH_MAX (64) #define MICROPY_QSTR_BYTES_IN_HASH (1)