aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc/doc/gc.man
diff options
context:
space:
mode:
authorBryce McKinlay <mckinlay@redhat.com>2004-08-13 23:05:36 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2004-08-14 00:05:36 +0100
commit4109fe8594fef15d5cb36d1019e5b7c95dbc45f6 (patch)
tree863181355c9339e1361dad10263a322aaabe426e /boehm-gc/doc/gc.man
parentf13bb1997aa840029740a52684fb9bcd20e834ab (diff)
downloadgcc-4109fe8594fef15d5cb36d1019e5b7c95dbc45f6.zip
gcc-4109fe8594fef15d5cb36d1019e5b7c95dbc45f6.tar.gz
gcc-4109fe8594fef15d5cb36d1019e5b7c95dbc45f6.tar.bz2
configure.in (GCINCS): Don't use "boehm-cflags".
libjava: 2004-08-13 Bryce McKinlay <mckinlay@redhat.com> * configure.in (GCINCS): Don't use "boehm-cflags". Instead, -I boehm-gc's include dirs. * configure: Rebuilt. * include/boehm-gc.h: Include gc_config.h. boehm-gc: 2004-08-13 Bryce McKinlay <mckinlay@redhat.com> * configure.ac (gc_cflags): Add -Iinclude. (AC_CONFIG_HEADERS): New. Configure gc_config.h header. Don't write DEFS to boehm-cflags file. * configure: Rebuilt. * gcj_mlc.c: Check #ifdef GC_GCJ_SUPPORT after including headers. * specific.c: Check #ifdef GC_LINUX_THREADS after including headers. * include/gc_config_macros.h: Remove backward-compatibility redefinitions of GC_ names. * include/gc.h: Include <gc_config.h>. 2004-08-13 Bryce McKinlay <mckinlay@redhat.com> Import Boehm GC version 6.3. From-SVN: r85972
Diffstat (limited to 'boehm-gc/doc/gc.man')
-rw-r--r--boehm-gc/doc/gc.man27
1 files changed, 22 insertions, 5 deletions
diff --git a/boehm-gc/doc/gc.man b/boehm-gc/doc/gc.man
index 5409e70..2a550c7 100644
--- a/boehm-gc/doc/gc.man
+++ b/boehm-gc/doc/gc.man
@@ -1,12 +1,14 @@
-.TH GC_MALLOC 1L "12 February 1996"
+.TH GC_MALLOC 1L "2 October 2003"
.SH NAME
GC_malloc, GC_malloc_atomic, GC_free, GC_realloc, GC_enable_incremental, GC_register_finalizer, GC_malloc_ignore_off_page, GC_malloc_atomic_ignore_off_page, GC_set_warn_proc \- Garbage collecting malloc replacement
.SH SYNOPSIS
#include "gc.h"
.br
-# define malloc(n) GC_malloc(n)
+void * GC_malloc(size_t size);
.br
-... malloc(...) ...
+void GC_free(void *ptr);
+.br
+void * GC_realloc(void *ptr, size_t size);
.br
.sp
cc ... gc.a
@@ -23,6 +25,11 @@ will attempt to reclaim inaccessible space automatically by invoking a conservat
GC_malloc
or friends.
.LP
+In most cases it is preferable to call the macros GC_MALLOC, GC_FREE, etc.
+instead of calling GC_malloc and friends directly. This allows debugging
+versions of the routines to be substituted by defining GC_DEBUG before
+including gc.h.
+.LP
See the documentation in the include file gc_cpp.h for an alternate, C++ specific interface to the garbage collector.
.LP
Unlike the standard implementations of malloc,
@@ -56,9 +63,16 @@ It is also possible to use the collector to find storage leaks in programs desti
.LP
The collector may, on rare occasion produce warning messages. On UNIX machines these appear on stderr. Warning messages can be filtered, redirected, or ignored with
.I
-GC_set_warn_proc.
+GC_set_warn_proc
This is recommended for production code. See gc.h for details.
.LP
+Fully portable code should call
+.I
+GC_INIT
+from the main program before making any other GC calls.
+On most platforms this does nothing and the collector is initialized on first use.
+On a few platforms explicit initialization is necessary. And it can never hurt.
+.LP
Debugging versions of many of the above routines are provided as macros. Their names are identical to the above, but consist of all capital letters. If GC_DEBUG is defined before gc.h is included, these routines do additional checking, and allow the leak detecting version of the collector to produce slightly more useful output. Without GC_DEBUG defined, they behave exactly like the lower-case versions.
.LP
On some machines, collection will be performed incrementally after a call to
@@ -71,10 +85,13 @@ Other facilities not discussed here include limited facilities to support increm
.SH "SEE ALSO"
The README and gc.h files in the distribution. More detailed definitions of the functions exported by the collector are given there. (The above list is not complete.)
.LP
+The web site at http://www.hpl.hp.com/personal/Hans_Boehm/gc .
+.LP
Boehm, H., and M. Weiser, "Garbage Collection in an Uncooperative Environment",
\fISoftware Practice & Experience\fP, September 1988, pp. 807-820.
.LP
The malloc(3) man page.
.LP
.SH AUTHOR
-Hans-J. Boehm (boehm@parc.xerox.com). Some of the code was written by others, most notably Alan Demers.
+Hans-J. Boehm (Hans.Boehm@hp.com).
+Some of the code was written by others, most notably Alan Demers.