挑战malloc极限,看看你的系统有多大的内存分配能力

/**: MallocLimit.c
 * by lonelyforest
 *这个程序在DOS下运行,将会输出您的内存到底能够
 *分配多大!!!
 */
#include <stdio.h>
#include <stdlib.h>

int main()
{
 int MB = 0;
 while ( malloc(1<<20) ) ++MB;
 printf("/n has %d MB memory!/n", MB);
 return 0;
}

posted on 2006-03-05 11:33  h2内存数据库  阅读(207)  评论(0)    收藏  举报

导航