Skip to content

Commit 21eb479

Browse files
Gadgetoidgigapod
andcommittedMar 11, 2025
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 <kirk.benell@sparkfun.com> Signed-off-by: Phil Howard <github@gadgetoid.com>
1 parent 05037cc commit 21eb479

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
@@ -88,6 +88,7 @@
8888
// Memory allocation policies
8989
#if MICROPY_HW_ENABLE_PSRAM
9090
#define MICROPY_GC_STACK_ENTRY_TYPE uint32_t
91+
#define MICROPY_ALLOC_GC_STACK_SIZE (1024) // Avoid slowdown when GC stack overflow causes a full sweep of PSRAM-backed heap
9192
#else
9293
#define MICROPY_GC_STACK_ENTRY_TYPE uint16_t
9394
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.