C++ programming

Greg Lindahl lindahl at keyresearch.com
Mon Oct 21 11:00:08 PDT 2002


On Mon, Oct 21, 2002 at 07:51:57PM +0200, Jakob Oestergaard wrote:

> The C example must *always* generate one function call to the
> compare_int function whenever two elements of the array are compared.

Nope. A good C compiler can generate multiple copies of a routine when it
is sometimes called with constant arguments. In this case, the constant
argument would be the compare_int function, and in the routine with that
constant argument, compare_int could be inlined.

Yes, there are C compilers that can do this. gcc isn't one of them.

-- greg



More information about the Beowulf mailing list