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!fu-berlin.de!uni-berlin.de!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Re: Where are returned values stored? Date: Thu, 3 Jun 2004 17:13:03 +0100 Message-ID: <2i910dFk02i0U1@uni-berlin.de> References: <75s9b0pgo91ctvlm5op2rcql82t9ip4me2@4ax.com> <1dptc.49822$tb4.1731604@news20.bellglobal.com> <2hv1auFhi91aU1@uni-berlin.de> X-Trace: news.uni-berlin.de xqvFioy7QgzSX33ejqVoPg2+bmEp8/qteBe9bmwb0xx0/OU8k= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Xref: g2news1.google.com comp.lang.ada:1073 Date: 2004-06-03T17:13:03+01:00 List-Id: "Robert I. Eachus" wrote in message news:fP2dnc8B4Y6kNyPdRVn-hA@comcast.com... > Warren W. Gay VE3WWG wrote: > > ... > > 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. Don't allocate the address space for the stack and leave > the pointer to the stack null/invalid. When the stack needs to > be used, both the address space and physical space have to be > allocated and can then be used. This helps a lot in Ada, where > most tasks will never need or use the return stack. Um, I think this is one of those comments that needs to be taken with a pinch of salt :-) Are you (Robert) talking about the main (control, primary) stack? I suspect most (in fact, all) tasks will use this, even if not much. The IA-32 actually demands the existence of a valid stack (SS:ESP must be valid) before it will execute anything. I suppose this trick could be used with a secondary stack. I suppose it could apply to tasks prior to the start of their execution. However, it doesn't really detract form the point that, when the stacks /are/ used, they must be allocated somewhere in your address space. -- Nick Roberts