Judger/tests/12/Main.c
2016-03-02 19:36:26 +08:00

19 lines
396 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* 测试内存限制允许分配的内存为限制参数2倍本测试用例分配了150M在两倍范围内能分配成功最后被标记为内存超限
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
// 150m
int big_size = 150 * 1024 * 1024;
int *b = NULL;
b = (int *)malloc(big_size);
memset(b, 0, big_size);
return 0;
}