读书人

tc 用户内存解决方法

发布时间: 2012-03-09 16:54:57 作者: rapoo

tc 用户内存
tc提供给用户的内存 有64KB,但我写了一个 测试程序,测试结果怎么只有61KB。请高手 帮忙解答,谢谢!!!

代码如下:
#include <stdio.h>
#include <stdlib.h>
main()
{
int KB = 0;
while( malloc(1 < < 10) ) KB += 1;
printf( "Allocated total %d KB ", KB);
}
在tc 2.0下运行结果:
Allocated total 61 KB


[解决办法]
调整 内存模式
[解决办法]
malloc是在堆上 分配的

读书人网 >C语言

热点推荐