News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

/STACK question.

Started by jckl, March 25, 2006, 08:55:53 AM

Previous topic - Next topic

jckl

In order to compile one of my apps i had to use /STACK 1000000,1000000... My question is would it hurt to always use this when compiling all of my apps?

Vortex

For general purpose win32 coding, you don't have to use the switch /STACK

asmfan

Vortex,
you are not quite right on this, because i used to write a binary-tree database with deep recursion and i had to use /stack option to avoid overflow.
Russia is a weird place

ChrisLeslie

If /stack option is not specified then there must be a default size. Can anybody tell me what it is?

jckl

iam not sure if i am right but i was reading somewhere that said default size is 1MB.. Will it hurt to always compile with /STACK even if i didnt need it.. The reason i ask is if i make a batch file to run ml, rc, link ect i wouldnt have to do it for each program i make.. I could pass in the path to link, ml and such while i pass in the file name of the asm file and rc file that needs to be built.

hutch--

Stack size ajustment is normally done with the linker with the StackReserve and StackCommit options. The /STACK switch in masm is a left over from DOS and should not be used.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jckl

can you give more info plesase... MSDN didnt return anything on that in my search other than /STACK.

hutch--

Run LINK.EXE /? and read the options.

/STACK:reserve[,commit]
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jckl

thats what i was doing.... my question is would it hurt if i did that on every app i make even my app dont need that much?

hutch--

Probably not but keep in mind that if an app does not need it, you are reserving more memory than you need and this can come into play on a busy machine. The defaut stack size on a PE file is usually 1 meg and you have to have reasonably deep recursion to go past that.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jckl

That answered my question perfectly and is what i thought but i wasnt sure... I guess i can always limit it down or better yet i am not sure ill ever need that much space but it is possibly that i could which is why i had it at that. Thanks for the support  :bg