[net.micro.atari16] recursion in megamax C

cgoudeseune@watnot.UUCP (center of gravity) (10/10/86)

[]

I've ported a C program to draw Julia sets (skins of fractal dragons) from
a vax here at U of W to my 1040st.  It uses recursion, and on the vax this
goes about 500 to 3000 levels deep, depending on what values i feed to the
program.  Unfortunately, when i moved it to my ST, it died after about 170
nested recursive calls.  Further experimentation indicated that only about
7800 bytes is available for local variables, parameters, and return addresses
on the stack from megamax C.  The manual claims that if you want more stack
space, you can modify the STACKSIZE constant in \megamax\init.c; I changed it
to 64000 bytes and a few other values, but to no avail.
Help!
Does anyone out there know how to make the stack as big as you want?
It seems to me that some other code internal to megamax didn't realize
i'd changed STACKSIZE from the original 8K, if that's any help.

	Thanks in advance,
		Camille.

lbl@druhi.UUCP (LocklearLB) (10/12/86)

In article <12066@watnot.UUCP>, cgoudeseune@watnot.UUCP writes:
> []
> 
> I've ported a C program to draw Julia sets (skins of fractal dragons) from
> a vax here at U of W to my 1040st.  It uses recursion, and on the vax this
> goes about 500 to 3000 levels deep, depending on what values i feed to the
> program.  Unfortunately, when i moved it to my ST, it died after about 170
> nested recursive calls.  Further experimentation indicated that only about
> 7800 bytes is available for local variables, parameters, and return addresses
> on the stack from megamax C.  The manual claims that if you want more stack
> space, you can modify the STACKSIZE constant in \megamax\init.c; I changed it
> to 64000 bytes and a few other values, but to no avail.
> Help!
> Does anyone out there know how to make the stack as big as you want?
> It seems to me that some other code internal to megamax didn't realize
> i'd changed STACKSIZE from the original 8K, if that's any help.
> 
> 	Thanks in advance,
> 		Camille.

Camile,

After you changed the init.c program and compiled it, are you sure the new
verion was used when you linked your program?  To use a new init you must 
do one of two things:

1) Specify init.o on the command line to the linker along with the other 
.o's for your program.  This will tell the linker that you want to override 
the init.o found in the system library.

2) Replace the init.o in the 'syslib' library with your altered one.  Now
the altered one will be used automatically.

If you already tried these two methods and it still doesn't work, then I'm
not sure what the problem is.  If this is the case, let me know the answer
when you find out! :)

Barry Locklear
AT&T Information Systems Labs
Denver, CO 80241
(303)538-4954
ihnp4!drutx!druhi!lbl

cgoudeseune@watnot.UUCP (center of gravity) (10/24/86)

In article <1125@druhi.UUCP> lbl@druhi.UUCP (LocklearLB) writes:
>In article <12066@watnot.UUCP>, cgoudeseune@watnot.UUCP writes:
>> ...
>> Does anyone out there know how to make the stack as big as you want?
>> It seems to me that some other code internal to megamax didn't realize
>> i'd changed STACKSIZE from the original 8K, if that's any help.
>> ...
>
>After you changed the init.c program and compiled it, are you sure the new
>verion was used when you linked your program?  To use a new init you must 
>do one of two things:
>
>1) Specify init.o on the command line to the linker along with the other 
>.o's for your program.  This will tell the linker that you want to override 
>the init.o found in the system library.
>
>2) Replace the init.o in the 'syslib' library with your altered one.  Now
>the altered one will be used automatically.
>
>If you already tried these two methods and it still doesn't work, then I'm
>not sure what the problem is.  If this is the case, let me know the answer
>when you find out! :)
>
>Barry Locklear
>ihnp4!drutx!druhi!lbl

Thanks, I knew it was something silly like that.  Option no. 1 didn't seem
to work, but no. 2 works just dandy.  I'll post the source to the net once
i've commented it a wee bit.

	Camille Goudeseune