blob: da13aca87baca7c78ffd018d46442775c808377f [file] [log] [blame]
sewardj35c1c7c2006-08-16 15:07:48 +00001
2#include <stdlib.h>
sewardj42e9bd02006-08-25 13:07:30 +00003#include <stdio.h>
4
sewardj35c1c7c2006-08-16 15:07:48 +00005char * touch_malloc (int size)
6{
7 char * result;
8 int i;
9 result = malloc (size);
10 for (i = 0; i < size; i++)
11 *(result + i) = 'a';
12
13 return result;
14}
15char * touch_realloc (char * ptr, int size)
16{
17 char * result;
18 int i;
19 result = realloc (ptr, size);
20 for (i = 0; i < size; i++)
21 *(result + i) = 'a';
22
23 return result;
24}
25
26int main ( void )
27{
bartf976f6c2011-04-03 17:42:19 +000028 char *a1, *b1, *a2 __attribute__((unused)), *b2 __attribute__((unused));
sewardj35c1c7c2006-08-16 15:07:48 +000029 printf("started\n");
30 a1 = touch_malloc(1600000) ;
31 b1 = touch_malloc(200000) ;
32 a2 = touch_realloc(a1, 1601600) ;
33 b2 = touch_realloc(b1, 200000) ;
34 printf("success\n");
35 return 0;
36};