path: root/doc
diff options
authorivmai <ivmai>2011-03-27 22:19:47 +0200
committerIvan Maidanski <>2011-07-26 19:06:57 +0200
commitbfda2d071b53ba9cafff211434812821d969c29d (patch)
tree4e6a71202ef733ab5233e07fa715c849f1593d42 /doc
parent2de7add91598ef5ba24e869c15b4003bc57819b1 (diff)
2011-03-27 Ivan Maidanski <>
* dbg_mlc.c (GC_debug_strdup, GC_debug_free): Output a portability warning if the argument is NULL and GC is in leaks detection mode. * dbg_mlc.c (GC_debug_strndup, GC_debug_wcsdup): New public function definition. * malloc.c (GC_strndup, GC_wcsdup, strndup): Ditto. * mallocx.c (GC_posix_memalign): Ditto. * malloc.c (strdup): Fix string size value; rename "len" to "lb". * mallocx.c: Include errno.h unless WinCE (otherwise include windows.h for Win32 error constants). * win32_threads.c: Define WIN32_LEAN_AND_MEAN and NOSERVICE before windows.h inclusion. * misc.c (GC_init): Register at-exit callback if GC_find_leak (even if GC_FIND_LEAK macro is unset). * pthread_stop_world.c (NACL_STORE_REGS, __nacl_suspend_thread_if_needed, GC_nacl_initialize_gc_thread): Use BCOPY() instead of memcpy(). * pthread_support.c (GC_init_real_syms): Ditto. * doc/README: Update year in copyright. * include/gc.h: Ditto. * doc/README.macros (GC_DEBUG_REPLACEMENT, GC_REQUIRE_WCSDUP): Document new macro. * doc/README.macros (REDIRECT_MALLOC): Update documentation. * include/gc.h (GC_strndup, GC_posix_memalign, GC_debug_strndup): New API function prototype. * include/gc.h (GC_MALLOC, GC_REALLOC): Redirect to GC_debug_malloc/realloc_replacement() if GC_DEBUG_REPLACEMENT. * include/gc.h (GC_STRDUP): Remove redundant parentheses. * include/leak_detector.h (realloc, strdup): Ditto. * include/gc.h (GC_STRNDUP): New API macro. * include/gc.h (GC_NEW, GC_NEW_ATOMIC, GC_NEW_STUBBORN, GC_NEW_UNCOLLECTABLE): Add missing parentheses. * include/gc.h (GC_wcsdup, GC_debug_wcsdup): New API function prototype (only if GC_REQUIRE_WCSDUP). * include/gc.h (GC_WCSDUP): New API macro (only if GC_REQUIRE_WCSDUP). * include/leak_detector.h: Add copyright header; add usage comment; include stdlib.h and string.h after gc.h (unless GC_DONT_INCLUDE_STDLIB). * include/leak_detector.h (malloc, calloc, free, realloc): Undefine symbol before its redefinition. * include/leak_detector.h (strndup, memalign, posix_memalign): Redefine to the corresponding GC function. * include/leak_detector.h (wcsdup): Redefine to GC_WCSDUP (only if GC_REQUIRE_WCSDUP). * include/leak_detector.h (CHECK_LEAKS): Add comment; don't define the macro if already defined.
Diffstat (limited to 'doc')
2 files changed, 8 insertions, 2 deletions
diff --git a/doc/README b/doc/README
index 4a4ff77..5ca93f0 100644
--- a/doc/README
+++ b/doc/README
@@ -1,7 +1,7 @@
Copyright (c) 1988, 1989 Hans-J. Boehm, Alan J. Demers
Copyright (c) 1991-1996 by Xerox Corporation. All rights reserved.
Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
-Copyright (c) 1999-2005 Hewlett-Packard Development Company, L.P.
+Copyright (c) 1999-2011 by Hewlett-Packard Development Company.
The file linux_threads.c is also
Copyright (c) 1998 by Fergus Henderson. All rights reserved.
diff --git a/doc/README.macros b/doc/README.macros
index ee42f4e..ac78897 100644
--- a/doc/README.macros
+++ b/doc/README.macros
@@ -30,6 +30,9 @@ MACRO EXPLANATION
GC_DEBUG Tested by gc.h. Causes all-upper-case macros to
expand to calls to debug versions of collector routines.
+GC_DEBUG_REPLACEMENT Tested by gc.h. Causes GC_MALLOC/REALLOC() to be
+ defined as GC_debug_malloc/realloc_replacement().
GC_NO_THREAD_REDIRECTS Tested by gc.h. Prevents redirection of thread
creation routines etc. to GC_ versions. Requires the
programmer to explicitly handle thread registration.
@@ -73,6 +76,9 @@ GC_NOT_DLL User-settable macro that overrides _DLL, e.g. if runtime
dynamic libraries are used, but the collector is in a static
library. Tested by gc_config_macros.h.
+GC_REQUIRE_WCSDUP Force GC to export GC_wcsdup() (the Unicode version
+ of GC_strdup); could be useful in the leak-finding mode.
These define arguments influence the collector configuration:
FIND_LEAK causes GC_find_leak to be initially set.
@@ -188,7 +194,7 @@ GC_NO_OPERATOR_NEW_ARRAY Declares that the C++ compiler does not
REDIRECT_MALLOC=<X> Causes malloc to be defined as alias for X.
Unless the following macros are defined, realloc is also redirected
to GC_realloc, and free is redirected to GC_free.
- Calloc and strdup are redefined in terms of the new malloc. X should
+ Calloc and str[n]dup are redefined in terms of the new malloc. X should
be either GC_malloc or GC_malloc_uncollectable, or
GC_debug_malloc_replacement. (The latter invokes GC_debug_malloc
with dummy source location information, but still results in