I will post code later if I have the time.  But Metal C's stack is about as
simple as you can get, although it does work without a net.  I don't like
that at all: soiling yourself is not the way to handle stack overflow.
However, my code merely checks for overflow and then abends if it does.  If
that happens, you specify a bigger stack, and run it again.  There's no
real problem allocating the biggest possible area for the stack (of course,
leaving enough storage for other things) as the system doesn't do anything
but reserve the address range on GETMAIN (it should go without saying you
don't "clear" the memory or anything else to cause the memory to be created
before it's needed).

Just to SWAG it, a 4mb stack with an average 4kb frame would allow more
than 1000 levels-deep calling.  And 4mb is practically nothing.

If memory is actually constrained, then a real overflow handler may be
needed.  That is more complicated; but not terribly so.

sas

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to