Whit是Cygwin / Windows 64bit的堆栈大小?(Whit is the stack size on Cygwin/Windows 64bit?)

编程入门 行业动态 更新时间:2024-10-28 20:27:43
Whit是Cygwin / Windows 64bit的堆栈大小?(Whit is the stack size on Cygwin/Windows 64bit?)

我试图在网上搜索,但我没有找到任何关于它。 只有如何增加堆栈大小和类似。 我想知道windows的cygwin 64位的堆栈大小。 我在netbeans上用C编程,我试图让堆栈溢出来找到答案。 从我获得的代码43104结果......现在,这个数字是多少? 位KB-MB? 我希望你能帮助我,对不起我的英语:)

i tried to search on the net but i didn't find anything about it. Only how to increase stack size and similar. I want to know the stack size on cygwin 64 bit for windows. I'm programming with C on netbeans and i tried to make a stack overflow to find the answer. From the code I obtained 43104 as result... Now, what this number is? bit-Kb-Mb? I hope you could help me, sorry for my english :)

最满意答案

由于您正在使用cygwin因此使用getrlimit非常容易

#include <stdio.h> #include <sys/resource.h> #include <sys/time.h> int main(void) { struct rlimit rl; if (getrlimit(RLIMIT_STACK, &rl) != 0) return -1; fprintf(stdout, "current: %ld kB\n\n", rl.rlim_cur / 1024); return 0; }

Since you are using cygwin this is very easy with getrlimit

#include <stdio.h> #include <sys/resource.h> #include <sys/time.h> int main(void) { struct rlimit rl; if (getrlimit(RLIMIT_STACK, &rl) != 0) return -1; fprintf(stdout, "current: %ld kB\n\n", rl.rlim_cur / 1024); return 0; }

更多推荐

本文发布于:2023-07-23 04:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1227548.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:堆栈   大小   Windows   Cygwin   Whit

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!