Skip to content

Commit 30d57b1

Browse files
committed
Fix gc_alloc_possible()
The BLE workflow was allocating to the VM heap when it wasn't active and causing a port_malloc.
1 parent 03b077d commit 30d57b1

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

py/gc.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -759,13 +759,10 @@ void gc_info(gc_info_t *info) {
759759
GC_EXIT();
760760
}
761761

762-
// CIRCUITPY-CHANGE
762+
// CIRCUITPY-CHANGE: C code may be used when the VM heap isn't active. This
763+
// allows that code to test if it is. It can use the outer pool if needed.
763764
bool gc_alloc_possible(void) {
764-
#if MICROPY_GC_SPLIT_HEAP
765-
return MP_STATE_MEM(gc_last_free_area) != 0;
766-
#else
767765
return MP_STATE_MEM(area).gc_pool_start != 0;
768-
#endif
769766
}
770767

771768
void *gc_alloc(size_t n_bytes, unsigned int alloc_flags) {

0 commit comments

Comments
 (0)