mirror of https://github.com/mkerrisk/man-pages
malloc.3: Add some structuring to improve readability
Add some subsection (.SS) headings and paragraph breaks in DESCRIPTION, to make the page more easily readable. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
ddc5192f0c
commit
5d46c7a934
|
@ -58,6 +58,7 @@ Feature Test Macro Requirements for glibc (see
|
|||
_GNU_SOURCE
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.SS malloc()
|
||||
The
|
||||
.BR malloc ()
|
||||
function allocates
|
||||
|
@ -71,7 +72,7 @@ is 0, then
|
|||
returns a unique pointer value that can later be successfully passed to
|
||||
.BR free ().
|
||||
(See "Nonportable behavior" for portability issues.)
|
||||
.PP
|
||||
.SS free()
|
||||
The
|
||||
.BR free ()
|
||||
function frees the memory space pointed to by
|
||||
|
@ -85,7 +86,7 @@ has already been freed, undefined behavior occurs.
|
|||
If
|
||||
.I ptr
|
||||
is NULL, no operation is performed.
|
||||
.PP
|
||||
.SS calloc()
|
||||
The
|
||||
.BR calloc ()
|
||||
function allocates memory for an array of
|
||||
|
@ -102,6 +103,7 @@ is 0, then
|
|||
.BR calloc ()
|
||||
returns a unique pointer value that can later be successfully passed to
|
||||
.BR free ().
|
||||
.PP
|
||||
If the multiplication of
|
||||
.I nmemb
|
||||
and
|
||||
|
@ -119,7 +121,7 @@ with the result that an incorrectly sized block of memory would be allocated:
|
|||
malloc(nmemb * size);
|
||||
.EE
|
||||
.in
|
||||
.PP
|
||||
.SS realloc()
|
||||
The
|
||||
.BR realloc ()
|
||||
function changes the size of the memory block pointed to by
|
||||
|
@ -132,13 +134,15 @@ up to the minimum of the old and new sizes.
|
|||
If the new size is larger than the old size, the added memory will
|
||||
.I not
|
||||
be initialized.
|
||||
.PP
|
||||
If
|
||||
.I ptr
|
||||
is NULL, then the call is equivalent to
|
||||
.IR malloc(size) ,
|
||||
for all values of
|
||||
.IR size ;
|
||||
if
|
||||
.IR size .
|
||||
.PP
|
||||
If
|
||||
.I size
|
||||
is equal to zero,
|
||||
and
|
||||
|
@ -146,6 +150,7 @@ and
|
|||
is not NULL, then the call is equivalent to
|
||||
.I free(ptr)
|
||||
(but see "Nonportable behavior" for portability issues).
|
||||
.PP
|
||||
Unless
|
||||
.I ptr
|
||||
is NULL, it must have been returned by an earlier call to
|
||||
|
@ -154,7 +159,7 @@ or related functions.
|
|||
If the area pointed to was moved, a
|
||||
.I free(ptr)
|
||||
is done.
|
||||
.PP
|
||||
.SS reallocarray()
|
||||
The
|
||||
.BR reallocarray ()
|
||||
function changes the size of the memory block pointed to by
|
||||
|
|
Loading…
Reference in New Issue