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,88c97d669795535a X-Google-Attributes: gid103376,public From: Michael Rowley Subject: Re: What task storage_size to use? Date: 1997/11/24 Message-ID: <3479C8CF.9F2FEA18@intermetrics.com>#1/1 X-Deja-AN: 292358147 Sender: news@inmet.camb.inmet.com (USENET news) References: <3472A748.213DF2CA@intermetrics.com> <3.0.1.32.19971121191820.00b96cf0@spectre.mitre.org> <34785EC5.740B76B0@intermetrics.com> X-Nntp-Posting-Host: piglet.camb.inmet.com Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1997-11-24T00:00:00+00:00 List-Id: Matthew Heaney wrote: > > In article <34785EC5.740B76B0@intermetrics.com>, Michael Rowley > wrote: > > >Another approach that I am thinking of using is to create my own > >Storage_Pool for the task access type, which would allocate one more > >page than necessary for the task and write protect the extra page. Then > >if there is a page fault on that page I would know that I am within one > >page of running out of stack space, and then try to recover gracefully. > > I don't get it. Why don't you just catch Storage_Error? Two reasons. First, at least as of Gnat3.07 or so (I haven't checked recently) overflowing the stack didn't generate a storage error. Apparently, according to Robert Dewar, that is now fixed. Second. It would be very difficult for me to clean up after a storage error that could have happened at almost any place in my program. There are certain places in my program where I would like to be able to ask: am I almost out of stack space? If I did the memory protection scheme that I mentioned above, I would NOT generate an exception. Instead, I would unprotect the page and then set a global variable, which would be checked before the stack got much deeper. That variable would signify that I better stop growing the stack now. Michael Rowley rowley@inmet.com