4 ms·
Macros are heavily used to avoid making function calls. I'd glad you find it readable - I hope you're right :-)
by liblfds 10y ago
Macros are heavily used to avoid making function calls.
I'd glad you find it readable - I hope you're right :-)
- pantalaimon 10y agoBut wouldn't a static inline achieve the same thing while keeping type-safety?
- liblfds 10y agoYes. As I understand it, this requires either that every to-be-inlined function is present in the public header file, so it can be #included into every user source file which wishes to use those functions, so they turn up in the object file and so can be inlined, or we rely on the compiler and linker to inline across object files, which is not commonly supported. It depends upon the compiler having inlining support - the library is targetting arbitrary compilers on bare metal platforms, so it's not necessarily a valid assumption. Currently, there stil remain two uses of inlining, and I am aiming to get rid of them too in the next release. This also removes a macro from the porting layer, making it simpler.