Change stack size for a C++ application in Linux during compilation with GNU compiler

前端 未结 4 1872
轻奢々
轻奢々 2020-11-22 03:42

In OSX during C++ program compilation with g++ I use

LD_FLAGS= -Wl,-stack_size,0x100000000

4条回答
  •  萌比男神i
    2020-11-22 04:41

    Change it with the ulimit bash builtin, or setrlimit(), or at login with PAM (pam_limits.so).

    It's a settable user resource limit; see RLIMIT_STACK in setrlimit(2).

    http://bytes.com/topic/c/answers/221976-enlarge-stack-size-gcc

提交回复
热议问题