how to pass params to inline functions by reference or value?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux