On Linux, using C, assume I have an dynamically determined n
naming the number of elements I have to store in an array (int my_array[n]
) just for a short period of time, say, one function call, whereby the called function only uses little memory (some hundred bytes).
Mostly n
is little, some tenths. But sometimes n
may be big, as much as 1000 or 1'000'000.
How do I calculate, whether my stack can hold n*o + p
bytes without overflowing?
Basically: How much bytes are there left on my stack?