Ticket #114: malloc_test.c

File malloc_test.c, 280 bytes (added by pippijn, 15 years ago)

malloc+memset test

Line 
1
2char *
3test_malloc2 (void)
4{
5 int const amt = 1024 * 1024;
6 int i = 0;
7// while (memset (malloc (amt), 0, amt))
8 while (malloc (amt))
9 {
10 ++i;
11 if (i % 10)
12 printf ("%d\n", i);
13 }
14 printf ("Allocated %d chunks of %dB\n", i, amt);
15
16 return NULL;
17}