
Giovanni Piero Deretta wrote:
On Nov 13, 2007 3:19 AM, Jeff Garland <jeff@crystalclearsoftware.com> wrote:
That 'irrelevant stack manipulation code' isn't irrelevant at all...it's the function call overhead cost and would likely *not exist* in a fully static version. Same with the stuff right before the return.
Actually the stack manipulation is for the test function, not for the bound checking function, so, as Robert said, it is completely irrelevant in this context. In fact the __Z4testv: is just that, the mangled name of the test function.
<snip>...
From a cursory look I can se no use of function pointers, nor I would expect it: the bounds are knonw at compile time so there is no need of dynamic dispatch. The framework seems to allow dynamic (runtime) bounds, but even in that case, i see no need for dynamic dispatch.
Ok, fair enough. I must have some misunderstanding of the implementation b/c I don't see how the function call can be optimized away by the compiler when the function pointer can be set at runtime. Anyway, I'm satisfied that it's efficient as possible. Jeff