comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: What task storage_size to use?
Date: 1997/11/24
Date: 1997-11-24T00:00:00+00:00	[thread overview]
Message-ID: <dewar.880419573@merv> (raw)
In-Reply-To: 3479C8CF.9F2FEA18@intermetrics.com


Michael said

<<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.
>>


Well 3.07 is indeed truly ancient at this stage, and indeed, on some
targets, lacked stack overflow checking, but the current version of
GNAT supports stack overflow checking. The algorithm used by GNAT allows
for a stack buffer space which is guaranteed available when a storage
error is signalled.

You can trivially adjust this buffer size to meet your needs, and just
set the global variable in a storage error handler (actually it had
better NOT be a global variable, but rather a task specific one, use
task_Attributes if necessary).





  reply	other threads:[~1997-11-24  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3472A748.213DF2CA@intermetrics.com>
     [not found] ` <3.0.1.32.19971121191820.00b96cf0@spectre.mitre.org>
1997-11-23  0:00   ` What task storage_size to use? Michael Rowley
1997-11-23  0:00     ` Matthew Heaney
1997-11-24  0:00       ` Michael Rowley
1997-11-24  0:00         ` Robert Dewar [this message]
1997-11-24  0:00       ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox