mbed library sources. Supersedes mbed-src.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
Diff: platform/mbed_stats.c
- Revision:
- 188:bcfe06ba3d64
- Parent:
- 187:0387e8f68319
- Child:
- 189:f392fc9709a3
--- a/platform/mbed_stats.c Thu Sep 06 13:40:20 2018 +0100 +++ b/platform/mbed_stats.c Thu Nov 08 11:46:34 2018 +0000 @@ -41,7 +41,10 @@ osThreadId_t *threads; threads = malloc(sizeof(osThreadId_t) * thread_n); - MBED_ASSERT(threads != NULL); + // Don't fail on lack of memory + if (!threads) { + return; + } osKernelLock(); thread_n = osThreadEnumerate(threads, thread_n); @@ -69,7 +72,10 @@ osThreadId_t *threads; threads = malloc(sizeof(osThreadId_t) * count); - MBED_ASSERT(threads != NULL); + // Don't fail on lack of memory + if (!threads) { + return 0; + } osKernelLock(); count = osThreadEnumerate(threads, count);