summary refs log tree commit diff
path: root/manual/memory.texi
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-03-18 17:57:13 +0000
committerUlrich Drepper <drepper@redhat.com>1998-03-18 17:57:13 +0000
commit7551a1e5100c596793fa182cd26346ff971d3a4f (patch)
treef3c959a1c55505681669ebeb43fbeb5251eb6da5 /manual/memory.texi
parent3116126871400c8737a9df0145f66534f097c06c (diff)
downloadglibc-7551a1e5100c596793fa182cd26346ff971d3a4f.tar.gz
glibc-7551a1e5100c596793fa182cd26346ff971d3a4f.tar.xz
glibc-7551a1e5100c596793fa182cd26346ff971d3a4f.zip
Update.
1998-03-18  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* manual/memory.texi (Heap Consistency Checking): Document
	MALLOC_CHECK_.  Based on a text by Wolfram Gloger.

1998-03-18 17:11  Zack Weinberg  <zack@rabi.phys.columbia.edu>

	* manual/Makefile: Add missing rules.

1998-03-18  Ulrich Drepper  <drepper@cygnus.com>

	* timezone/Makefile (generated): Define to remove all stamp files.

	* sysdeps/generic/strsep.c: Also undefine __strsep.

	* string/strdup.c: Undefine __strdup and strdup first.
	* string/strndup.c: Likewise.

	* string/bits/string2.h: Correct strtok_r and strsep.
	Add strndup optimization.

	* sysdeps/generic/strsep.c: Little optimization.
Diffstat (limited to 'manual/memory.texi')
-rw-r--r--manual/memory.texi14
1 files changed, 14 insertions, 0 deletions
diff --git a/manual/memory.texi b/manual/memory.texi
index 4e42b47add..09147bcd14 100644
--- a/manual/memory.texi
+++ b/manual/memory.texi
@@ -611,6 +611,20 @@ The block was already freed.
 @end table
 @end deftp
 
+Another possibility to check for and guard against bugs in the use of
+@code{malloc}, @code{realloc} and @code{free} is to set the environment
+variable @code{MALLOC_CHECK_}.  When @code{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 @code{free} with
+the same argument, or overruns of a single byte (off-by-one bugs).  Not
+all such errors can be proteced against, however, and memory leaks can
+result.  If @code{MALLOC_CHECK_} is set to @code{0}, any detected heap
+corruption is silently ignored; if set to @code{1}, a diagnostic is
+printed on @code{stderr}; if set to @code{2}, @code{abort} is called
+immediately.  This 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.
+
 @node Hooks for Malloc
 @subsection Storage Allocation Hooks
 @cindex allocation hooks, for @code{malloc}