GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
malloc.c
Go to the documentation of this file.
1 /*
2  ** Written by David Gerdes US Army Construction Engineering Research Lab
3  ** April 1992
4  ** Copyright 1992 USA-CERL All rights reserved.
5  **
6  */
7 
8 /*
9  ** takes 1st command line argument and stuffs each letter of it into
10  ** a linked list. then prints it back out to stdout.
11  ** If a second argument is specified, the first argument is put in the
12  ** list backwards.
13  */
14 #include <stdio.h>
15 #include <grass/linkm.h>
16 
17 struct link
18 {
19  char let;
20  struct link *next;
21 };
22 
23 int main(int argc, char *argv[])
24 {
25  register int i;
26  VOID_T *head;
27  struct link List, *tmp, *p;
28  int rev = 0;
29 
30 
31  for (i = 0; i < 2000000; i++) {
32  p = (struct link *)malloc(sizeof(struct link));
33  free(p);
34  }
35 
36 
37  exit(0);
38 }
#define VOID_T
Definition: qtree.h:17
void * malloc(YYSIZE_T)
int main(int argc, char *argv[])
Definition: gem/main.c:302
void free(void *)