xref: /csrg-svn/lib/libc/stdlib/free.3 (revision 50300)
148913Scael.\" Copyright (c) 1991 The Regents of the University of California.
248913Scael.\" All rights reserved.
348913Scael.\"
4*50300Sbostic.\" This code is derived from software contributed to Berkeley by
5*50300Sbostic.\" the American National Standards Committee X3, on Information
6*50300Sbostic.\" Processing Systems.
7*50300Sbostic.\"
848913Scael.\" %sccs.include.redist.man%
948913Scael.\"
10*50300Sbostic.\"     @(#)free.3	5.2 (Berkeley) 06/29/91
1148913Scael.\"
1248913Scael.Dd
1348913Scael.Dt FREE 3
1448913Scael.Os
1548913Scael.Sh NAME
1648913Scael.Nm free
1748913Scael.Nd free up memory allocated with malloc, calloc or realloc
1848913Scael.Sh SYNOPSIS
1948913Scael.Fd #include <stdlib.h>
2048913Scael.Ft void
2148913Scael.Fn free "void *ptr"
2248913Scael.Sh DESCRIPTION
2348913ScaelThe
2448913Scael.Fn free
2548913Scaelfunction causes the space pointed to by
2648913Scael.Fa ptr
2748913Scaelto be deallocated, that is, made available
2848913Scaelfor further allocation.
2948913ScaelIf
3048913Scael.Fa ptr
3148913Scaelis a null pointer, no action occurs.
3248913ScaelOtherwise, if the argument does not match a pointer earlier
3348913Scaelreturned by the
3448913Scael.Xr calloc ,
3548913Scael.Xr malloc ,
3648913Scaelor
3748913Scael.Xr realloc
3848913Scaelfunction, or if the space has been deallocated by a call to
3948913Scael.Fn free
4048913Scaelor
4148913Scael.Xr realloc ,
4248913Scaelgeneral havoc may occur.
4348913Scael.Sh RETURN VALUES
4448913ScaelThe
4548913Scael.Fn free
4648913Scaelfunction returns no value.
4748913Scael.Sh SEE ALSO
4848913Scael.Xr calloc 3 ,
4948913Scael.Xr malloc 3 ,
5048913Scael.Xr realloc 3
5148913Scael.Sh STANDARDS
5248913ScaelThe
5348913Scael.Fn free
5448913Scaelfunction conforms to
5548913Scael.St -ansiC .
56