[Swan-dev] Use of "struct chunk", "chunk_t", or "chunk_t *" or ...?

Andrew Cagney andrew.cagney at gmail.com
Wed Jan 7 17:32:04 EET 2015


One technical nit ...

> | - for a parameter, is pass by value (struct chunk) or reference
> | prefered (struct chunk *)?
>
> I'm not sure that there is consistency in the existing code.  Perhaps
> that's why you ask.
>
> If it is just being passed along, obviously a chunk_t * is cheaper.

This might have been true for the VAX's parameters-on-stack ABI (and
worse for the brain-dead register starved i386 and its ABI) but isn't
true today.  Small structs get passed by register.

In the case of pluto, its all the crypto (I also wonder about some of
the buffer shuffling) that hurts performance, something like this is
in the noise.


More information about the Swan-dev mailing list