Can you set the size of the call stack in c++? (vs2008)

隐身守侯 提交于 2019-12-02 04:34:30

With the Microsoft compiler you can use /F to set the stack size, however it seems like you should just allocate the object on the heap. You should have a reason you're allocating this on the stack rather than the heap.

Edit: This page gives a good cross-platform breakdown, though it may be dated.

You can use the /F compiler flag to set the default stack size, or specify it as the second parameter to the CreateThread function.

Rather than mess with with the stack size, why don't you simply use a std::vector or even dynamically allocate an array yourself?

You could create a new thread for this work. You can generally specify the size of the stack when creating a thread, and certainly with vs2008's CreateThread() function

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!