各位大侠:
小弟程序如下:
#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情况相同,即益出点相同,请各位帮忙!
谢谢
小弟程序如下:
#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情况相同,即益出点相同,请各位帮忙!
谢谢
解决方案 »
- 自绘slider滑杆滚动条,怎么添加控制的对象,怎么让它控制对话框窗口的滚动,跟对话框滚动条一样?
- 请问matlab中imfill函数是怎么对灰度图像进行孔洞填充的?
- 用了skin++后,如何自定义控件颜色
- 为什么要多出GetMessage()->TranslateMessage()->DispatchMessage()这3步?让windows自己处理不行吗?
- VC使用DAO打开ACCESS查询记录时,出现"out of memory",搞懂
- 出现Microsoft visual c++ runtime library错误
- 怎样向一个文件结尾加数据?
- 什么是回调函数?主要用在哪些方面,时候,要注意什么呢?糊涂中
- 有关编译时的错误
- 菜鸟求救!List Control的图片
- 寻:VC6编译,支持在win2000上跑的XML读写类,基于MSXML(XML3?)
- -1024的RGB值是多少啊!?
在这里好象无法用/STACK这个LINKER option#pragma comment中支持的linker options只有下面几种:
Only the following linker options are available to be passed to the linker identifier: /DEFAULTLIB
/EXPORT
/INCLUDE
/MERGE
/SECTION 所以在工程配置中设置一下试试
RESERVE 2048
COMMIT 1024
还是不行,难道输入的格式有限制?
RESERVE 10240
COMMIT 2048
但结果还是不变,不知道为什么
//#include "stdafx.h"
#include "stdio.h"
#include "wchar.h"
#include "tchar.h"
#include "windows.h"void recu(int i);int _tmain(int argc, _TCHAR* argv[])
{
recu(1000000); return 0;
}void recu(int i)
{
unsigned long _esp;
_asm mov _esp, esp;
_tprintf( TEXT("ESP = %08x i = %d\n"), _esp, i); i = i - 1;
if( i == 0 )
return;
else
recu(i);
}我的不会, 加了个else就好了
Generally, the reserve size is the default reserve size specified in the executable header. However, if the initially committed size specified by dwStackSize is larger than the default reserve size, the reserve size is this new commit size rounded up to the nearest multiple of 1 MB. 也就是说堆栈的内存大小是有极限的,你设置大于极限的大小是没有用的。
1024000K / 1024 = 1000MB看你楼上星星的话.