function pointer overhead?

Brian Scearce bls at u02.svl.cdc.com
Fri Dec 14 09:35:38 AEST 1990


bglenden at mandrill.cv.nrao.edu (Brian Glendenning) writes:
>Someone once told me that calling through a function pointer can cause
>significant overhead. Is this true? If so, for what types of machines
>is it true?

With our compiler on our machine, you can slow code down by using
pointers to functions -- but not in the obvious way.

For static functions that don't have their addresses taken, parameters
are passed in registers.  If you take the address of the function,
it might be called from without, and we can't do this neat
optimization.

--
     Brian Scearce (bls at robin.svl.cdc.com  -or-  robin!bls at shamash.cdc.com)
        "How do you explain the vast discrepancy between your testimony
         and my client's?" "He has perjured himself." "Objection!" "I am
         under oath.  I was there.  He *is* lying."
 Any opinions expressed herein do not necessarily reflect CDC corporate policy.



More information about the Comp.lang.c mailing list