1 2#include <stdlib.h> 3#include <stdio.h> 4 5char * 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{ 28 char *a1, *b1, *a2 __attribute__((unused)), *b2 __attribute__((unused)); 29 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}; 37