From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8e64f4db20d57eb5 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Call by reference vs. call by value Date: 1996/07/22 Message-ID: #1/1 X-Deja-AN: 169597859 references: <31F10E50.726@egr.uri.edu> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-07-22T00:00:00+00:00 List-Id: Chris said "Well, I guess I never conceived a machine might exist where call-by- value for anything bigger than a word is more efficient than call by reference, so my first instinct would be to dictate that call-by-reference be used in all cases. I believed the opposite was true, however, because I wrongly thought that the designers of Ada valued safety over performance, which is not really true." Well as I hope is clear from my earlier post, your conception was not broad enough :-) Cases where values larger than one word are more efficiently passed by copy: - when bit alignment is involved (packed case) - several words can be passed in registers (according to many ABI's) - caller and callee are in different address spaces and here are undoubtedly more. Note that the idea of allowing implementation freedom here is not new. Fortran-66 is quite explicit in leaving it up to the implementation whether parameters are passed by value or reference.