I\'m testing the timing of an algorithm that does lots of recursive calls. My program dies at about 128k recursive calls, and this takes only .05 seconds. I\'d like to allow
Take a look at setrlimit():
RLIMIT_STACK
This is the maximum size of the initial thread's stack, in bytes. The implementation does not automatically grow the stack beyond this limit. If this limit is exceeded,SIGSEGV
shall be generated for the thread. If the thread is blockingSIGSEGV
, or the process is ignoring or catchingSIGSEGV
and has not made arrangements to use an alternate stack, the disposition ofSIGSEGV
shall be set toSIG_DFL
before it is generated.