GRASS Programmer's Manual
6.5.svn(2014)-r66266
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
•
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
}
VOID_T
#define VOID_T
Definition:
qtree.h:17
link::next
struct link * next
Definition:
linkm.c:21
malloc
void * malloc(YYSIZE_T)
link::let
char let
Definition:
linkm.c:20
main
int main(int argc, char *argv[])
Definition:
gem/main.c:302
free
void free(void *)
link
Definition:
linkm.c:18
lib
linkm
malloc.c
Generated on Sat Jan 2 2016 01:46:48 for GRASS Programmer's Manual by
1.8.5