[En-Nut-Discussion] NutEnterCritical vs NutEnterCriticalAccess()

Dušan dferbas at etech.cz
Wed Nov 18 15:09:53 CET 2015


Hi Uwe,

I noticed your attempt to optimize NutEnterCritical().

If there are more pairs NutEnterCritical() / NutExitCritical(), and 
these macros are using a memory variable, this generates more local 
memory variables.
However these are only on stack and there are not so many of them, our 
compiler does not optimize their usage.

What about to use something like NutUseCritical() and to use it at the 
beginning of each function where NutEnterCritical() is used ?
#define NutUseCritical() int temp_

We solved this by using a register variable.
But anyhow, once there is an opportunity to modify this long time 
untouched source codes ...

*Dušan Ferbas
*



More information about the En-Nut-Discussion mailing list