[TUHS] C declarations.
Derek Fawcus
dfawcus+lists-tuhs at employees.org
Sun May 14 23:14:44 AEST 2017
On Sat, May 13, 2017 at 03:05:24PM -0400, Random832 wrote:
> On Sat, May 13, 2017, at 08:20, Michael Kjörling wrote:
> > Correct me if I am wrong, but _pass by value_ as opposed to _pass by
> > reference_ requires making a copy, no? That's the whole point, to
> > allow the callee to poke at the value it is given at will.
>
> If that were the issue, the callee could simply automatically make the
> copy if-and-only-if it needs it.
I recall reading a proposed ABI for C on MIPS which would have done
something similar for passing structs by value, namely pass a pointer
but allocate local storage space in the callee. If the callee ever
assigned to the passed struct, it was to copy the actual values,
then update its pointer. I don't think that ABI was ever implemented.
DF
More information about the TUHS
mailing list