Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
103 user(s) are online (56 user(s) are browsing Forums)

Members: 1
Guests: 102

imagodespira, more...

Headlines

 
  Register To Post  

Stack Size
Just popping in
Just popping in


See User information
I need some expert advice regarding stack size. My BlitzMax code seems to run pretty well as the overall design of the language is very heap oriented. However it does integrate with C and C++ and I believe I sometimes run into stack issues especially when invoking GCC to compile some of the C++ bits and pieces that are 3rd Party.

Now I understand I can set a stack cookie and could just set it to a 500k or 1meg and frankly on a minimal system that not a huge loss. Alternatively I have thought about exposing a compile time option to generate a stack cookie and allow user to control. Since this is supposed to be easy to use for end user I am unsure of best approach. I also note that I could just swap out via Exec Swap Stack at App startup. What are some suggestions on more expert Amiga gurus?

Thanks
Doug

Go to top
Re: Stack Size
Quite a regular
Quite a regular


See User information
Any suggestions on setting the stack size anyone?

AmigaOS 4.1 FE Update 2 on Sam440ep-flex, 800Mhz, 1GB RAM, Radeon 9250 Resized Image
A1200/040, 2+4MB, external 3.5''HDD / A1200 (spare) / A500+ (sold) / C128 (sold)
http://m4rko.com/AMIGA
Go to top
Re: Stack Size
Home away from home
Home away from home


See User information
Suggestion is only one: always use stack cookie of 1 mb, then everything will works (always), users will have no needs (ever) to worry about. And if they wish, they always can increase it from console (but in 10 years i see no apps which fail with 1 mb of stack). Through in odyssey i use 2 mb, just to be on VERY safe side :)

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Stack Size
Home away from home
Home away from home


See User information
@Marko

Stack can be set on individual Icon,
it can be set in s:shell-startup
it can be set in scripts
it can be set in workbench prefs.


And it can be compiled into the ELF file using stack cookie. (a static variable declaration that can't be stripped from the ELF file)

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Stack Size
Home away from home
Home away from home


See User information
@kas1e

Never safe some programs use salloc

allocating 1 mb with salloc and your in deep sh*t.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Stack Size
Home away from home
Home away from home


See User information
If you talking stack for running external programs like gcc then 200k is sufficient.

You could could set a stack cookie for that minimum in the main executable and allow the user to set higher ones either in preferences setting or in the icon tooltype.

Setting in the icon is easier as you don't need to swap out your stack before running the main part of your prgram.

If you only need the higher stack for running child programs then remember that you can set the stack via NP_StackSize when calling SystemTagslist()

NP_StackSize (int32) -- The stack size the child process should use.
Defaults to the DOS prefs minimum value or a stack cookie value
that may be found in the executable.

Go to top
Re: Stack Size
Just popping in
Just popping in


See User information
@all

Thanks for the suggestions. I chose to set a default cookie to 256k and added optional argument to override during compile to allow setting from 64k to 1024k. That should cover everything and the weird issues I was seeing with GCC 5.4 disappeared.

Regards
Doug

Go to top
Re: Stack Size
Quite a regular
Quite a regular


See User information
Great, I will try to install/compile BlitzMax again soon and see how it goes.

AmigaOS 4.1 FE Update 2 on Sam440ep-flex, 800Mhz, 1GB RAM, Radeon 9250 Resized Image
A1200/040, 2+4MB, external 3.5''HDD / A1200 (spare) / A500+ (sold) / C128 (sold)
http://m4rko.com/AMIGA
Go to top
Re: Stack Size
Just popping in
Just popping in


See User information
@Marko
Thanks Marko.
Please reach out and let me know of any challenges. I tried to make the self building install as simple as possible and from a hardware perspective. I test builds on X5000 as well as OS 4.1FE update 1 running a super slow I5 laptop under WinUAE around 700 something megs avail. It make take a while to build on the emulated platform but its really helpful as GDB really works unlike the X5000 so lot of kudos to the emulator people as I can single step compiler output.

Regards
Doug

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project