Skip to content

Commit bc76694

Browse files
Gadgetoidgigapod
andcommitted
ports/rp2: Raise GC stack size for PSRAM.
GC stack was overflowing and causing the GC to scan through the entire memory pool, which is a particularly pathological case with 8MB PSRAM. This caused noticable slowdowns during GC. This change takes the stack from 256 to 4096 bytes to avoid overflow. Co-authored-by: Kirk Benell <[email protected]> Signed-off-by: Phil Howard <[email protected]>
1 parent 8149f0d commit bc76694

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ports/rp2/mpconfigport.h

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
// Memory allocation policies
7979
#if MICROPY_HW_ENABLE_PSRAM
8080
#define MICROPY_GC_STACK_ENTRY_TYPE uint32_t
81+
#define MICROPY_ALLOC_GC_STACK_SIZE (1024) // Avoid slowdown when GC stack overflow causes a full sweep of PSRAM-backed heap
8182
#else
8283
#define MICROPY_GC_STACK_ENTRY_TYPE uint16_t
8384
#endif

0 commit comments

Comments
 (0)