An array of macro functions?
I have a program which currently calls functions that are located in an array of function pointers. I have to use this method because there are hundreds of functions and which ones to be called can only be determined at runtime (i.e. by the index it is in the array).
This is great but is causing a little problem:
Functions are called rapidly so speed is key. The issue that I have is that the functions being called contain code which are generally only 3-4 lines, so I'm thinking they can truely be macros.
I would like to use macros instead of functions because functions can be too expensive over time (putting variables on the stack, operating on the return address) etc.... Its just extra code I want to try to avoid, and I don't want the overhead of "calling a function"
My question is: Is there a way to provide an array of macro functions? I want to try to eliminate calling functions, because im finding that it could be too expensive. Maybe there is a better way to do it?