OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man3 / malloc.3
index a18094b..cfd26f7 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
-.\" License.
+.\" %%%LICENSE_END
+.\"
 .\" Modified Sat Jul 24 19:00:59 1993 by Rik Faith (faith@cs.unc.edu)
 .\" Clarification concerning realloc, iwj10@cus.cam.ac.uk (Ian Jackson), 950701
 .\" 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().
 .\"
-.TH MALLOC 3  2012-05-10 "GNU" "Linux Programmer's Manual"
+.\" FIXME: Review http://austingroupbugs.net/view.php?id=374
+.\"    to see what changes are req     uired on this page.
+.\"
+.TH MALLOC 3  2014-05-21 "GNU" "Linux Programmer's Manual"
 .SH NAME
-malloc, free, calloc, realloc \- Allocate and free dynamic memory
+malloc, free, calloc, realloc \- allocate and free dynamic memory
 .SH SYNOPSIS
 .nf
 .B #include <stdlib.h>
@@ -124,13 +129,13 @@ or
 If the area pointed to was moved, a
 .I free(ptr)
 is done.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
 The
 .BR malloc ()
 and
 .BR calloc ()
-functions return a pointer to the allocated memory
-that is suitably aligned for any kind of variable.
+functions return a pointer to the allocated memory,
+which is suitably aligned for any built-in type.
 On error, these functions return NULL.
 NULL may also be returned by a successful call to
 .BR malloc ()
@@ -152,7 +157,7 @@ function returns no value.
 The
 .BR realloc ()
 function returns a pointer to the newly allocated memory, which is suitably
-aligned for any kind of variable and may be different from
+aligned for any built-in type and may be different from
 .IR ptr ,
 or NULL if the request fails.
 If
@@ -162,8 +167,8 @@ was equal to 0, either NULL or a pointer suitable to be passed to
 is returned.
 If
 .BR realloc ()
-fails the original block is left untouched; it is not freed or moved.
-.SH "CONFORMING TO"
+fails, the original block is left untouched; it is not freed or moved.
+.SH CONFORMING TO
 C89, C99.
 .SH NOTES
 By default, Linux follows an optimistic memory allocation strategy.
@@ -179,7 +184,7 @@ and
 .IR /proc/sys/vm/oom_adj
 in
 .BR proc (5),
-and the kernel source file
+and the Linux kernel source file
 .IR Documentation/vm/overcommit-accounting .
 
 Normally,
@@ -248,13 +253,12 @@ or
 are almost always related to heap corruption, such as overflowing
 an allocated chunk or freeing the same pointer twice.
 .PP
-Recent versions of Linux libc (later than 5.4.23) and glibc (2.x)
-include a
+The
 .BR malloc ()
-implementation which is tunable via environment variables.
-For details, see
-.BR mallopt (3).
-.SH "SEE ALSO"
+implementation is tunable via environment variables; see
+.BR mallopt (3)
+for details.
+.SH SEE ALSO
 .\" http://g.oswego.edu/dl/html/malloc.html
 .\" A Memory Allocator - by Doug Lea
 .\"
@@ -265,6 +269,8 @@ For details, see
 .\" malloc() Performance in a Multithreaded Linux Environment -
 .\"     Check Lever, David Boreham
 .\"
+.ad l
+.nh
 .BR brk (2),
 .BR mmap (2),
 .BR alloca (3),
@@ -276,3 +282,12 @@ For details, see
 .BR mcheck (3),
 .BR mtrace (3),
 .BR posix_memalign (3)
+.SH COLOPHON
+This page is part of release 3.68 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.