mirror of https://github.com/mkerrisk/man-pages
Clarify description of realloc() behavior for ((size == 0) && (ptr != NULL)).
This commit is contained in:
parent
bc5ec13168
commit
c4acc6895a
|
@ -25,7 +25,7 @@
|
||||||
.\" Documented MALLOC_CHECK_, Wolfram Gloger (wmglo@dent.med.uni-muenchen.de)
|
.\" Documented MALLOC_CHECK_, Wolfram Gloger (wmglo@dent.med.uni-muenchen.de)
|
||||||
.\" 2007-09-15 mtk: added notes on malloc()'s use of sbrk() and mmap().
|
.\" 2007-09-15 mtk: added notes on malloc()'s use of sbrk() and mmap().
|
||||||
.\"
|
.\"
|
||||||
.TH MALLOC 3 2007-09-15 "GNU" "Linux Programmer's Manual"
|
.TH MALLOC 3 2008-02-22 "GNU" "Linux Programmer's Manual"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
calloc, malloc, free, realloc \- Allocate and free dynamic memory
|
calloc, malloc, free, realloc \- Allocate and free dynamic memory
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -98,12 +98,14 @@ The contents will be unchanged to the minimum of the old and new sizes;
|
||||||
newly allocated memory will be uninitialized.
|
newly allocated memory will be uninitialized.
|
||||||
If
|
If
|
||||||
.I ptr
|
.I ptr
|
||||||
is NULL, the call is equivalent to
|
is NULL, then the call is equivalent to
|
||||||
.IR malloc(size) ;
|
.IR malloc(size) ;
|
||||||
if
|
if
|
||||||
.I size
|
.I size
|
||||||
is equal to zero,
|
is equal to zero,
|
||||||
the call is equivalent to
|
and
|
||||||
|
.I ptr
|
||||||
|
is not NULL, then the call is equivalent to
|
||||||
.IR free(ptr) .
|
.IR free(ptr) .
|
||||||
Unless
|
Unless
|
||||||
.I ptr
|
.I ptr
|
||||||
|
|
Loading…
Reference in New Issue