From c832ad6d1f2460d2f526b36132f3b621b80eb2ee Mon Sep 17 00:00:00 2001 From: SG Date: Tue, 15 Nov 2022 23:58:36 +1000 Subject: [PATCH] Moar memory management crashes. --- firmware/targets/f7/furi_hal/furi_hal_memory.c | 4 ++++ furi/core/memmgr_heap.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/firmware/targets/f7/furi_hal/furi_hal_memory.c b/firmware/targets/f7/furi_hal/furi_hal_memory.c index 9cf2c3120..016108a00 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_memory.c +++ b/firmware/targets/f7/furi_hal/furi_hal_memory.c @@ -81,6 +81,10 @@ void furi_hal_memory_init() { } void* furi_hal_memory_alloc(size_t size) { + if(FURI_IS_ISR()) { + furi_crash("memmgt in ISR"); + } + if(furi_hal_memory == NULL) { return NULL; } diff --git a/furi/core/memmgr_heap.c b/furi/core/memmgr_heap.c index 95afd3087..5ccabaefb 100644 --- a/furi/core/memmgr_heap.c +++ b/furi/core/memmgr_heap.c @@ -341,7 +341,7 @@ void* pvPortMalloc(size_t xWantedSize) { size_t to_wipe = xWantedSize; if(FURI_IS_ISR()) { - furi_crash("malloc in ISR"); + furi_crash("memmgt in ISR"); } #ifdef HEAP_PRINT_DEBUG @@ -490,6 +490,10 @@ void vPortFree(void* pv) { uint8_t* puc = (uint8_t*)pv; BlockLink_t* pxLink; + if(FURI_IS_ISR()) { + furi_crash("memmgt in ISR"); + } + if(pv != NULL) { /* The memory being freed will have an BlockLink_t structure immediately before it. */