简体   繁体   English

Cygwin / Windows 64bit上的堆栈大小是多少?

[英]Whit is the stack size on Cygwin/Windows 64bit?

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. 我想知道cygwin 64位Windows的堆栈大小。 I'm programming with C on netbeans and i tried to make a stack overflow to find the answer. 我在Netbeans上用C编程,我试图使堆栈溢出以找到答案。 From the code I obtained 43104 as result... Now, what this number is? 从代码中我得到43104作为结果...现在,这个数字是多少? bit-Kb-Mb? 位KB-MB? I hope you could help me, sorry for my english :) 我希望你能帮助我,对不起我的英语:)

Since you are using cygwin this is very easy with getrlimit 由于您正在使用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;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM