|
@ -33,7 +33,7 @@ |
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
|
.\" SUCH DAMAGE. |
|
|
.\" SUCH DAMAGE. |
|
|
.\" |
|
|
.\" |
|
|
.\" $OpenBSD: malloc.3,v 1.2 1996/08/10 04:18:49 tholo Exp $ |
|
|
|
|
|
|
|
|
.\" $OpenBSD: malloc.3,v 1.3 1996/08/21 03:12:18 downsj Exp $ |
|
|
.\" |
|
|
.\" |
|
|
.Dd June 4, 1993 |
|
|
.Dd June 4, 1993 |
|
|
.Dt MALLOC 3 |
|
|
.Dt MALLOC 3 |
|
@ -42,7 +42,8 @@ |
|
|
.Nm malloc , |
|
|
.Nm malloc , |
|
|
.Nd general memory allocation function |
|
|
.Nd general memory allocation function |
|
|
.Pp |
|
|
.Pp |
|
|
.Nm free |
|
|
|
|
|
|
|
|
.Nm free , |
|
|
|
|
|
.Nm cfree |
|
|
.Nd free up memory allocated with malloc, calloc or realloc |
|
|
.Nd free up memory allocated with malloc, calloc or realloc |
|
|
.Pp |
|
|
.Pp |
|
|
.Nm realloc |
|
|
.Nm realloc |
|
@ -53,6 +54,8 @@ |
|
|
.Fn malloc "size_t size" |
|
|
.Fn malloc "size_t size" |
|
|
.Ft void |
|
|
.Ft void |
|
|
.Fn free "void *ptr" |
|
|
.Fn free "void *ptr" |
|
|
|
|
|
.Ft void |
|
|
|
|
|
.Fn cfree "void *ptr" |
|
|
.Ft void * |
|
|
.Ft void * |
|
|
.Fn realloc "void *ptr" "size_t size" |
|
|
.Fn realloc "void *ptr" "size_t size" |
|
|
.Sh DESCRIPTION |
|
|
.Sh DESCRIPTION |
|
@ -83,6 +86,13 @@ If |
|
|
.Fa ptr |
|
|
.Fa ptr |
|
|
is a null pointer, no action occurs. |
|
|
is a null pointer, no action occurs. |
|
|
.Pp |
|
|
.Pp |
|
|
|
|
|
A |
|
|
|
|
|
.Fn cfree |
|
|
|
|
|
function is also provided for compatibility with old systems and other |
|
|
|
|
|
.Nm malloc |
|
|
|
|
|
libraries; it is simply an alias for |
|
|
|
|
|
.Fn free . |
|
|
|
|
|
.Pp |
|
|
The |
|
|
The |
|
|
.Fn realloc |
|
|
.Fn realloc |
|
|
function changes the size of the object pointed to by |
|
|
function changes the size of the object pointed to by |
|
|