How to set stack (non initial) commit size of main thread

220 Views Asked by At

The question is not about the minimal stack size (initial commited size). I found how to do it in VS http://msdn.microsoft.com/en-us/library/8cxs58a6.aspx.

In delphi 7(In XE possible to make it easier), I can offer after сompiling edit PE header manually by own utility. But it may have a solution easier.

1

There are 1 best solutions below

16
On

You can use the $MINSTACKSIZE and $MAXSTACKSIZE directives to control what gets written to the PE file. The directives control the stack commit and reserve sizes respectively. As an alternative to using two separate directives you can control both values at once with the $M directive. The documentation is here: http://docwiki.embarcadero.com/RADStudio/en/Memory_allocation_sizes_(Delphi)

These settings can also be controlled in the project options. The location of these options vary between IDE versions but they are found with the linker options: http://docwiki.embarcadero.com/RADStudio/en/Linking