Actually I don't think that this will safe memory, on the contrary. The static inline function is quite big, as it employs to function calls.