2 ms·
> Everything being static inline makes it hostile to these older systems which have limited RAM If you don't define `PICOPHYSICS_IMPLEMENTATION` then you just
by wren6991 2mo ago
> Everything being static inline makes it hostile to these older systems which have limited RAM
If you don't define `PICOPHYSICS_IMPLEMENTATION` then you just get prototypes and a few struct definitions. From what I could tell the static inline functions are just used as helpers by the non-static functions defined in the implementation TU. It's similar to the stb[1] implementation pattern.
Also, inlining improves code size more often than you might think. There is a lot of ceremony in a function call, and the compiler has to make pessimistic assumptions about what is trashed by the call, causing unnecessary spills and fills. Things like the simple vec3 operations here should pretty much always be made available for inlining; whether the compiler actually decides to inline them is a different story.
[1]: https://github.com/nothings/stb https://github.com/nothings/stb