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

19 lines
384 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倍本测试用例分配了300M超过两倍范围内不能分配成功运行出错
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
// 300m
int big_size = 300 * 1024 * 1024;
int *b = NULL;
b = (int *)malloc(big_size);
memset(b, 0, big_size);
return 0;
}