Ticket #12438: test_sbrk.c

File test_sbrk.c, 336 bytes (added by oco, 8 years ago)

Unit test that show that 512 Mo is impossible to allocate using the new sbrk implementation

Line 
1#include <stdio.h>
2#include <unistd.h>
3
4int main()
5{
6 void* a;
7 // try allocate some more memory using sbrk : 512 Mo here
8 a = sbrk(512*1024*1024);
9 printf("0x%x\n", a);
10 if (a == (void*)-1)
11 {
12 // getchar is usefull to keep the process in memory and look at
13 // the area map using listarea
14 //getchar();
15 return 1;
16 }
17 return 0;
18}