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-Thread: 103376,6c7dea22b75ba442 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: ada compiler? Date: Fri, 16 Nov 2007 19:50:03 -0600 Organization: Jacob's private Usenet server Message-ID: References: <1194747665.6151.31.camel@K72> <_evZi.177931$Xa3.50640@attbi_s22> <87hcjq46t4.fsf@ludovic-brenta.org> <473abc9d$0$13104$9b4e6d93@newsspool2.arcor-online.net> <1195035988.599522.87580@50g2000hsm.googlegroups.com> <1195043147.1007.263.camel@kartoffel> <1195052954.315227.220840@o3g2000hsb.googlegroups.com> <473b58af$0$27815$39db0f71@news.song.fi> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1195263986 2369 69.95.181.76 (17 Nov 2007 01:46:26 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 17 Nov 2007 01:46:26 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 Xref: g2news1.google.com comp.lang.ada:18452 Date: 2007-11-16T19:50:03-06:00 List-Id: "Niklas Holsti" wrote in message news:473b58af$0$27815$39db0f71@news.song.fi... ... > My wishlist for stack checking support in Ada compilers: > > Storage_Error should be raised a bit before the stack is fully > exhausted. The amount of "reserve" stack-space left at that point > should be configurable by an option or an environment variable to > an (application-specific) value that lets the exception be raised > and handled. > > While the exception is being propagated and handled (that is, while > it is possible to say "raise;") the application should be able to > use the reserve stack capacity (with possibly a Segmentation > Violation if the reserve capacity is exhausted). > > Normal checking rules (respecting the reserve capacity) should > return into force when the exception has been handled (when it is > no longer possible to reraise the exception). > > But I have no idea how hard that would be to implement... That's pretty close to how Janus/Ada implements, actually, but there is one issue: given that pretty much anything can be called during the handler, and further exceptions raised and handled, it is pretty hard to both allow the reserve capacity to be used and then not allow it to be used. (Moreover, that probably would cause the exception to be immediately raised instantly when the handler completed - because the finalization handlers would overflow - probably not what was intended.) We obviously can't make stack checks more expensive (for obvious reasons; one of the purposes of the reserve is to allow room for interrupt handlers and OS calls, neither of which respect Ada task stacks),. The amount of the reserve can be configured in the runtime system (with just a simple recompile), but we don't have an "option" for configuring it - it seems a rare enough need. Of course, other runtime models (especially those using hardware checking) would be different. Randy.