-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Description
- Type: Enhancement
- Priority: Minor
Enhancement
Reference, see #5687 (comment). I'll include some details here.
From my review how locking is done for all our toolchains, it seems to me that IAR and ARMCC provides similar stdlib locking but our implementation is different.
From the issue referenced above:
IAR locks they provide two defines _MAX_LOCK, _FOPEN_MAX. First is defined by C lib, and cant be changed. The second we define, 10 file locks (this is valid only if full lib is used, and its our case, we might missing there a check for this). Not certain why we do not align IAR and ARMCC (in ARMCC we would define similar, 8 would be max_lock, and fopen same as for IAR, 10, thus 18 mutexes provided by default ?
The diff is that IAR provides 2 lock counts that we use that is it. We define magic number 8 for ARMCC, and if more needed, we allocate on the heap. A question is if ARMCC can be changed to do the same as IAR (locks to be statically allocated, and define 2 max numbers to be used - stdlib lock and file locks). I could not find any similar defines for ARMCC to be defined, are there any? If not, we can define them, and document. Then we would have 2 same approaches for these 2 toolchains.
IAR defines for stdlib locks and file locks are documented in their Compiler Reference document.