How can I increase the stack size in Code::Blocks?
I\'ve read this and it says default stack size in VS is 1MB. Now as far as I am concerned, it has nothing to do wi
The default size comes from the .exe, not the OS.
From MSDN:
The default size for the reserved and initially committed stack memory is specified in the executable file header.
Specifically, the stack reserve and commit sizes are specified in the IMAGE_OPTIONAL_HEADER structure in a PE file. This can usually be set to a specific value with a linker parameter. With the MinGW toolchain you can try something like -Wl,--stack,52428800
as a gcc parameter. This option might exist in the IDE you are using, just look for build and/or linker settings.
This applies to the first thread, other threads can override the default if you specify a non-zero value when you call CreateThread
.