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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e5eb8ca5dcea2827 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Ada OO Mechanism Date: 1999/06/09 Message-ID: <7jlfnv$g3a$1@nnrp1.deja.com>#1/1 X-Deja-AN: 487428411 References: <7i05aq$rgl$1@news.orbitworld.net> <7i17gj$1u1k@news2.newsguy.com> <7icgkg$k4q$1@nnrp1.deja.com> <3749E9EC.2842436A@aasaa.ofe.org> <7id2eo$fag@drn.newsguy.com> <3749FF7D.F17CE16A@aasaa.ofe.org> <374AC676.F7AE0772@lmco.com> <7ieuja$5v9@news1.newsguy.com> <7ifd6l$bmf@sjx-ixn1.ix.netcom.com> <1999Jun8.151014.1@eisner> <375D9A3D.E1CCCC63@averstar.com> X-Http-Proxy: 1.0 x33.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Wed Jun 09 10:30:22 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-06-09T00:00:00+00:00 List-Id: In article <375D9A3D.E1CCCC63@averstar.com>, Tucker Taft wrote: > For functions that return objects of size unknown to the caller, the > function creates the object on (or copies the object to) the secondary > stack, and then returns from the function *without* releasing the > secondary stack. The caller takes care of releasing the secondary stack > once they are through with using the returned object. > > There are other compilers that use "local" heaps, or other heap-based > mechanisms. They all still typically use some kind of mark/release, > though it may be a mark/release on a linked-list of objects, rather > than on a secondary stack. By far the most efficient method of handling variable length returned values is to return with the stack pointer depressed so that the newly created value is still available. However this cannot be done without wandering a bit outside the standard ABI, and is thus infeasible in GNAT, which always uses the standard ABI calling sequence. Actually there is one routine alloca, which works the same way, and indeed alloca has to be built in on many compilers, precisely because it does not fit the standard ABI calling sequence. Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.