From 956ec54aed7839d6f5dc6cfd8fac44e17169c984 Mon Sep 17 00:00:00 2001 From: morris Date: Thu, 3 Aug 2023 11:58:01 +0800 Subject: [PATCH] fix(heap): use _SAFE version of critical section because we allow to call malloc and free in an ISR context --- components/heap/multi_heap_platform.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/heap/multi_heap_platform.h b/components/heap/multi_heap_platform.h index 83c5d87e10..35c2a33373 100644 --- a/components/heap/multi_heap_platform.h +++ b/components/heap/multi_heap_platform.h @@ -19,14 +19,14 @@ typedef portMUX_TYPE multi_heap_lock_t; we need to use portmux spinlocks here not RTOS mutexes */ #define MULTI_HEAP_LOCK(PLOCK) do { \ if((PLOCK) != NULL) { \ - portENTER_CRITICAL((PLOCK)); \ + portENTER_CRITICAL_SAFE((PLOCK)); \ } \ } while(0) #define MULTI_HEAP_UNLOCK(PLOCK) do { \ if ((PLOCK) != NULL) { \ - portEXIT_CRITICAL((PLOCK)); \ + portEXIT_CRITICAL_SAFE((PLOCK)); \ } \ } while(0)