incubator-nuttx/sched/semaphore
Gregory Nutt 3b53cd1e57 include/nuttx: Fix improper use of inline
I finally figured out why the ez80 code has gotten so big.  It is because people have been put putting big inline functions in header files.  That is a violation of the coding standard, since only c89 compatibility is required in all common code. But we have been tolerating inline function it because include/nuttx/compiler.h defines 'inline' to be nothing for C89 compilers.

As a result, static inline functions declared within a C file not so bad; the inline qualifier is ignored, if not supported, but otherwise all is well.

But it is catastrophic in header files.  Those static inline functions are included as static functions and implemented in EVERY file that includes those header files, even if the functions are never called.  That makes the code base huge!So there is another PR coming to fix some of the worst offenders.

This commit fixes two of the worst offenders I have encountered so far:  include/nuttx/sempahore.h and cache.h.  But there may be a few other changes needed.  Under include/nuttx there are still inline functions thread.h, inclue/nuttx/list.h, mutex.h, tree.h, and include/nuttx/crypto/blake2s.h with no protection for compilers that do not handler the inline qualifier.  Otherwise we are clean.

With the changes to these two header files, the size of the z20x build is reduced by about 40%.  And incredible size savings.
2020-03-02 22:06:04 +01:00
..
Make.defs
sem_destroy.c Replace #include <semaphore.h> to #include <nuttx/semaphore.h> 2020-02-01 08:27:30 -06:00
sem_holder.c Replace #include <semaphore.h> to #include <nuttx/semaphore.h> 2020-02-01 08:27:30 -06:00
sem_initialize.c
sem_post.c Replace #include <semaphore.h> to #include <nuttx/semaphore.h> 2020-02-01 08:27:30 -06:00
sem_recover.c Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
sem_reset.c Replace #include <semaphore.h> to #include <nuttx/semaphore.h> 2020-02-01 08:27:30 -06:00
sem_setprotocol.c Replace #include <semaphore.h> to #include <nuttx/semaphore.h> 2020-02-01 08:27:30 -06:00
sem_tickwait.c include/nuttx: Fix improper use of inline 2020-03-02 22:06:04 +01:00
sem_timedwait.c include/nuttx: Fix improper use of inline 2020-03-02 22:06:04 +01:00
sem_timeout.c
sem_trywait.c Replace #include <semaphore.h> to #include <nuttx/semaphore.h> 2020-02-01 08:27:30 -06:00
sem_wait.c include/nuttx: Fix improper use of inline 2020-03-02 22:06:04 +01:00
sem_waitirq.c
semaphore.h Replace #include <semaphore.h> to #include <nuttx/semaphore.h> 2020-02-01 08:27:30 -06:00
spinlock.c sched/semaphore/spinlock.c: spin_trylock handle memory barrier and instrumentation correctly. 2019-11-03 19:40:58 -06:00