File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 4747
4848#define WORDS_PER_BLOCK (4)
4949#define BYTES_PER_BLOCK (WORDS_PER_BLOCK * BYTES_PER_WORD)
50- #define STACK_SIZE (64) // tunable; minimum is 1
5150
5251STATIC byte * gc_alloc_table_start ;
5352STATIC mp_uint_t gc_alloc_table_byte_len ;
@@ -62,7 +61,7 @@ STATIC mp_uint_t *gc_pool_start = (void*)4;
6261STATIC mp_uint_t * gc_pool_end ;
6362
6463STATIC int gc_stack_overflow ;
65- STATIC mp_uint_t gc_stack [STACK_SIZE ];
64+ STATIC mp_uint_t gc_stack [MICROPY_ALLOC_GC_STACK_SIZE ];
6665STATIC mp_uint_t * gc_sp ;
6766STATIC uint16_t gc_lock_depth ;
6867uint16_t gc_auto_collect_enabled ;
@@ -196,7 +195,7 @@ bool gc_is_locked(void) {
196195 if (ATB_GET_KIND(_block) == AT_HEAD) { \
197196 /* an unmarked head, mark it, and push it on gc stack */ \
198197 ATB_HEAD_TO_MARK (_block ); \
199- if (gc_sp < &gc_stack[STACK_SIZE ]) { \
198+ if (gc_sp < &gc_stack[MICROPY_ALLOC_GC_STACK_SIZE ]) { \
200199 *gc_sp++ = _block; \
201200 } else { \
202201 gc_stack_overflow = 1; \
Original file line number Diff line number Diff line change 5151/*****************************************************************************/
5252/* Memory allocation policy */
5353
54+ // Number of words allocated (in BSS) to the GC stack (minimum is 1)
55+ #ifndef MICROPY_ALLOC_GC_STACK_SIZE
56+ #define MICROPY_ALLOC_GC_STACK_SIZE (64)
57+ #endif
58+
5459// Initial amount for lexer indentation level
5560#ifndef MICROPY_ALLOC_LEXER_INDENT_INIT
5661#define MICROPY_ALLOC_LEXER_INDENT_INIT (10)
You can’t perform that action at this time.
0 commit comments