Commit | Line | Data |
---|---|---|
cffab432 CL |
1 | .\" Copyright (c) 1991 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
043368e6 KB |
4 | .\" This code is derived from software contributed to Berkeley by |
5 | .\" the American National Standards Committee X3, on Information | |
6 | .\" Processing Systems. | |
7 | .\" | |
cffab432 CL |
8 | .\" %sccs.include.redist.man% |
9 | .\" | |
043368e6 | 10 | .\" @(#)free.3 5.2 (Berkeley) %G% |
cffab432 CL |
11 | .\" |
12 | .Dd | |
13 | .Dt FREE 3 | |
14 | .Os | |
15 | .Sh NAME | |
16 | .Nm free | |
17 | .Nd free up memory allocated with malloc, calloc or realloc | |
18 | .Sh SYNOPSIS | |
19 | .Fd #include <stdlib.h> | |
20 | .Ft void | |
21 | .Fn free "void *ptr" | |
22 | .Sh DESCRIPTION | |
23 | The | |
24 | .Fn free | |
25 | function causes the space pointed to by | |
26 | .Fa ptr | |
27 | to be deallocated, that is, made available | |
28 | for further allocation. | |
29 | If | |
30 | .Fa ptr | |
31 | is a null pointer, no action occurs. | |
32 | Otherwise, if the argument does not match a pointer earlier | |
33 | returned by the | |
34 | .Xr calloc , | |
35 | .Xr malloc , | |
36 | or | |
37 | .Xr realloc | |
38 | function, or if the space has been deallocated by a call to | |
39 | .Fn free | |
40 | or | |
41 | .Xr realloc , | |
42 | general havoc may occur. | |
43 | .Sh RETURN VALUES | |
44 | The | |
45 | .Fn free | |
46 | function returns no value. | |
47 | .Sh SEE ALSO | |
48 | .Xr calloc 3 , | |
49 | .Xr malloc 3 , | |
50 | .Xr realloc 3 | |
51 | .Sh STANDARDS | |
52 | The | |
53 | .Fn free | |
54 | function conforms to | |
55 | .St -ansiC . |