Based on RLIMIT_STACK or the equivalent.
RLIMIT_STACK
Declared in <llvm/Support/ProgramStack.h>
<llvm/Support/ProgramStack.h>
unsigned int getDefaultStackSize();
the default stack size for this platform.