[comp.sys.amiga.programmer] Setting the Stack

etxtomp@eos.ericsson.se (Tommy Petersson) (01/15/91)

In article <3589@bruce.cs.monash.OZ.AU> roddi@bruce.cs.monash.OZ.AU (Roddi Walker) writes:
>
>
>
>G'Day Netters!
>		This may seem like a ridiculous question, but it's got
>me stumped.
>	I want to set my stack to 100,000 bytes (I've got mountains of
>RAM), so I accordingly put the line 'stack 100000' into my
>startup-sequence.
>	The weird thing is that when I type 'stack' from a CLI to
>query the stack size, it report 4000 - the default size.
>	I seems that my stack size is somehow being reset, perhaps
>by something in my startup-sequence.  Can anyone out there shed
>some light on this?
>
>Thanks in advance,
>
>Rod

I noticed the same problem, so Your Startup-Sequence isn't exceptionally
weird!

Is the stack perhaps shell/cli specific, so you get the default
whenever a new shell is started? I beleive there is a shell-startup
file one could use then, isn't it?

I use now IconX scripts instead of cli calls, so I didn't really bother
finding it out, but it would be nice to know. Anyone?

Tommy Petersson
etxtomp@eos.ericsson.se

dave@cs.arizona.edu (Dave P. Schaumann) (01/15/91)

In article <1991Jan15.141459.8682@ericsson.se> etxtomp@eos.ericsson.se writes:
>In article <3589@bruce.cs.monash.OZ.AU> roddi@bruce.cs.monash.OZ.AU (Roddi Walker) writes:
>>G'Day Netters!
>>		This may seem like a ridiculous question, but it's got
>>me stumped.
>>	I want to set my stack to 100,000 bytes (I've got mountains of
>>RAM), so I accordingly put the line 'stack 100000' into my
>>startup-sequence.
>>[...]
>I noticed the same problem, so Your Startup-Sequence isn't exceptionally
>weird!
>[...]

I already answered Roddi Walker via e-mail, but since there seems to be some
confusion about this, I will answer publicly.

The 'stack' command is only effective on the cli/shell in which it is invoked.
That means when the initial CLI (that executes s:Startup-Sequence) exits, any
'stack' command you placed there will have no further effect.  If you want to
have your shell start up with a 100000 byte stack, put 'stack 100000' in the
file s:Shell-Startup (s:CLI-Startup for the CLI).  Other shells like SKsh and
Csh have similar startup files to use.

>Tommy Petersson
>etxtomp@eos.ericsson.se


Dave Schaumann		|  And then -- what then?  Then, future...
dave@cs.arizona.edu	|  		-Weather Report

higgin@cbmvax.commodore.com (Paul Higginbottom - CATS) (01/15/91)

In article <3589@bruce.cs.monash.OZ.AU> roddi@bruce.cs.monash.OZ.AU (Roddi Walker) writes:
$	I want to set my stack to 100,000 bytes (I've got mountains of
$RAM), so I accordingly put the line 'stack 100000' into my
$startup-sequence.
$	The weird thing is that when I type 'stack' from a CLI to
$query the stack size, it report 4000 - the default size.
$	I seems that my stack size is somehow being reset, perhaps
$by something in my startup-sequence.  Can anyone out there shed
$some light on this?

You're probably setting the stack AFTER you do LoadWB, and thus
Workbench is launching a new shell or cli with the default 4000
byte stack space.

Another thing you can do since you may not want EVERY process getting
100K is to simply put it in your s:Shell-Startup file so that each
shell gets 100K of stack.

	Paul.