This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
how to pass params to inline functions by reference or value?
- From: VM <mayeski at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 10 Apr 2008 00:26:06 -0400
- Subject: how to pass params to inline functions by reference or value?
Hello,
I'm trying to decide on the best way to pass parameters to inline
function. For example, the two functions below:
inline int
sum(atype_t *x)
{
return x->a + x->b;
}
and
inline int
sum(atype_t x)
{
return x.a + x.b;
}
Since the function is inline, my guess is that the compiler will
generate identical code for both. So there should be no performance
difference.
Is this assumption correct?
V