Skip to content

Commit a56e97d

Browse files
committed
Align MP heap allocations to cache lines
1 parent d7fa738 commit a56e97d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ports/mimxrt10xx/mpconfigport.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ extern uint8_t _ld_filesystem_start;
3737
extern uint8_t _ld_filesystem_end;
3838
extern uint8_t _ld_default_stack_size;
3939

40-
// 20kiB stack
4140
#define CIRCUITPY_DEFAULT_STACK_SIZE ((uint32_t)&_ld_default_stack_size)
4241
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0)
4342
#define MICROPY_PY_FUNCTION_ATTRS (0)
@@ -47,6 +46,10 @@ extern uint8_t _ld_default_stack_size;
4746
#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR ((uint32_t)&_ld_filesystem_start)
4847
#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE ((uint32_t)(&_ld_filesystem_end - &_ld_filesystem_start))
4948

49+
// Allocate 32 bytes at a time instead of the default 16 so that allocated buffers
50+
// are aligned to cache lines.
51+
#define MICROPY_BYTES_PER_GC_BLOCK (32)
52+
5053
#include "py/circuitpy_mpconfig.h"
5154

5255
#define MICROPY_PORT_ROOT_POINTERS \

0 commit comments

Comments
 (0)