malloc.3: Replace discussion of MALLOC_CHECK_ with pointer to mallopt(3)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2012-03-20 23:27:29 +13:00
parent 675bd73818
commit 323c59bbc9
1 changed files with 4 additions and 26 deletions

View File

@ -25,7 +25,7 @@
.\" 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-03-09 "GNU" "Linux Programmer's Manual"
.TH MALLOC 3 2012-03-20 "GNU" "Linux Programmer's Manual"
.SH NAME
malloc, free, calloc, realloc \- Allocate and free dynamic memory
.SH SYNOPSIS
@ -253,30 +253,8 @@ Recent versions of Linux libc (later than 5.4.23) and glibc (2.x)
include a
.BR malloc ()
implementation which is tunable via environment variables.
When
.B MALLOC_CHECK_
is set, a special (less efficient) implementation is used which
is designed to be tolerant against simple errors, such as double
calls of
.BR free ()
with the same argument, or overruns of a single byte (off-by-one
bugs).
Not all such errors can be protected against, however, and
memory leaks can result.
If
.B MALLOC_CHECK_
is set to 0, any detected heap corruption is silently ignored;
if set to 1, a diagnostic message is printed on \fIstderr\fP;
if set to 2,
.BR abort (3)
is called immediately;
if set to 3, a diagnostic message is printed on \fIstderr\fP
and the program is aborted.
Using a nonzero
.B MALLOC_CHECK_
value can be useful because otherwise
a crash may happen much later, and the true cause for the problem
is then very hard to track down.
For details, see
.BR mallopt (3).
.SH "SEE ALSO"
.\" http://g.oswego.edu/dl/html/malloc.html
.\" A Memory Allocator - by Doug Lea
@ -289,8 +267,8 @@ is then very hard to track down.
.\" Check Lever, David Boreham
.\"
.BR brk (2),
.\" .BR mallopt (3),
.BR mmap (2),
.BR alloca (3),
.BR mallopt (3),
.BR mtrace (3),
.BR posix_memalign (3)