Declare your function "static inline" in the header file and the compiler will usually inline it with -O2 level optimisations.