Ticket #3349: test_mem.c

File test_mem.c, 402 bytes (added by oco, 16 years ago)
Line 
1
2int main()
3{
4 void *p;
5 printf("Allocating a lot of memory\n");
6 p = sbrk(1500000000);
7 if (p == 0)
8 {
9 printf("error\n");
10 };
11 printf("%x\n", p);
12
13 printf("Allocating 1000 bytes\n");
14 p = sbrk(1000);
15 if (p == 0)
16 {
17 printf("error\n");
18 };
19 printf("%x\n", p);
20
21 printf("Allocating 1000 bytes\n");
22 p = sbrk(1000);
23 if (p == 0)
24 {
25 printf("error\n");
26 };
27 printf("%x\n", p);
28
29 gets();
30 return 0;
31}