From 7551a1e5100c596793fa182cd26346ff971d3a4f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 18 Mar 1998 17:57:13 +0000 Subject: Update. 1998-03-18 Andreas Jaeger * manual/memory.texi (Heap Consistency Checking): Document MALLOC_CHECK_. Based on a text by Wolfram Gloger. 1998-03-18 17:11 Zack Weinberg * manual/Makefile: Add missing rules. 1998-03-18 Ulrich Drepper * 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. --- manual/Makefile | 8 +++++++- manual/memory.texi | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'manual') diff --git a/manual/Makefile b/manual/Makefile index c528493..c56dd32 100644 --- a/manual/Makefile +++ b/manual/Makefile @@ -69,6 +69,12 @@ endef libc.dvi libc.info: $(chapters) summary.texi $(chapters-incl) libc.dvi: texinfo.tex +%.info: %.texinfo + $(MAKEINFO) $< + +%.dvi: %.texinfo + $(TEXI2DVI) $< + # Generate the summary from the Texinfo source files for each chapter. summary.texi: stamp-summary ; stamp-summary: summary.awk $(chapters) $(chapters-incl) @@ -81,7 +87,7 @@ stamp-summary: summary.awk $(chapters) $(chapters-incl) # Generate a file which can be added to the `dir' content to provide direct # access to the documentation of the function, variables, and other # definitions. -dir-add.texi: xtract-typefun.awk $(chapters) $(chapters-incl) +dir-add.texinfo: xtract-typefun.awk $(chapters) $(chapters-incl) (echo "@dircategory GNU C library functions"; \ echo "@direntry"; \ $(GAWK) -f $^ | sort; \ diff --git a/manual/memory.texi b/manual/memory.texi index 4e42b47..09147bc 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} -- cgit v1.1