递归调用,STACK OVERFLOW,修改VC #pragma comment(linker,"/STACK:10240,2048")无效解决办法
递归调用,STACK OVERFLOW,修改VC #pragma comment(linker,"/STACK:10240,2048")无效
各位大侠:
小弟程序如下:
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <math.h>
#pragma comment(linker, "/STACK:10240,2048 ")
void diufan(int i)
{
int sp_;
_asm {
// mov esp, 0x400;
mov sp_, esp; //// mov sp_, esp;
};
i = i - 1;
if(i == 0) return ;
printf( "%d %d\n\r ",sp_,i);
diufan(i);
}
void main()
{
diufan(1000000);
}
但是似乎和系统默认的OVERFLOW情况相同,即益出点相同,请各位帮忙!
谢谢
------解决方案--------------------
当然,进程的堆栈的极限肯定大于线程的极限,但是不会超出太离谱。
------解决方案--------------------
1048576000字节 / 1024 = 1024000 K字节
1024000K / 1024 = 1000MB
看你楼上星星的话.
各位大侠:
小弟程序如下:
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <math.h>
#pragma comment(linker, "/STACK:10240,2048 ")
void diufan(int i)
{
int sp_;
_asm {
// mov esp, 0x400;
mov sp_, esp; //// mov sp_, esp;
};
i = i - 1;
if(i == 0) return ;
printf( "%d %d\n\r ",sp_,i);
diufan(i);
}
void main()
{
diufan(1000000);
}
但是似乎和系统默认的OVERFLOW情况相同,即益出点相同,请各位帮忙!
谢谢
------解决方案--------------------
当然,进程的堆栈的极限肯定大于线程的极限,但是不会超出太离谱。
------解决方案--------------------
1048576000字节 / 1024 = 1024000 K字节
1024000K / 1024 = 1000MB
看你楼上星星的话.