Is it possible to change the stack size dynamically - how?

Is it possible to dynamically resize a stack in C?

If so, how?

+3
source share
6 answers

It depends on the OS you are using.

On Unix / Linux, you can use POSIX syscall setrlimit()for a resource RLIMIT_STACK.

See more details man setrlimit.

+3
source

Dynamically, do you mean stack resizing during code execution? AFAIK, this is not possible. But you can set the stack size before running the application. You can do this using the "ulimit -s" command on linux, which will set the stack size for the entire process running in this shell.

, VC6 , Project Properties- > link options- > output- > stack allocations- > reserve. , VC8, .

+2

Linux , - . 32- , , .

, , , .

, , , , , .

C/threading. :)

+1

, , , . , . , , , , , . C .

0

, C.

-1

? , C ( ).

, ?

-3
source

Source: https://habr.com/ru/post/1732505/


All Articles