Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!timbuk!shamash!bls From: bls@u02.svl.cdc.com (Brian Scearce) Newsgroups: comp.lang.c Subject: Re: function pointer overhead? Message-ID: <29284@shamash.cdc.com> Date: 13 Dec 90 22:35:38 GMT References: Sender: usenet@shamash.cdc.com Lines: 19 bglenden@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@robin.svl.cdc.com -or- robin!bls@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.