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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,984d3d7860d7c8c X-Google-Attributes: gid103376,public Path: g2news1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news.illinois.net!attcg1!ip.att.net!news.binc.net!kilgallen From: Kilgallen@SpamCop.net (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: Where are returned values stored? Date: 7 Jun 2004 07:09:57 -0600 Organization: LJK Software Message-ID: References: <75s9b0pgo91ctvlm5op2rcql82t9ip4me2@4ax.com> <1dptc.49822$tb4.1731604@news20.bellglobal.com> <2hv1auFhi91aU1@uni-berlin.de> <2i910dFk02i0U1@uni-berlin.de> NNTP-Posting-Host: eisner.encompasserve.org X-Trace: grandcanyon.binc.net 1086610178 25913 192.135.80.34 (7 Jun 2004 12:09:38 GMT) X-Complaints-To: abuse@binc.net NNTP-Posting-Date: Mon, 7 Jun 2004 12:09:38 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:1188 Date: 2004-06-07T07:09:57-06:00 List-Id: In article , "Robert I. Eachus" writes: > This is a "meta-point" that needs to be made again and again. Ada > compilers use many 'solutions' that assume that "under normal > circumstances" performance will be fine. Normal circumstances for Ada > includes decent software engineering practice. There are lots of > 'newbie' questions, like this one, where the answer has to reference > software engineering practice to describe WHY things are done the way > they are done. > > In this case, the assumption is that in Ada, functions do not normally > return 'large' objects, but that large is defined in terms of > performance in the execution environment, not some arbitrary limit. So > if a program uses some function that returns a multi-megabyte String, in > some execution environments this will be a problem. But if Integer is a > 32-bit type, the language will allow you to try to return a 2 Gigabyte > String. On most hardware, you will fail, but if you are running your > program on a 64-bit system with more 4 Gigs of memory, performance won't > be bad at all. Merely having hardware capable of 64-bit addressing does not speed the copying of that 2 Gigabyte string, so performance might be awful. On the other hand, there is a greater likelyhood the program will run to completion, which is a correctness issue.