mbed-os/rtos/TARGET_CORTEX
Christopher Haster 7e45aee8a5 Fixed mutex assert in armcc fopen and related memory leak
armcc fopen allocated a mutex using the retargeted system-level
_mutex_initialize function. Interestingly, malloc also uses this
same _mutex_initialization function, which prevents a full solution
relying on malloc. The solution previously implemented involved using
the rtx mutex pool for the first 8 mutexes, then falling back on
malloc.

The previous implementation relied on osMutexNew returning an error
on out-of-memory. An unrelated change causes osMutexNew to instead
assert (except for release mode). This meant if you exceed 8 system-
level mutexes in armcc you will hit an assert. Since the filesystem
code can call fopen an unlimited number of times, this is a problem.

Solution is to keep track of which static mutexes we've allocated, so
we know before calling osMutexNew if we need to call malloc.

Also _mutex_free never deallocated the malloced mutexes, which would
cause fopen to leak memory.
2017-11-22 16:53:19 -06:00
..
rtx4 CMSIS/RTX: Patch RTX4 to preserve osThreadDef compatibility 2017-11-01 09:25:42 +00:00
rtx5 Fixed mutex assert in armcc fopen and related memory leak 2017-11-22 16:53:19 -06:00
mbed_boot.c Fixed mutex assert in armcc fopen and related memory leak 2017-11-22 16:53:19 -06:00
mbed_rtos1_types.h Move Cortex specific RTX behind TARGET_CORTEX 2017-08-31 19:55:54 -05:00
mbed_rtos_storage.h Remove use of internal RTX types 2017-09-04 11:26:38 -05:00
mbed_rtx_conf.h Add error if OS tickrate is changed 2017-10-05 16:31:14 -05:00
mbed_rtx_handlers.c Added thread terminate hook 2017-09-14 16:21:48 -05:00
mbed_rtx_idle.cpp Update SysTick API usage for tickless mode 2017-11-10 09:53:42 +00:00