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!news1.google.com!news.glorb.com!cyclone.bc.net!news-in.mts.net!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Where are returned values stored? References: <75s9b0pgo91ctvlm5op2rcql82t9ip4me2@4ax.com> <1dptc.49822$tb4.1731604@news20.bellglobal.com> <2hv1auFhi91aU1@uni-berlin.de> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Thu, 03 Jun 2004 12:06:55 -0400 NNTP-Posting-Host: 198.96.223.163 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1086278814 198.96.223.163 (Thu, 03 Jun 2004 12:06:54 EDT) NNTP-Posting-Date: Thu, 03 Jun 2004 12:06:54 EDT Organization: Bell Sympatico Xref: g2news1.google.com comp.lang.ada:1074 Date: 2004-06-03T12:06:55-04:00 List-Id: Robert I. Eachus wrote: > Warren W. Gay VE3WWG wrote: >> Anyway, I tend to live in the POSIX world, and so for >> me at least, more stacks means carving up more of the >> precious 2GB address space on 32 bit platforms. Once >> everyone moves to 64 bit processors, then this is less >> of a problem. > > I'm shopping for an Athlon64 right now, and exactly for this reason. ;-) :) >>> But it usually suffices to materialize a minimum return stack if per >>> task if and when it is referenced, and leave it unallocated otherwise. >> >> Yes, of course. You must still however, carve up the >> address space for the stacks, whether the vm pages are >> allocated or not. > > Actually, no. There is one of those obvious in hindsight neat tricks. When I wrote this, I had a feeling that you would reply with this. Agreed again, that you can of course defer the allocation of the address space along with the vm pages. But the real point I was making is that you still have to carve up double the address space required for stacks, for all "active" tasks. > used. This helps a lot in Ada, where most tasks will never need or use > the return stack. True this can help. But if you are planning for the worst case, then you still have to plan as if all stacks (tasks) are required. It doesn't help any when you run out of address space, when the requirements demand it. Or worse, if the code is silly enough not to detect it and overlap with other important memory regions ;-) -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg