Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the size of stack in VC++?

I want accurate information about stack overflowing in VC++ (32 bit and 64 bit), and specially in recursion. In Debug mode, this happens so soon in recursion (like 4500 running of a simple recursive function don't do anything or like). However, it seems release mode is different. It was hard to understand, and I didn't test it by now, because optimization deletes the code that doesn't do anything (apparently removes recursion), as my code or function was so .. I should do more.. I measure the right time in optimized release, I don't know if optimization does the same in more complex quick sort implemented by recursion?

Thanks!

like image 661
user683595 Avatar asked Dec 22 '12 09:12

user683595


1 Answers

As Andreas Brinck states in his related answer:

In VC++ the default stack size is 1 MB i think, so with a recursion depth of 10.000 each stack frame can be at most ~100 bytes.

This stack size limit can be modified using:

Project → Properties → Configuration Properties → Linker → System → Stack Reserve Size.

Project → Properties → Configuration Properties → Linker → System → Stack Reserve Size.

like image 166
Rahul Tripathi Avatar answered Nov 09 '22 01:11

Rahul Tripathi