Debian Codegraph @

external/bdwgc/doc/README.macros

raw
1 The collector uses a large amount of conditional compilation in order to
2 deal with platform dependencies. This violates a number of known coding
3 standards. On the other hand, it seems to be the only practical way to
4 support this many platforms without excessive code duplication.
5
6 A few guidelines have mostly been followed in order to keep this manageable:
7
8 1) #if and #ifdef directives are properly indented whenever easily possible.
9 All known C compilers allow whitespace between the "#" and the "if" to make
10 this possible. ANSI C also allows white space before the "#", though we
11 avoid that. It has the known disadvantages that it differs from the normal
12 GNU conventions, and that it makes patches larger than otherwise necessary.
13 In my opinion, it's still well worth it, for the same reason that we indent
14 ordinary "if" statements.
15
16 2) Whenever possible, tests are performed on the macros defined in gcconfig.h
17 instead of directly testing platform-specific predefined macros. This makes
18 it relatively easy to adapt to new compilers with a different set of
19 predefined macros. Currently these macros generally identify platforms
20 instead of features. In many cases, this is a mistake.
21
22 Many of the tested configuration macros are at least somewhat defined in
23 either include/private/gcconfig.h or in Makefile.direct. Here is an attempt
24 at documenting these macros: (Thanks to Walter Bright for suggesting
25 this. This is a work in progress)
26
27 MACRO EXPLANATION
28 ----- -----------
29
30 GC_DEBUG Tested by gc.h. Causes all-upper-case macros to
31 expand to calls to debug versions of collector routines.
32
33 GC_NAMESPACE Tested by gc_cpp.h. Causes gc_cpp symbols to be defined
34 in "boehmgc" namespace.
35
36 GC_DEBUG_REPLACEMENT Tested by gc.h. Causes GC_MALLOC/REALLOC() to be
37 defined as GC_debug_malloc/realloc_replacement().
38
39 GC_NO_THREAD_REDIRECTS Tested by gc.h. Prevents redirection of thread
40 creation routines etc. to GC_ versions. Requires the
41 programmer to explicitly handle thread registration.
42
43 GC_NO_THREAD_DECLS Tested by gc.h. MS Windows only. Do not declare
44 Windows thread creation routines and do not include windows.h.
45
46 GC_DONT_INCLUDE_WINDOWS_H Tested by gc.h. MS Windows only. Do not include
47 windows.h from gc.h (but Windows-specific thread creation
48 routines are declared).
49
50 GC_UNDERSCORE_STDCALL Tested by gc.h. Explicitly prefix exported/imported
51 WINAPI (__stdcall) symbols with '_' (underscore). Could be
52 used with MinGW (for x86) compiler (in conjunction with
53 GC_DLL) to follow MS conventions for __stdcall symbols naming.
54
55 _ENABLE_ARRAYNEW
56 #define'd by the Digital Mars C++ compiler when
57 operator new[] and delete[] are separately
58 overloadable. Used in gc_cpp.h.
59
60 _DLL Tested by gc_config_macros.h. Defined by Visual C++ if runtime
61 dynamic libraries are in use. Used (only if none of GC_DLL,
62 GC_NOT_DLL, __GNUC__ are defined) to test whether
63 __declspec(dllimport) needs to be added to declarations
64 to support the case in which the collector is in a DLL.
65
66 GC_DLL Defined by user if dynamic libraries are being built
67 or used. Also set by gc.h if _DLL is defined (except for
68 mingw) while GC_NOT_DLL and __GNUC__ are both undefined.
69 This is the macro that is tested internally to determine
70 whether the GC is in its own dynamic library. May need
71 to be set by clients before including gc.h. Note that
72 inside the GC implementation it indicates that the
73 collector is in its own dynamic library, should export
74 its symbols, etc. But in clients it indicates that the
75 GC resides in a different DLL, its entry points should
76 be referenced accordingly, and precautions may need to
77 be taken to properly deal with statically allocated
78 variables in the main program. Used for MS Windows.
79 Also used by GCC v4+ (only when the dynamic shared library
80 is being built) to hide internally used symbols.
81
82 GC_NOT_DLL User-settable macro that overrides _DLL, e.g. if runtime
83 dynamic libraries are used, but the collector is in a static
84 library. Tested by gc_config_macros.h.
85
86 GC_REQUIRE_WCSDUP Force GC to export GC_wcsdup() (the Unicode version
87 of GC_strdup); could be useful in the leak-finding mode.
88
89
90 These define arguments influence the collector configuration:
91
92 FIND_LEAK Causes GC_find_leak to be initially set. This causes the
93 collector to assume that all inaccessible objects should have been
94 explicitly deallocated, and reports exceptions. Finalization and the test
95 program are not usable in this mode.
96
97 GC_FINDLEAK_DELAY_FREE Turns on deferred freeing of objects in the
98 leak-finding mode letting the collector to detect alter-object-after-free
99 errors as well as detect leaked objects sooner (instead of only when program
100 terminates). Has no effect if SHORT_DBG_HDRS.
101
102 GC_ABORT_ON_LEAK Causes the application to be terminated once leaked or
103 smashed (corrupted on use-after-free) objects are found (after printing the
104 information about that objects).
105
106 SUNOS5SIGS Solaris-like signal handling. This is probably misnamed,
107 since it really doesn't guarantee much more than POSIX. Currently set only
108 for Solaris2.X, HPUX, and DRSNX. Should probably be set for some other
109 platforms.
110
111 PCR Set if the collector is being built as part of the Xerox Portable
112 Common Runtime.
113
114 IMPORTANT: Any of the _THREADS options must normally also be defined in
115 the client before including gc.h. This redefines thread primitives to
116 invoke the GC_ versions instead. Alternatively, linker-based symbol
117 interception can be used on a few platforms.
118
119 GC_THREADS Should set the appropriate one of the below macros,
120 except GC_WIN32_PTHREADS, which must be set explicitly. Tested by gc.h.
121
122 GC_SOLARIS_THREADS Enables support for Solaris pthreads.
123 Must also define _REENTRANT. Deprecated, use GC_THREADS instead.
124
125 GC_IRIX_THREADS Enables support for Irix pthreads. See README.sgi.
126 Deprecated, use GC_THREADS instead.
127
128 GC_HPUX_THREADS Enables support for HP/UX 11 pthreads.
129 Also requires _REENTRANT or _POSIX_C_SOURCE=199506L. See README.hp.
130 Deprecated, use GC_THREADS instead.
131
132 GC_LINUX_THREADS Enables support for Xavier Leroy's Linux threads
133 or NPTL threads. See README.linux. _REENTRANT may also be required.
134 Deprecated, use GC_THREADS instead.
135
136 GC_OSF1_THREADS Enables support for Tru64 pthreads. Deprecated, use
137 GC_THREADS instead.
138
139 GC_FREEBSD_THREADS Enables support for FreeBSD pthreads. Appeared to run
140 into some underlying thread problems. Deprecated, use GC_THREADS instead.
141
142 GC_NETBSD_THREADS Enables support for NetBSD pthreads. Deprecated, use
143 GC_THREADS instead.
144
145 GC_OPENBSD_THREADS Enables support for OpenBSD pthreads. Deprecated,
146 use GC_THREADS instead.
147
148 GC_DARWIN_THREADS Enables support for Mac OS X pthreads. Deprecated,
149 use GC_THREADS instead.
150
151 GC_AIX_THREADS Enables support for IBM AIX threads. Deprecated, use
152 GC_THREADS instead.
153
154 GC_DGUX386_THREADS Enables support for DB/UX on I386 threads.
155 See README.DGUX386. (Probably has not been tested recently.) Deprecated,
156 use GC_THREADS instead.
157
158 GC_WIN32_THREADS Enables support for Win32 threads. That makes sense
159 for Makefile (and Makefile.direct) only under Cygwin or MinGW. Deprecated,
160 use GC_THREADS instead.
161
162 GC_WIN32_PTHREADS Enables support for pthreads-win32 (or other
163 non-Cygwin pthreads library for Windows). This cannot be enabled
164 automatically by GC_THREADS, which would assume Win32 native threads.
165
166 PTW32_STATIC_LIB Causes the static version of the Mingw pthreads
167 library to be used. Requires GC_WIN32_PTHREADS.
168
169 GC_PTHREADS_PARAMARK Causes pthread-based parallel mark implementation
170 to be used even if GC_WIN32_PTHREADS is undefined. (Useful for WinCE.)
171
172 ALL_INTERIOR_POINTERS Allows all pointers to the interior of objects to be
173 recognized. (See gc_priv.h for consequences.) Alternatively,
174 GC_all_interior_pointers can be set at process initialization time.
175
176 SMALL_CONFIG Tries to tune the collector for small heap sizes,
177 usually causing it to use less space in such situations. Incremental
178 collection no longer works in this case. Also, removes some
179 statistic-printing code. Turns off some optimization algorithms (like data
180 prefetching in the mark routine).
181
182 NO_CLOCK Do not use system clock. Disables some statistic printing.
183
184 GC_DISABLE_INCREMENTAL Turn off the incremental collection support.
185
186 NO_INCREMENTAL Causes the gctest program to not invoke the incremental
187 collector. This has no impact on the generated library, only on the test
188 program. (This is often useful for debugging failures unrelated to
189 incremental GC.)
190
191 LARGE_CONFIG Tunes the collector for unusually large heaps.
192 Necessary for heaps larger than about 4 GiB on most (64-bit) machines.
193 Recommended for heaps larger than about 500 MiB. Not recommended for
194 embedded systems. Could be used in conjunction with SMALL_CONFIG to
195 generate smaller code (by disabling incremental collection support,
196 statistic printing and some optimization algorithms).
197
198 DONT_ADD_BYTE_AT_END Meaningful only with ALL_INTERIOR_POINTERS or
199 GC_all_interior_pointers = 1. Normally ALL_INTERIOR_POINTERS
200 causes all objects to be padded so that pointers just past the end of
201 an object can be recognized. This can be expensive. (The padding
202 is normally more than one byte due to alignment constraints.)
203 DONT_ADD_BYTE_AT_END disables the padding.
204
205 NO_EXECUTE_PERMISSION May cause some or all of the heap to not
206 have execute permission, i.e. it may be impossible to execute
207 code from the heap. Currently this only affects the incremental
208 collector on UNIX machines. It may greatly improve its performance,
209 since this may avoid some expensive cache synchronization. Alternatively,
210 GC_set_pages_executable can be called at the process initialization time.
211
212 GC_NO_OPERATOR_NEW_ARRAY Declares that the C++ compiler does not
213 support the new syntax "operator new[]" for allocating and deleting arrays.
214 See gc_cpp.h for details. No effect on the C part of the collector.
215 This is defined implicitly in a few environments. Must also be defined
216 by clients that use gc_cpp.h.
217
218 REDIRECT_MALLOC=<X> Causes malloc to be defined as alias for X.
219 Unless the following macros are defined, realloc is also redirected
220 to GC_realloc, and free is redirected to GC_free.
221 Calloc and str[n]dup are redefined in terms of the new malloc. X should
222 be either GC_malloc or GC_malloc_uncollectable, or
223 GC_debug_malloc_replacement. (The latter invokes GC_debug_malloc
224 with dummy source location information, but still results in
225 properly remembered call stacks on Linux/X86 and Solaris/SPARC.
226 It requires that the following two macros also be used.)
227 The former is occasionally useful for working around leaks in code
228 you don't want to (or can't) look at. It may not work for
229 existing code, but it often does. Neither works on all platforms,
230 since some ports use malloc or calloc to obtain system memory.
231 (Probably works for UNIX, and Win32.) If you build with DBG_HDRS_ALL,
232 you should only use GC_debug_malloc_replacement as a malloc
233 replacement.
234
235 REDIRECT_REALLOC=<X> Causes GC_realloc to be redirected to X.
236 The canonical use is REDIRECT_REALLOC=GC_debug_realloc_replacement,
237 together with REDIRECT_MALLOC=GC_debug_malloc_replacement to
238 generate leak reports with call stacks for both malloc and realloc.
239 This also requires REDIRECT_FREE.
240
241 REDIRECT_FREE=<X> Causes free to be redirected to X. The canonical use
242 is REDIRECT_FREE=GC_debug_free.
243
244 IGNORE_FREE Turns calls to free into a no-op. Only useful with
245 REDIRECT_MALLOC.
246
247 NO_DEBUGGING Removes GC_dump and the debugging routines it calls.
248 Reduces code size slightly at the expense of debuggability.
249
250 GC_DUMP_REGULARLY Generate regular debugging dumps.
251
252 DEBUG_THREADS Turn on printing additional thread-support debugging
253 information.
254
255 GC_COLLECT_AT_MALLOC=<n> Force garbage collection at every
256 GC_malloc_* call with the size greater than the specified value.
257 (Might be useful for application debugging or in find-leak mode.)
258
259 JAVA_FINALIZATION Makes it somewhat safer to finalize objects out of
260 order by specifying a nonstandard finalization mark procedure (see
261 finalize.c). Objects reachable from finalizable objects will be marked
262 in a separate post-pass, and hence their memory won't be reclaimed.
263 Not recommended unless you are implementing a language that specifies
264 these semantics. Since 5.0, determines only the initial value
265 of GC_java_finalization variable.
266
267 FINALIZE_ON_DEMAND Causes finalizers to be run only in response
268 to explicit GC_invoke_finalizers() calls.
269 In 5.0 this became runtime adjustable, and this only determines the
270 initial value of GC_finalize_on_demand.
271
272 GC_NO_FINALIZATION Exclude finalization support (for smaller code size).
273
274 GC_TOGGLE_REFS_NOT_NEEDED Exclude toggle-refs support.
275
276 GC_ATOMIC_UNCOLLECTABLE Includes code for GC_malloc_atomic_uncollectable.
277 This is useful if either the vendor malloc implementation is poor,
278 or if REDIRECT_MALLOC is used.
279
280 MARK_BIT_PER_GRANULE Requests that a mark bit (or often byte)
281 be allocated for each allocation granule, as opposed to each object.
282 This often improves speed, possibly at some cost in space and/or
283 cache footprint. Normally it is best to let this decision be
284 made automatically depending on platform.
285
286 MARK_BIT_PER_OBJ Requests that a mark bit be allocated for each
287 object instead of allocation granule. The opposite of
288 MARK_BIT_PER_GRANULE.
289
290 HBLKSIZE=<ddd> Explicitly sets the heap block size (where ddd is a power of
291 2 between 512 and 16384). Each heap block is devoted to a single size and
292 kind of object. For the incremental collector it makes sense to match
293 the most likely page size. Otherwise large values result in more
294 fragmentation, but generally better performance for large heaps.
295
296 USE_MMAP Use MMAP instead of sbrk to get new memory.
297 Works for Linux, FreeBSD, Cygwin, Solaris and Irix.
298
299 USE_MUNMAP Causes memory to be returned to the OS under the right
300 circumstances. This currently disables VM-based incremental collection
301 (except for Win32 with GetWriteWatch() available).
302 Works under some Unix, Linux and Windows versions.
303 Requires USE_MMAP except for Windows.
304
305 USE_WINALLOC (Cygwin only) Use Win32 VirtualAlloc (instead of sbrk or mmap)
306 to get new memory. Useful if memory unmapping (USE_MUNMAP) is enabled.
307
308 MUNMAP_THRESHOLD=<value> Set the desired memory blocks unmapping
309 threshold (the number of sequential garbage collections for which
310 a candidate block for unmapping should remain free).
311
312 GC_FORCE_UNMAP_ON_GCOLLECT Set "unmap as much as possible on explicit GC"
313 mode on by default. The mode could be changed at run-time. Has no effect
314 unless unmapping is turned on. Has no effect on implicitly-initiated
315 garbage collections.
316
317 PRINT_BLACK_LIST Whenever a black list entry is added, i.e. whenever
318 the garbage collector detects a value that looks almost, but not quite,
319 like a pointer, print both the address containing the value, and the
320 value of the near-bogus-pointer. Can be used to identify regions of
321 memory that are likely to contribute misidentified pointers.
322
323 KEEP_BACK_PTRS Add code to save back pointers in debugging headers
324 for objects allocated with the debugging allocator. If all objects
325 through GC_MALLOC with GC_DEBUG defined, this allows the client
326 to determine how particular or randomly chosen objects are reachable
327 for debugging/profiling purposes. The gc_backptr.h interface is
328 implemented only if this is defined.
329
330 GC_ASSERTIONS Enable some internal GC assertion checking. Currently
331 this facility is only used in a few places. It is intended primarily
332 for debugging of the garbage collector itself, but could also...
333
334 DBG_HDRS_ALL Make sure that all objects have debug headers. Increases
335 the reliability (from 99.9999% to 100% mod. bugs) of some of the debugging
336 code (especially KEEP_BACK_PTRS). Makes SHORT_DBG_HDRS possible.
337 Assumes that all client allocation is done through debugging allocators.
338
339 SHORT_DBG_HDRS Assume that all objects have debug headers. Shorten
340 the headers to minimize object size, at the expense of checking for
341 writes past the end of an object. This is intended for environments
342 in which most client code is written in a "safe" language, such as
343 Scheme or Java. Assumes that all client allocation is done using
344 the GC_debug_ functions, or through the macros that expand to these,
345 or by redirecting malloc to GC_debug_malloc_replacement.
346 (Also eliminates the field for the requested object size.)
347 Occasionally could be useful for debugging of client code. Slows down the
348 collector somewhat, but not drastically.
349
350 SAVE_CALL_COUNT=<n> Set the number of call frames saved with objects
351 allocated through the debugging interface. Affects the amount of
352 information generated in leak reports. Only matters on platforms
353 on which we can quickly generate call stacks, currently Linux/(X86 & SPARC)
354 and Solaris/SPARC and platforms that provide execinfo.h.
355 Default is zero. On X86, client
356 code should NOT be compiled with -fomit-frame-pointer.
357
358 SAVE_CALL_NARGS=<n> Set the number of functions arguments to be saved
359 with each call frame. Default is zero. Ignored if we don't know how to
360 retrieve arguments on the platform.
361
362 CHECKSUMS Reports on erroneously clear dirty bits (at a substantial
363 performance cost). Use only for debugging of the incremental collector.
364 Not compatible with USE_MUNMAP or threads.
365
366 GC_GCJ_SUPPORT Includes support for gcj (and possibly other systems
367 that include a pointer to a type descriptor in each allocated object).
368
369 USE_I686_PREFETCH Causes the collector to issue Pentium III style
370 prefetch instructions. No effect except on X86 Linux platforms.
371 Assumes a very recent gcc-compatible compiler and assembler.
372 (Gas prefetcht0 support was added around May 1999.)
373 Empirically the code appears to still run correctly on Pentium II
374 processors, though with no performance benefit. May not run on other
375 X86 processors? In some cases this improves performance by
376 15% or so.
377
378 USE_3DNOW_PREFETCH Causes the collector to issue AMD 3DNow style
379 prefetch instructions. Same restrictions as USE_I686_PREFETCH.
380 Minimally tested. Didn't appear to be an obvious win on a K6-2/500.
381
382 USE_PPC_PREFETCH Causes the collector to issue PowerPC style
383 prefetch instructions. No effect except on PowerPC OS X platforms.
384 Performance impact untested.
385
386 GC_USE_LD_WRAP In combination with the old flags listed in README.linux
387 causes the collector some system and pthread calls in a more transparent
388 fashion than the usual macro-based approach. Requires GNU ld, and
389 currently probably works only with Linux.
390
391 GC_USE_DLOPEN_WRAP Causes the collector to redefine malloc and
392 intercepted pthread routines with their real names, and causes it to use
393 dlopen and dlsym to refer to the original versions. This makes it possible
394 to build an LD_PRELOADable malloc replacement library.
395
396 THREAD_LOCAL_ALLOC Defines GC_malloc(), GC_malloc_atomic() and
397 GC_gcj_malloc() to use a per-thread set of free-lists. These then allocate
398 in a way that usually does not involve acquisition of a global lock.
399 Recommended for multiprocessors. Requires explicit GC_INIT() call, unless
400 REDIRECT_MALLOC is defined and GC_malloc is used first.
401
402 USE_COMPILER_TLS Causes thread local allocation to use
403 the compiler-supported "__thread" thread-local variables. This is the
404 default in HP/UX. It may help performance on recent Linux installations.
405 (It failed for me on RedHat 8, but appears to work on RedHat 9.)
406
407 GC_ATTR_TLS_FAST Use specific attributes for GC_thread_key like
408 __attribute__((tls_model("local-exec"))).
409
410 PARALLEL_MARK Allows the marker to run in multiple threads. Recommended
411 for multiprocessors.
412
413 GC_BUILTIN_ATOMIC Use C11 (GCC) atomic intrinsics instead of
414 libatomic_ops primitives.
415
416 GC_ALWAYS_MULTITHREADED Force multi-threaded mode at GC initialization.
417 (Turns GC_allow_register_threads into a no-op routine.)
418
419 GC_ENABLE_SUSPEND_THREAD (Linux only) Turn on thread suspend/resume API
420 support.
421
422 GC_WINMAIN_REDIRECT (Win32 only) Redirect (rename) an application
423 WinMain to GC_WinMain; implement the "real" WinMain which starts a new
424 thread to call GC_WinMain after initializing the GC. Useful for WinCE.
425 Incompatible with GC_DLL.
426
427 GC_REGISTER_MEM_PRIVATE (Win32 only) Force to register MEM_PRIVATE R/W
428 sections as data roots. Might be needed for some WinCE 6.0+ custom builds.
429 (May result in numerous "Data Abort" messages logged to WinCE debugging
430 console.) Incompatible with GCC toolchains for WinCE.
431
432 NO_GETENV Prevents the collector from looking at environment variables.
433 These may otherwise alter its configuration, or turn off GC altogether.
434 I don't know of a reason to disable this, except possibly if the resulting
435 process runs as a privileged user. (This is on by default for WinCE.)
436
437 EMPTY_GETENV_RESULTS Define to workaround a reputed Wine bug in getenv
438 (getenv() may return an empty string instead of NULL for a missing entry).
439
440 GC_READ_ENV_FILE (Win32 only) Read environment variables from the GC "env"
441 file (named as the program name plus ".gc.env" extension). Useful for WinCE
442 targets (which have no getenv()). In the file, every variable is specified
443 in a separate line and the format is as "<name>=<value>" (without spaces).
444 A comment line may start with any character except for the Latin letters,
445 the digits and the underscore ('_'). The file encoding is Latin-1.
446
447 USE_GLOBAL_ALLOC (Win32 only) Use GlobalAlloc() instead of VirtualAlloc()
448 to allocate the heap. May be needed to work around a Windows NT/2000 issue.
449 Incompatible with USE_MUNMAP. See README.win32 for details.
450
451 MAKE_BACK_GRAPH Enable GC_PRINT_BACK_HEIGHT environment variable.
452 See README.environment for details. Experimental. Limited platform
453 support. Implies DBG_HDRS_ALL. All allocation should be done using
454 the debug interface.
455
456 GC_PRINT_BACK_HEIGHT Permanently turn on back-height printing mode
457 (useful when NO_GETENV). See the similar environment variable description
458 in README.environment. Requires MAKE_BACK_GRAPH defined.
459
460 HANDLE_FORK (Unix and Cygwin only) Attempt by default to make GC_malloc()
461 work in a child process fork()'ed from a multi-threaded parent. Not fully
462 POSIX-compliant and could be disabled at runtime (before GC_INIT).
463
464 TEST_WITH_SYSTEM_MALLOC Causes gctest to allocate (and leak) large
465 chunks of memory with the standard system malloc. This will cause the root
466 set and collected heap to grow significantly if malloc'ed memory is somehow
467 getting traced by the collector. This has no impact on the generated
468 library; it only affects the test.
469
470 POINTER_MASK=<0x...> Causes candidate pointers to be AND'ed with the given
471 mask before being considered. If either this or the following macro is
472 defined, it will be assumed that all pointers stored in the heap need to be
473 processed this way. Stack and register pointers will be considered both
474 with and without processing. These macros are normally needed only to
475 support systems that use high-order pointer tags. EXPERIMENTAL.
476
477 POINTER_SHIFT=<n> Causes the collector to left shift candidate pointers
478 by the indicated amount before trying to interpret them. Applied after
479 POINTER_MASK. EXPERIMENTAL. See also the preceding macro.
480
481 ENABLE_TRACE Enables the GC_TRACE=addr environment setting to do its job.
482 By default this is not supported in order to keep the marker as fast as
483 possible.
484
485 DARWIN_DONT_PARSE_STACK Causes the Darwin port to discover thread
486 stack bounds in the same way as other pthread ports, without trying to
487 walk the frames on the stack. This is recommended only as a fall-back for
488 applications that don't support proper stack unwinding.
489
490 GC_NO_THREADS_DISCOVERY (Darwin and Win32+DLL only) Exclude DllMain-based
491 (on Windows) and task-threads-based (on Darwin) thread registration support.
492
493 GC_INSIDE_DLL (Win32 only) Enable DllMain-based approach of threads
494 registering even in case GC_DLL is not defined.
495
496 GC_DISCOVER_TASK_THREADS (Darwin and Win32+DLL only) Compile the collector
497 with the implicitly turned on task-threads-based (on Darwin) or
498 DllMain-based (on Windows) approach of threads registering. Only for
499 compatibility and for the case when it is not possible to call
500 GC_use_threads_discovery() early (before other GC calls).
501
502 USE_PROC_FOR_LIBRARIES Causes the Linux collector to treat writable
503 memory mappings (as reported by /proc) as roots, if it doesn't have
504 other information about them. It no longer traverses dynamic loader
505 data structures to find dynamic library static data. This may be
506 required for applications that store pointers in mmapped segments without
507 informing the collector. But it typically performs poorly, especially
508 since it will scan inactive but cached NPTL thread stacks completely.
509
510 IGNORE_DYNAMIC_LOADING Don't define DYNAMIC_LOADING even if supported by the
511 platform (that is, build the collector with disabled tracing of dynamic
512 library data roots).
513
514 NO_PROC_STAT Causes the collector to avoid relying on Linux
515 "/proc/self/stat".
516
517 NO_GETCONTEXT Causes the collector to not assume the existence of the
518 getcontext() function on linux-like platforms. This currently happens
519 implicitly on Darwin, Hurd, or ARM or MIPS hardware. It is explicitly
520 needed for some old versions of FreeBSD.
521
522 STATIC=static Causes various GC_ symbols that could logically be declared
523 static to be declared (this is the default if NO_DEBUGGING is specified).
524 Reduces the number of visible symbols (letting the optimizer do its work
525 better), which is probably cleaner, but may make some kinds of debugging
526 and profiling harder.
527
528 GC_DLL Build dynamic-link library (or dynamic shared object). For Unix this
529 causes the exported symbols to have 'default' visibility (ignored unless
530 GCC v4+) and the internal ones to have 'hidden' visibility.
531
532 DONT_USE_USER32_DLL (Win32 only) Don't use "user32" DLL import library
533 (containing MessageBox() entry); useful for a static GC library.
534
535 GC_PREFER_MPROTECT_VDB Choose MPROTECT_VDB manually in case of multiple
536 virtual dirty bit strategies are implemented (at present useful on Win32 and
537 Solaris to force MPROTECT_VDB strategy instead of the default GWW_VDB or
538 PROC_VDB ones).
539
540 GC_IGNORE_GCJ_INFO Disable GCJ-style type information (useful for
541 debugging on WinCE).
542
543 GC_PRINT_VERBOSE_STATS Permanently turn on verbose logging (useful for
544 debugging and profiling on WinCE).
545
546 GC_ONLY_LOG_TO_FILE Don't redirect GC stdout and stderr to the log file
547 specified by GC_LOG_FILE environment variable. Has effect only when the
548 variable is set (to anything other than "0").
549
550 GC_ANDROID_LOG (Android only) Output error/debug information to Android log.
551
552 GC_DONT_EXPAND Don't expand the heap unless explicitly requested or forced to.
553
554 GC_USE_ENTIRE_HEAP Causes the non-incremental collector to use the
555 entire heap before collecting. This sometimes results in more large block
556 fragmentation, since very large blocks will tend to get broken up during
557 each GC cycle. It is likely to result in a larger working set, but lower
558 collection frequencies, and hence fewer instructions executed in the
559 collector. This macro controls only the default GC_use_entire_heap value.
560
561 GC_INITIAL_HEAP_SIZE=<value> Set the desired default initial heap size
562 in bytes.
563
564 GC_FREE_SPACE_DIVISOR=<value> Set alternate default GC_free_space_divisor
565 value.
566
567 GC_TIME_LIMIT=<milliseconds> Set alternate default GC_time_limit value
568 (setting this to GC_TIME_UNLIMITED will essentially disable incremental
569 collection while leaving generational collection enabled).
570
571 GC_FULL_FREQ=<value> Set alternate default number of partial collections
572 between full collections (matters only if incremental collection is on).
573
574 NO_CANCEL_SAFE (Posix platforms with threads only) Don't bother trying
575 to make the collector safe for thread cancellation; cancellation is not
576 used. (Note that if cancellation is used anyway, threads may end up
577 getting canceled in unexpected places.) Even without this option,
578 PTHREAD_CANCEL_ASYNCHRONOUS is never safe with the collector. (We could
579 argue about its safety without the collector.)
580
581 UNICODE (Win32 only) Use the Unicode variant ('W') of the Win32 API instead
582 of ANSI/ASCII one ('A'). Useful for WinCE.
583
584 HOST_ANDROID (or __ANDROID__) Compile for Android NDK platform.
585
586 SN_TARGET_PS3 Compile for Sony PS/3.
587
588 USE_GET_STACKBASE_FOR_MAIN (Linux only) Use pthread_attr_getstack() instead
589 of __libc_stack_end (or instead of any hard-coded value) for getting the
590 primordial thread stack base (useful if the client modifies the program's
591 address space).