Pelles C forum

C language => Beginner questions => Topic started by: nickhere on December 08, 2014, 07:19:19 PM

Title: simple question set stack on linker
Post by: nickhere on December 08, 2014, 07:19:19 PM
I am programing in hla assembly
I need to increase the stack

what is the proper  format for the linker
/stack????
Title: Re: simple question set stack on linker
Post by: jj2007 on December 09, 2014, 12:02:59 AM
/stack:reserve, commit

/stack:1024 reserves 1024 bytes
/stack:1024, 1024 reserves and commits 1024 bytes

Have a look at SetProcessWorkingSetSize (http://msdn.microsoft.com/en-us/library/windows/desktop/ms686234%28v=vs.85%29.aspx), though, and google SetProcessWorkingSetSize linker /stack option
Title: Re: simple question set stack on linker
Post by: nickhere on December 09, 2014, 12:22:38 AM
POLINK: warning: Unrecognized option '/STACK:1024,1024'; ignored.
doesnt work
Title: Re: simple question set stack on linker
Post by: jj2007 on December 09, 2014, 12:38:56 AM
Strange. No warning here, although the option apparently has no effect. SetWorkingSize looks more promising.
Sometimes I use EmptyWorkingSet(GetCurrentProcess)   , and working set drops from 1.7MB to 600kB
See also STACKSIZE option in def files.
Title: Re: simple question set stack on linker
Post by: TimoVJL on December 09, 2014, 06:28:55 AM
For me it sets IMAGE_OPTIONAL_HEADER SizeOfStackReserve and SizeOfStackCommit values.
Title: Re: simple question set stack on linker
Post by: frankie on December 09, 2014, 02:05:43 PM
Quote from: nickhere on December 09, 2014, 12:22:38 AM
POLINK: warning: Unrecognized option '/STACK:1024,1024'; ignored.
doesnt work

The command works and, as Timo said insert that values in the PE file.
Please post the compiler version you are using and the full command line as you type it.
Title: Re: simple question set stack on linker
Post by: jj2007 on December 09, 2014, 03:41:38 PM
Can you see an effect on memory usage seen through task manager?