I'd be interested to know what seasoned C programmers think is an upper bound for the size of an argument which can be passed by value.
Context: I have occasion to work with 2×2 matrices, which I have in a struct:
typedef struct
{
double a, b, c, d;
} mat_t;
Now it makes life a lot easier if I can pass by value, particularly for composite operations
mat_t A = mat_sum(mat_smul(lambda, B), C);
for A = λB + C, for example. At the same time I'm aware that pass-by-value involves copying things to the runtime stack so comes with a cost if those things are big.
That the C language standard library passes complex numbers by value suggests "two doubles" as a reasonable lower bound, but a reasonable upper bound?