I recently used the [`/FAsu` Visual C++ compiler option] to output the source + assembly of a particularly long member function definition. In the assembly output, after the stack frame is set up, there is a single call to a mysterious `_chkstk()` function.
The MSDN page on [`_chkstk()`] does not explain the reason why this function is called. I have also seen the Stack Overflow question [Allocating a buffer of more a page size on stack will corrupt memory?], but I do not understand what the OP and the accepted answer are talking about.
What is the purpose of the `_chkstk()` CRT function? What does it do?
: https://stackoverflow.com/q/4123609/196844 My guess (after reading your links) is that the function sets up protection so writes just outside the functions stack will be caught by the CRT, and can be handled like throwing exceptions in C++ or other things.
以上就是What is the purpose of the _chkstk() function?的详细内容，更多请关注web前端其它相关文章！