• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..16-May-2018-

READMEH A D24-Jul-201531.1 KiB623517

README.DGUX386H A D28-Jul-20035.9 KiB216188

README.MacH A D17-Aug-200113.2 KiB386316

README.MacOSXH A D28-Jul-200360 21

README.OS2H A D17-Aug-2001365 75

README.amigaH A D17-Aug-200113.5 KiB323232

README.arm.crossH A D28-Jul-20032.1 KiB6952

README.autoconfH A D17-Aug-20012.3 KiB6040

README.changesH A D25-Jan-2006122.7 KiB2,2792,187

README.contributorsH A D17-Aug-20013.1 KiB5850

README.cordsH A D18-Aug-20012.5 KiB5441

README.darwinH A D25-Jan-20066.5 KiB142112

README.djH A D17-Aug-2001376 138

README.environmentH A D25-Jan-20067.5 KiB152130

README.ews4800H A D28-Jul-20032.1 KiB8261

README.hpH A D17-Aug-2001846 1914

README.linuxH A D25-Jan-20064.4 KiB133103

README.macrosH A D13-Aug-20044.2 KiB9574

README.rs6000H A D17-Aug-2001509 108

README.sgiH A D17-Aug-20011.8 KiB4229

README.solaris2H A D25-Jan-20063.1 KiB6151

README.utsH A D17-Aug-200186 32

README.win32H A D13-Aug-20049.6 KiB216176

barrett_diagramH A D17-Aug-20016.3 KiB10795

gc.manH A D13-Aug-20045.1 KiB9897

README

1Copyright (c) 1988, 1989 Hans-J. Boehm, Alan J. Demers
2Copyright (c) 1991-1996 by Xerox Corporation.  All rights reserved.
3Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
4Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P.
5
6The file linux_threads.c is also
7Copyright (c) 1998 by Fergus Henderson.  All rights reserved.
8
9The files Makefile.am, and configure.ac are
10Copyright (c) 2001 by Red Hat Inc. All rights reserved.
11
12Several files supporting GNU-style builds are copyrighted by the Free
13Software Foundation, and carry a different license from that given
14below.
15
16THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
17OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
18
19Permission is hereby granted to use or copy this program
20for any purpose,  provided the above notices are retained on all copies.
21Permission to modify the code and to distribute modified code is granted,
22provided the above notices are retained, and a notice that the code was
23modified is included with the above copyright notice.
24
25A few of the files needed to use the GNU-style build procedure come with
26slightly different licenses, though they are all similar in spirit.  A few
27are GPL'ed, but with an exception that should cover all uses in the
28collector.  (If you are concerned about such things, I recommend you look
29at the notice in config.guess or ltmain.sh.)
30
31This is version 6.6 of a conservative garbage collector for C and C++.
32
33You might find a more recent version of this at
34
35http://www.hpl.hp.com/personal/Hans_Boehm/gc
36
37OVERVIEW
38
39    This is intended to be a general purpose, garbage collecting storage
40allocator.  The algorithms used are described in:
41
42Boehm, H., and M. Weiser, "Garbage Collection in an Uncooperative Environment",
43Software Practice & Experience, September 1988, pp. 807-820.
44
45Boehm, H., A. Demers, and S. Shenker, "Mostly Parallel Garbage Collection",
46Proceedings of the ACM SIGPLAN '91 Conference on Programming Language Design
47and Implementation, SIGPLAN Notices 26, 6 (June 1991), pp. 157-164.
48
49Boehm, H., "Space Efficient Conservative Garbage Collection", Proceedings
50of the ACM SIGPLAN '91 Conference on Programming Language Design and
51Implementation, SIGPLAN Notices 28, 6 (June 1993), pp. 197-206.
52
53Boehm H., "Reducing Garbage Collector Cache Misses", Proceedings of the
542000 International Symposium on Memory Management.
55
56  Possible interactions between the collector and optimizing compilers are
57discussed in
58
59Boehm, H., and D. Chase, "A Proposal for GC-safe C Compilation",
60The Journal of C Language Translation 4, 2 (December 1992).
61
62and
63
64Boehm H., "Simple GC-safe Compilation", Proceedings
65of the ACM SIGPLAN '96 Conference on Programming Language Design and
66Implementation.
67
68(Some of these are also available from
69http://www.hpl.hp.com/personal/Hans_Boehm/papers/, among other places.)
70
71  Unlike the collector described in the second reference, this collector
72operates either with the mutator stopped during the entire collection
73(default) or incrementally during allocations.  (The latter is supported
74on only a few machines.)  On the most common platforms, it can be built
75with or without thread support.  On a few platforms, it can take advantage
76of a multiprocessor to speed up garbage collection.
77
78  Many of the ideas underlying the collector have previously been explored
79by others.  Notably, some of the run-time systems developed at Xerox PARC
80in the early 1980s conservatively scanned thread stacks to locate possible
81pointers (cf. Paul Rovner, "On Adding Garbage Collection and Runtime Types
82to a Strongly-Typed Statically Checked, Concurrent Language"  Xerox PARC
83CSL 84-7).  Doug McIlroy wrote a simpler fully conservative collector that
84was part of version 8 UNIX (tm), but appears to not have received
85widespread use.
86
87  Rudimentary tools for use of the collector as a leak detector are included
88(see http://www.hpl.hp.com/personal/Hans_Boehm/gc/leak.html),
89as is a fairly sophisticated string package "cord" that makes use of the
90collector.  (See doc/README.cords and H.-J. Boehm, R. Atkinson, and M. Plass,
91"Ropes: An Alternative to Strings", Software Practice and Experience 25, 12
92(December 1995), pp. 1315-1330.  This is very similar to the "rope" package
93in Xerox Cedar, or the "rope" package in the SGI STL or the g++ distribution.)
94
95Further collector documantation can be found at
96
97http://www.hpl.hp.com/personal/Hans_Boehm/gc
98
99
100GENERAL DESCRIPTION
101
102  This is a garbage collecting storage allocator that is intended to be
103used as a plug-in replacement for C's malloc.
104
105  Since the collector does not require pointers to be tagged, it does not
106attempt to ensure that all inaccessible storage is reclaimed.  However,
107in our experience, it is typically more successful at reclaiming unused
108memory than most C programs using explicit deallocation.  Unlike manually
109introduced leaks, the amount of unreclaimed memory typically stays
110bounded.
111
112  In the following, an "object" is defined to be a region of memory allocated
113by the routines described below.
114
115  Any objects not intended to be collected must be pointed to either
116from other such accessible objects, or from the registers,
117stack, data, or statically allocated bss segments.  Pointers from
118the stack or registers may point to anywhere inside an object.
119The same is true for heap pointers if the collector is compiled with
120 ALL_INTERIOR_POINTERS defined, as is now the default.
121
122Compiling without ALL_INTERIOR_POINTERS may reduce accidental retention
123of garbage objects, by requiring pointers from the heap to to the beginning
124of an object.  But this no longer appears to be a significant
125issue for most programs.
126
127There are a number of routines which modify the pointer recognition
128algorithm.  GC_register_displacement allows certain interior pointers
129to be recognized even if ALL_INTERIOR_POINTERS is nor defined.
130GC_malloc_ignore_off_page allows some pointers into the middle of large objects
131to be disregarded, greatly reducing the probablility of accidental
132retention of large objects.  For most purposes it seems best to compile
133with ALL_INTERIOR_POINTERS and to use GC_malloc_ignore_off_page if
134you get collector warnings from allocations of very large objects.
135See README.debugging for details.
136
137  WARNING: pointers inside memory allocated by the standard "malloc" are not
138seen by the garbage collector.  Thus objects pointed to only from such a
139region may be prematurely deallocated.  It is thus suggested that the
140standard "malloc" be used only for memory regions, such as I/O buffers, that
141are guaranteed not to contain pointers to garbage collectable memory.
142Pointers in C language automatic, static, or register variables,
143are correctly recognized.  (Note that GC_malloc_uncollectable has semantics
144similar to standard malloc, but allocates objects that are traced by the
145collector.)
146
147  WARNING: the collector does not always know how to find pointers in data
148areas that are associated with dynamic libraries.  This is easy to
149remedy IF you know how to find those data areas on your operating
150system (see GC_add_roots).  Code for doing this under SunOS, IRIX 5.X and 6.X,
151HP/UX, Alpha OSF/1, Linux, and win32 is included and used by default.  (See
152README.win32 for win32 details.)  On other systems pointers from dynamic
153library data areas may not be considered by the collector.
154If you're writing a program that depends on the collector scanning
155dynamic library data areas, it may be a good idea to include at least
156one call to GC_is_visible() to ensure that those areas are visible
157to the collector.
158
159  Note that the garbage collector does not need to be informed of shared
160read-only data.  However if the shared library mechanism can introduce
161discontiguous data areas that may contain pointers, then the collector does
162need to be informed.
163
164  Signal processing for most signals may be deferred during collection,
165and during uninterruptible parts of the allocation process.
166Like standard ANSI C mallocs, by default it is unsafe to invoke
167malloc (and other GC routines) from a signal handler while another
168malloc call may be in progress. Removing -DNO_SIGNALS from Makefile
169attempts to remedy that.  But that may not be reliable with a compiler that
170substantially reorders memory operations inside GC_malloc.
171
172  The allocator/collector can also be configured for thread-safe operation.
173(Full signal safety can also be achieved, but only at the cost of two system
174calls per malloc, which is usually unacceptable.)
175WARNING: the collector does not guarantee to scan thread-local storage
176(e.g. of the kind accessed with pthread_getspecific()).  The collector
177does scan thread stacks, though, so generally the best solution is to
178ensure that any pointers stored in thread-local storage are also
179stored on the thread's stack for the duration of their lifetime.
180(This is arguably a longstanding bug, but it hasn't been fixed yet.)
181
182INSTALLATION AND PORTABILITY
183
184  As distributed, the macro SILENT is defined in Makefile.
185In the event of problems, this can be removed to obtain a moderate
186amount of descriptive output for each collection.
187(The given statistics exhibit a few peculiarities.
188Things don't appear to add up for a variety of reasons, most notably
189fragmentation losses.  These are probably much more significant for the
190contrived program "test.c" than for your application.)
191
192  Note that typing "make test" will automatically build the collector
193and then run setjmp_test and gctest. Setjmp_test will give you information
194about configuring the collector, which is useful primarily if you have
195a machine that's not already supported.  Gctest is a somewhat superficial
196test of collector functionality.  Failure is indicated by a core dump or
197a message to the effect that the collector is broken.  Gctest takes about
19835 seconds to run on a SPARCstation 2. It may use up to 8 MB of memory.  (The
199multi-threaded version will use more.  64-bit versions may use more.)
200"Make test" will also, as its last step, attempt to build and test the
201"cord" string library.  This will fail without an ANSI C compiler, but
202the garbage collector itself should still be usable.
203
204  The Makefile will generate a library gc.a which you should link against.
205Typing "make cords" will add the cord library to gc.a.
206Note that this requires an ANSI C compiler.
207
208  It is suggested that if you need to replace a piece of the collector
209(e.g. GC_mark_rts.c) you simply list your version ahead of gc.a on the
210ld command line, rather than replacing the one in gc.a.  (This will
211generate numerous warnings under some versions of AIX, but it still
212works.)
213
214  All include files that need to be used by clients will be put in the
215include subdirectory.  (Normally this is just gc.h.  "Make cords" adds
216"cord.h" and "ec.h".)
217
218  The collector currently is designed to run essentially unmodified on
219machines that use a flat 32-bit or 64-bit address space.
220That includes the vast majority of Workstations and X86 (X >= 3) PCs.
221(The list here was deleted because it was getting too long and constantly
222out of date.)
223  It does NOT run under plain 16-bit DOS or Windows 3.X.  There are however
224various packages (e.g. win32s, djgpp) that allow flat 32-bit address
225applications to run under those systemsif the have at least an 80386 processor,
226and several of those are compatible with the collector.
227
228  In a few cases (Amiga, OS/2, Win32, MacOS) a separate makefile
229or equivalent is supplied.  Many of these have separate README.system
230files.
231
232  Dynamic libraries are completely supported only under SunOS/Solaris,
233(and even that support is not functional on the last Sun 3 release),
234Linux, FreeBSD, NetBSD, IRIX 5&6, HP/UX, Win32 (not Win32S) and OSF/1
235on DEC AXP machines plus perhaps a few others listed near the top
236of dyn_load.c.  On other machines we recommend that you do one of
237the following:
238
239  1) Add dynamic library support (and send us the code).
240  2) Use static versions of the libraries.
241  3) Arrange for dynamic libraries to use the standard malloc.
242     This is still dangerous if the library stores a pointer to a
243     garbage collected object.  But nearly all standard interfaces
244     prohibit this, because they deal correctly with pointers
245     to stack allocated objects.  (Strtok is an exception.  Don't
246     use it.)
247
248  In all cases we assume that pointer alignment is consistent with that
249enforced by the standard C compilers.  If you use a nonstandard compiler
250you may have to adjust the alignment parameters defined in gc_priv.h.
251Note that this may also be an issue with packed records/structs, if those
252enforce less alignment for pointers.
253
254  A port to a machine that is not byte addressed, or does not use 32 bit
255or 64 bit addresses will require a major effort.  A port to plain MSDOS
256or win16 is hard.
257
258  For machines not already mentioned, or for nonstandard compilers, the
259following are likely to require change:
260
2611.  The parameters in gcconfig.h.
262      The parameters that will usually require adjustment are
263   STACKBOTTOM,  ALIGNMENT and DATASTART.  Setjmp_test
264   prints its guesses of the first two.
265      DATASTART should be an expression for computing the
266   address of the beginning of the data segment.  This can often be
267   &etext.  But some memory management units require that there be
268   some unmapped space between the text and the data segment.  Thus
269   it may be more complicated.   On UNIX systems, this is rarely
270   documented.  But the adb "$m" command may be helpful.  (Note
271   that DATASTART will usually be a function of &etext.  Thus a
272   single experiment is usually insufficient.)
273     STACKBOTTOM is used to initialize GC_stackbottom, which
274   should be a sufficient approximation to the coldest stack address.
275   On some machines, it is difficult to obtain such a value that is
276   valid across a variety of MMUs, OS releases, etc.  A number of
277   alternatives exist for using the collector in spite of this.  See the
278   discussion in gcconfig.h immediately preceding the various
279   definitions of STACKBOTTOM.
280
2812.  mach_dep.c.
282      The most important routine here is one to mark from registers.
283    The distributed file includes a generic hack (based on setjmp) that
284    happens to work on many machines, and may work on yours.  Try
285    compiling and running setjmp_t.c to see whether it has a chance of
286    working.  (This is not correct C, so don't blame your compiler if it
287    doesn't work.  Based on limited experience, register window machines
288    are likely to cause trouble.  If your version of setjmp claims that
289    all accessible variables, including registers, have the value they
290    had at the time of the longjmp, it also will not work.  Vanilla 4.2 BSD
291    on Vaxen makes such a claim.  SunOS does not.)
292      If your compiler does not allow in-line assembly code, or if you prefer
293    not to use such a facility, mach_dep.c may be replaced by a .s file
294    (as we did for the MIPS machine and the PC/RT).
295      At this point enough architectures are supported by mach_dep.c
296    that you will rarely need to do more than adjust for assembler
297    syntax.
298
2993.  os_dep.c (and gc_priv.h).
300  	  Several kinds of operating system dependent routines reside here.
301  	Many are optional.  Several are invoked only through corresponding
302  	macros in gc_priv.h, which may also be redefined as appropriate.
303      The routine GC_register_data_segments is crucial.  It registers static
304    data areas that must be traversed by the collector. (User calls to
305    GC_add_roots may sometimes be used for similar effect.)
306      Routines to obtain memory from the OS also reside here.
307    Alternatively this can be done entirely by the macro GET_MEM
308    defined in gc_priv.h.  Routines to disable and reenable signals
309    also reside here if they are need by the macros DISABLE_SIGNALS
310    and ENABLE_SIGNALS defined in gc_priv.h.
311      In a multithreaded environment, the macros LOCK and UNLOCK
312    in gc_priv.h will need to be suitably redefined.
313      The incremental collector requires page dirty information, which
314    is acquired through routines defined in os_dep.c.  Unless directed
315    otherwise by gcconfig.h, these are implemented as stubs that simply
316    treat all pages as dirty.  (This of course makes the incremental
317    collector much less useful.)
318
3194.  dyn_load.c
320	This provides a routine that allows the collector to scan data
321	segments associated with dynamic libraries.  Often it is not
322	necessary to provide this routine unless user-written dynamic
323	libraries are used.
324
325  For a different version of UN*X or different machines using the
326Motorola 68000, Vax, SPARC, 80386, NS 32000, PC/RT, or MIPS architecture,
327it should frequently suffice to change definitions in gcconfig.h.
328
329
330THE C INTERFACE TO THE ALLOCATOR
331
332  The following routines are intended to be directly called by the user.
333Note that usually only GC_malloc is necessary.  GC_clear_roots and GC_add_roots
334calls may be required if the collector has to trace from nonstandard places
335(e.g. from dynamic library data areas on a machine on which the
336collector doesn't already understand them.)  On some machines, it may
337be desirable to set GC_stacktop to a good approximation of the stack base.
338(This enhances code portability on HP PA machines, since there is no
339good way for the collector to compute this value.)  Client code may include
340"gc.h", which defines all of the following, plus many others.
341
3421)  GC_malloc(nbytes)
343    - allocate an object of size nbytes.  Unlike malloc, the object is
344      cleared before being returned to the user.  Gc_malloc will
345      invoke the garbage collector when it determines this to be appropriate.
346      GC_malloc may return 0 if it is unable to acquire sufficient
347      space from the operating system.  This is the most probable
348      consequence of running out of space.  Other possible consequences
349      are that a function call will fail due to lack of stack space,
350      or that the collector will fail in other ways because it cannot
351      maintain its internal data structures, or that a crucial system
352      process will fail and take down the machine.  Most of these
353      possibilities are independent of the malloc implementation.
354
3552)  GC_malloc_atomic(nbytes)
356    - allocate an object of size nbytes that is guaranteed not to contain any
357      pointers.  The returned object is not guaranteed to be cleared.
358      (Can always be replaced by GC_malloc, but results in faster collection
359      times.  The collector will probably run faster if large character
360      arrays, etc. are allocated with GC_malloc_atomic than if they are
361      statically allocated.)
362
3633)  GC_realloc(object, new_size)
364    - change the size of object to be new_size.  Returns a pointer to the
365      new object, which may, or may not, be the same as the pointer to
366      the old object.  The new object is taken to be atomic iff the old one
367      was.  If the new object is composite and larger than the original object,
368      then the newly added bytes are cleared (we hope).  This is very likely
369      to allocate a new object, unless MERGE_SIZES is defined in gc_priv.h.
370      Even then, it is likely to recycle the old object only if the object
371      is grown in small additive increments (which, we claim, is generally bad
372      coding practice.)
373
3744)  GC_free(object)
375    - explicitly deallocate an object returned by GC_malloc or
376      GC_malloc_atomic.  Not necessary, but can be used to minimize
377      collections if performance is critical.  Probably a performance
378      loss for very small objects (<= 8 bytes).
379
3805)  GC_expand_hp(bytes)
381    - Explicitly increase the heap size.  (This is normally done automatically
382      if a garbage collection failed to GC_reclaim enough memory.  Explicit
383      calls to GC_expand_hp may prevent unnecessarily frequent collections at
384      program startup.)
385
3866)  GC_malloc_ignore_off_page(bytes)
387	- identical to GC_malloc, but the client promises to keep a pointer to
388	  the somewhere within the first 256 bytes of the object while it is
389	  live.  (This pointer should nortmally be declared volatile to prevent
390	  interference from compiler optimizations.)  This is the recommended
391	  way to allocate anything that is likely to be larger than 100Kbytes
392	  or so.  (GC_malloc may result in failure to reclaim such objects.)
393
3947)  GC_set_warn_proc(proc)
395	- Can be used to redirect warnings from the collector.  Such warnings
396	  should be rare, and should not be ignored during code development.
397
3988) GC_enable_incremental()
399    - Enables generational and incremental collection.  Useful for large
400      heaps on machines that provide access to page dirty information.
401      Some dirty bit implementations may interfere with debugging
402      (by catching address faults) and place restrictions on heap arguments
403      to system calls (since write faults inside a system call may not be
404      handled well).
405
4069) Several routines to allow for registration of finalization code.
407   User supplied finalization code may be invoked when an object becomes
408   unreachable.  To call (*f)(obj, x) when obj becomes inaccessible, use
409	GC_register_finalizer(obj, f, x, 0, 0);
410   For more sophisticated uses, and for finalization ordering issues,
411   see gc.h.
412
413  The global variable GC_free_space_divisor may be adjusted up from its
414default value of 4 to use less space and more collection time, or down for
415the opposite effect.  Setting it to 1 or 0 will effectively disable collections
416and cause all allocations to simply grow the heap.
417
418  The variable GC_non_gc_bytes, which is normally 0, may be changed to reflect
419the amount of memory allocated by the above routines that should not be
420considered as a candidate for collection.  Careless use may, of course, result
421in excessive memory consumption.
422
423  Some additional tuning is possible through the parameters defined
424near the top of gc_priv.h.
425
426  If only GC_malloc is intended to be used, it might be appropriate to define:
427
428#define malloc(n) GC_malloc(n)
429#define calloc(m,n) GC_malloc((m)*(n))
430
431  For small pieces of VERY allocation intensive code, gc_inl.h
432includes some allocation macros that may be used in place of GC_malloc
433and friends.
434
435  All externally visible names in the garbage collector start with "GC_".
436To avoid name conflicts, client code should avoid this prefix, except when
437accessing garbage collector routines or variables.
438
439  There are provisions for allocation with explicit type information.
440This is rarely necessary.  Details can be found in gc_typed.h.
441
442THE C++ INTERFACE TO THE ALLOCATOR:
443
444  The Ellis-Hull C++ interface to the collector is included in
445the collector distribution.  If you intend to use this, type
446"make c++" after the initial build of the collector is complete.
447See gc_cpp.h for the definition of the interface.  This interface
448tries to approximate the Ellis-Detlefs C++ garbage collection
449proposal without compiler changes.
450
451Cautions:
4521. Arrays allocated without new placement syntax are
453allocated as uncollectable objects.  They are traced by the
454collector, but will not be reclaimed.
455
4562. Failure to use "make c++" in combination with (1) will
457result in arrays allocated using the default new operator.
458This is likely to result in disaster without linker warnings.
459
4603. If your compiler supports an overloaded new[] operator,
461then gc_cpp.cc and gc_cpp.h should be suitably modified.
462
4634. Many current C++ compilers have deficiencies that
464break some of the functionality.  See the comments in gc_cpp.h
465for suggested workarounds.
466
467USE AS LEAK DETECTOR:
468
469  The collector may be used to track down leaks in C programs that are
470intended to run with malloc/free (e.g. code with extreme real-time or
471portability constraints).  To do so define FIND_LEAK in Makefile
472This will cause the collector to invoke the report_leak
473routine defined near the top of reclaim.c whenever an inaccessible
474object is found that has not been explicitly freed.  Such objects will
475also be automatically reclaimed.
476  Productive use of this facility normally involves redefining report_leak
477to do something more intelligent.  This typically requires annotating
478objects with additional information (e.g. creation time stack trace) that
479identifies their origin.  Such code is typically not very portable, and is
480not included here, except on SPARC machines.
481  If all objects are allocated with GC_DEBUG_MALLOC (see next section),
482then the default version of report_leak will report the source file
483and line number at which the leaked object was allocated.  This may
484sometimes be sufficient.  (On SPARC/SUNOS4 machines, it will also report
485a cryptic stack trace.  This can often be turned into a sympolic stack
486trace by invoking program "foo" with "callprocs foo".  Callprocs is
487a short shell script that invokes adb to expand program counter values
488to symbolic addresses.  It was largely supplied by Scott Schwartz.)
489  Note that the debugging facilities described in the next section can
490sometimes be slightly LESS effective in leak finding mode, since in
491leak finding mode, GC_debug_free actually results in reuse of the object.
492(Otherwise the object is simply marked invalid.)  Also note that the test
493program is not designed to run meaningfully in FIND_LEAK mode.
494Use "make gc.a" to build the collector.
495
496DEBUGGING FACILITIES:
497
498  The routines GC_debug_malloc, GC_debug_malloc_atomic, GC_debug_realloc,
499and GC_debug_free provide an alternate interface to the collector, which
500provides some help with memory overwrite errors, and the like.
501Objects allocated in this way are annotated with additional
502information.  Some of this information is checked during garbage
503collections, and detected inconsistencies are reported to stderr.
504
505  Simple cases of writing past the end of an allocated object should
506be caught if the object is explicitly deallocated, or if the
507collector is invoked while the object is live.  The first deallocation
508of an object will clear the debugging info associated with an
509object, so accidentally repeated calls to GC_debug_free will report the
510deallocation of an object without debugging information.  Out of
511memory errors will be reported to stderr, in addition to returning
512NIL.
513
514  GC_debug_malloc checking  during garbage collection is enabled
515with the first call to GC_debug_malloc.  This will result in some
516slowdown during collections.  If frequent heap checks are desired,
517this can be achieved by explicitly invoking GC_gcollect, e.g. from
518the debugger.
519
520  GC_debug_malloc allocated objects should not be passed to GC_realloc
521or GC_free, and conversely.  It is however acceptable to allocate only
522some objects with GC_debug_malloc, and to use GC_malloc for other objects,
523provided the two pools are kept distinct.  In this case, there is a very
524low probablility that GC_malloc allocated objects may be misidentified as
525having been overwritten.  This should happen with probability at most
526one in 2**32.  This probability is zero if GC_debug_malloc is never called.
527
528  GC_debug_malloc, GC_malloc_atomic, and GC_debug_realloc take two
529additional trailing arguments, a string and an integer.  These are not
530interpreted by the allocator.  They are stored in the object (the string is
531not copied).  If an error involving the object is detected, they are printed.
532
533  The macros GC_MALLOC, GC_MALLOC_ATOMIC, GC_REALLOC, GC_FREE, and
534GC_REGISTER_FINALIZER are also provided.  These require the same arguments
535as the corresponding (nondebugging) routines.  If gc.h is included
536with GC_DEBUG defined, they call the debugging versions of these
537functions, passing the current file name and line number as the two
538extra arguments, where appropriate.  If gc.h is included without GC_DEBUG
539defined, then all these macros will instead be defined to their nondebugging
540equivalents.  (GC_REGISTER_FINALIZER is necessary, since pointers to
541objects with debugging information are really pointers to a displacement
542of 16 bytes form the object beginning, and some translation is necessary
543when finalization routines are invoked.  For details, about what's stored
544in the header, see the definition of the type oh in debug_malloc.c)
545
546INCREMENTAL/GENERATIONAL COLLECTION:
547
548The collector normally interrupts client code for the duration of
549a garbage collection mark phase.  This may be unacceptable if interactive
550response is needed for programs with large heaps.  The collector
551can also run in a "generational" mode, in which it usually attempts to
552collect only objects allocated since the last garbage collection.
553Furthermore, in this mode, garbage collections run mostly incrementally,
554with a small amount of work performed in response to each of a large number of
555GC_malloc requests.
556
557This mode is enabled by a call to GC_enable_incremental().
558
559Incremental and generational collection is effective in reducing
560pause times only if the collector has some way to tell which objects
561or pages have been recently modified.  The collector uses two sources
562of information:
563
5641. Information provided by the VM system.  This may be provided in
565one of several forms.  Under Solaris 2.X (and potentially under other
566similar systems) information on dirty pages can be read from the
567/proc file system.  Under other systems (currently SunOS4.X) it is
568possible to write-protect the heap, and catch the resulting faults.
569On these systems we require that system calls writing to the heap
570(other than read) be handled specially by client code.
571See os_dep.c for details.
572
5732. Information supplied by the programmer.  We define "stubborn"
574objects to be objects that are rarely changed.  Such an object
575can be allocated (and enabled for writing) with GC_malloc_stubborn.
576Once it has been initialized, the collector should be informed with
577a call to GC_end_stubborn_change.  Subsequent writes that store
578pointers into the object must be preceded by a call to
579GC_change_stubborn.
580
581This mechanism performs best for objects that are written only for
582initialization, and such that only one stubborn object is writable
583at once.  It is typically not worth using for short-lived
584objects.  Stubborn objects are treated less efficiently than pointerfree
585(atomic) objects.
586
587A rough rule of thumb is that, in the absence of VM information, garbage
588collection pauses are proportional to the amount of pointerful storage
589plus the amount of modified "stubborn" storage that is reachable during
590the collection.
591
592Initial allocation of stubborn objects takes longer than allocation
593of other objects, since other data structures need to be maintained.
594
595We recommend against random use of stubborn objects in client
596code, since bugs caused by inappropriate writes to stubborn objects
597are likely to be very infrequently observed and hard to trace.
598However, their use may be appropriate in a few carefully written
599library routines that do not make the objects themselves available
600for writing by client code.
601
602
603BUGS:
604
605  Any memory that does not have a recognizable pointer to it will be
606reclaimed.  Exclusive-or'ing forward and backward links in a list
607doesn't cut it.
608  Some C optimizers may lose the last undisguised pointer to a memory
609object as a consequence of clever optimizations.  This has almost
610never been observed in practice.  Send mail to boehm@acm.org
611for suggestions on how to fix your compiler.
612  This is not a real-time collector.  In the standard configuration,
613percentage of time required for collection should be constant across
614heap sizes.  But collection pauses will increase for larger heaps.
615(On SPARCstation 2s collection times will be on the order of 300 msecs
616per MB of accessible memory that needs to be scanned.  Your mileage
617may vary.)  The incremental/generational collection facility helps,
618but is portable only if "stubborn" allocation is used.
619  Please address bug reports to boehm@acm.org.  If you are
620contemplating a major addition, you might also send mail to ask whether
621it's already been done (or whether we tried and discarded it).
622
623

README.DGUX386

1    Garbage Collector (parallel iversion) for ix86 DG/UX Release R4.20MU07
2
3
4     *READ* the file README.QUICK.
5
6     You need the GCC-3.0.3 rev (DG/UX) compiler to build this tree.
7     This compiler has the new "dgux386" threads package implemented.
8     It also supports the switch "-pthread" needed to link correctly
9     the DG/UX's -lrte -lthread with -lgcc and the system's -lc.
10     Finally we support parralleli-mark for the SMP DG/UX machines.
11     To build the garbage collector do:
12
13      ./configure --enable-parallel-mark
14      make
15      make gctest
16
17     Before you run "gctest" you need to set your LD_LIBRARY_PATH
18     correctly so that "gctest" can find the shared library libgc.
19     Alternatively you can do a configuration
20
21      ./configure --enable-parallel-mark --disable-shared
22
23     to build only the static version of libgc.
24
25     To enable debugging messages please do:
26     1) Add the "--enable-full-debug" flag during configuration.
27     2) Edit the file linux-threads.c and uncommnect the line:
28
29     /* #define DEBUG_THREADS 1 */ to --->
30
31     #define DEBUG_THREADS 1
32
33     Then give "make" as usual.
34
35     In a machine with 4 CPUs (my own machine) the option parallel
36     mark (aka --enable-parallel-mark) makes a BIG difference.
37
38     Takis Psarogiannakopoulos
39     University of Cambridge
40     Centre for Mathematical Sciences
41     Department of Pure Mathematics
42     Wilberforce Road
43     Cambridge CB3 0WB ,UK , <takis@XFree86.Org>
44     January 2002
45
46
47Note (HB):
48     The integration of this patch is currently not complete.
49     The following patches against 6.1alpha3 where hard to move
50     to alpha4, and are not integrated.  There may also be minor
51     problems with stylistic corrections made by me.
52
53
54--- ltconfig.ORIG	Mon Jan 28 20:22:18 2002
55+++ ltconfig	Mon Jan 28 20:44:00 2002
56@@ -689,6 +689,11 @@
57        pic_flag=-Kconform_pic
58     fi
59     ;;
60+  dgux*)
61+    pic_flag='-fPIC'
62+    link_static='-Bstatic'
63+    wl='-Wl,'
64+    ;;
65   *)
66     pic_flag='-fPIC'
67     ;;
68@@ -718,6 +723,12 @@
69     # We can build DLLs from non-PIC.
70     ;;
71
72+  dgux*)
73+    pic_flag='-KPIC'
74+    link_static='-Bstatic'
75+    wl='-Wl,'
76+    ;;
77+
78   osf3* | osf4* | osf5*)
79     # All OSF/1 code is PIC.
80     wl='-Wl,'
81@@ -1154,6 +1165,22 @@
82     fi
83     ;;
84
85+  dgux*)
86+    ld_shlibs=yes
87+    # For both C/C++ ommit the deplibs. This is because we relying on the fact
88+    # that compilation of execitables will put them in correct order
89+    # in any case and sometimes are wrong when listed as deplibs (or missing some deplibs)
90+    # However when GNU ld and --whole-archive needs to be used we have the problem
91+    # that if the -fPIC *_s.a archive is linked through deplibs list we ommiting crucial
92+    # .lo/.o files from the created shared lib. This I think is not the case here.
93+    archive_cmds='$CC -shared -h $soname -o $lib $libobjs $linkopts'
94+    thread_safe_flag_spec='-pthread'
95+    wlarc=
96+    hardcode_libdir_flag_spec='-L$libdir'
97+    hardcode_shlibpath_var=no
98+    ac_cv_archive_cmds_needs_lc=no
99+    ;;
100+
101   cygwin* | mingw*)
102     # hardcode_libdir_flag_spec is actually meaningless, as there is
103     # no search path for DLLs.
104@@ -1497,7 +1524,7 @@
105     ;;
106
107   dgux*)
108-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
109+    archive_cmds='$CC -shared -h $soname -o $lib $libobjs $linkopts'
110     hardcode_libdir_flag_spec='-L$libdir'
111     hardcode_shlibpath_var=no
112     ;;
113@@ -2092,12 +2119,17 @@
114   ;;
115
116 dgux*)
117-  version_type=linux
118+  version_type=dgux
119   need_lib_prefix=no
120   need_version=no
121-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
122-  soname_spec='${libname}${release}.so$major'
123+  library_names_spec='$libname.so$versuffix'
124+  soname_spec='$libname.so$versuffix'
125   shlibpath_var=LD_LIBRARY_PATH
126+  thread_safe_flag_spec='-pthread'
127+  wlarc=
128+  hardcode_libdir_flag_spec='-L$libdir'
129+  hardcode_shlibpath_var=no
130+  ac_cv_archive_cmds_needs_lc=no
131   ;;
132
133 sysv4*MP*)
134
135
136--- ltmain.sh.ORIG	Mon Jan 28 20:31:18 2002
137+++ ltmain.sh	Tue Jan 29 00:11:29 2002
138@@ -1072,11 +1072,38 @@
139 	esac
140 	;;
141
142+      -thread*)
143+	# DG/UX GCC 2.95.x, 3.x.x rev (DG/UX) links -lthread
144+	# with the switch -threads
145+	if test "$arg" = "-threads"; then
146+	  case "$host" in
147+	  i[3456]86-*-dgux*)
148+	    deplibs="$deplibs $arg"
149+	    continue
150+	    ;;
151+	  esac
152+	fi
153+	;;
154+
155+      -pthread*)
156+	# DG/UX GCC 2.95.x, 3.x.x rev (DG/UX) links -lthread
157+	# with the switch -pthread
158+	if test "$arg" = "-pthread"; then
159+	  case "$host" in
160+	  i[3456]86-*-dgux*)
161+	    deplibs="$deplibs $arg"
162+	    continue
163+	    ;;
164+	  esac
165+	fi
166+	;;
167+
168       -l*)
169 	if test "$arg" = "-lc"; then
170 	  case "$host" in
171-	  *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
172+	  *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos* | i[3456]86-*-dgux*)
173 	    # These systems don't actually have c library (as such)
174+	    # It is wrong in DG/UX to add -lc when creating shared/dynamic objs/libs
175 	    continue
176 	    ;;
177 	  esac
178@@ -1248,6 +1275,12 @@
179 	  temp_deplibs=
180 	  for deplib in $dependency_libs; do
181 	    case "$deplib" in
182+	    -thread*)
183+		 temp_deplibs="$temp_deplibs $deplib"
184+		 ;;
185+	    -pthread)
186+		 temp_deplibs="$temp_deplibs $deplib"
187+		 ;;
188 	    -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
189 		 case " $rpath $xrpath " in
190 		 *" $temp_xrpath "*) ;;
191@@ -1709,6 +1742,13 @@
192 	  done
193 	  ;;
194
195+	dgux)
196+	  # Leave mostly blank for DG/UX
197+	  major=
198+	  versuffix=".$current.$revision";
199+	  verstring=
200+	  ;;
201+
202 	linux)
203 	  major=.`expr $current - $age`
204 	  versuffix="$major.$age.$revision"
205@@ -1792,8 +1832,9 @@
206
207 	dependency_libs="$deplibs"
208 	case "$host" in
209-	*-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
210+	*-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos* | i[3456]86-*-dgux*)
211 	  # these systems don't actually have a c library (as such)!
212+	  # It is wrong in DG/UX to add -lc when creating shared/dynamic objs/libs
213 	  ;;
214 	*)
215 	  # Add libc to deplibs on all other systems.
216

README.Mac

1Patrick Beard's Notes for building GC v4.12 with CodeWarrior Pro 2:
2----------------------------------------------------------------------------
3The current build environment for the collector is CodeWarrior Pro 2.
4Projects for CodeWarrior Pro 2 (and for quite a few older versions)
5are distributed in the file Mac_projects.sit.hqx. The project file
6:Mac_projects:gc.prj builds static library versions of the collector.
7:Mac_projects:gctest.prj builds the GC test suite.
8
9Configuring the collector is still done by editing the files
10:Mac_files:MacOS_config.h and :Mac_files:MacOS_Test_config.h.
11
12Lars Farm's suggestions on building the collector:
13----------------------------------------------------------------------------
14Garbage Collection on MacOS - a manual 'MakeFile'
15-------------------------------------------------
16
17Project files and IDE's are great on the Macintosh, but they do have
18problems when used as distribution media. This note tries to provide
19porting instructions in pure TEXT form to avoid those problems. A manual
20'makefile' if you like.
21
22    GC version:     4.12a2
23    Codewarrior:    CWPro1
24    date:           18 July 1997
25
26The notes may or may not apply to earlier or later versions of the
27GC/CWPro. Actually, they do apply to earlier versions of both except that
28until recently a project could only build one target so each target was a
29separate project. The notes will most likely apply to future versions too.
30Possibly with minor tweaks.
31
32This is just to record my experiences. These notes do not mean I now
33provide a supported port of the GC to MacOS. It works for me. If it works
34for you, great. If it doesn't, sorry, try again...;-) Still, if you find
35errors, please let me know.
36
37    mailto:         lars.farm@ite.mh.se
38
39    address:        Lars Farm
40                    Kr�nv�gen 33b
41                    856 44 Sundsvall
42                    Sweden
43
44Porting to MacOS is a bit more complex than it first seems. Which MacOS?
4568K/PowerPC? Which compiler? Each supports both 68K and PowerPC and offer a
46large number of (unique to each environment) compiler settings. Each
47combination of compiler/68K/PPC/settings require a unique combination of
48standard libraries. And the IDE's does not select them for you. They don't
49even check that the library is built with compatible setting and this is
50the major source of problems when porting the GC (and otherwise too).
51
52You will have to make choices when you configure the GC. I've made some
53choices here, but there are other combinations of settings and #defines
54that work too.
55
56As for target settings the major obstacles may be:
57- 68K Processor: check "4-byte Ints".
58- PPC Processor: uncheck "Store Static Data in TOC".
59
60What you need to do:
61===================
62
631) Build the GC as a library
642) Test that the library works with 'test.c'.
653) Test that the C++ interface 'gc_cpp.cc/h' works with 'test_cpp.cc'.
66
671) The Libraries:
68=================
69I made one project with four targets (68K/PPC tempmem or appheap). One target
70will suffice if you're able to decide which one you want. I wasn't...
71
72Codewarrior allows a large number of compiler/linker settings. I used these:
73
74Settings shared by all targets:
75------------------------------
76o Access Paths:
77  - User Paths:   the GC folder
78  - System Paths: {Compiler}:Metrowerks Standard Library:
79                  {Compiler}:MacOS Support:Headers:
80                  {Compiler}:MacOS Support:MacHeaders:
81o C/C++ language:
82  - inlining: normal
83  - direct to SOM: off
84  - enable/check: exceptions, RTTI, bool (and if you like pool strings)
85
86PowerPC target settings
87-----------------------
88o Target Settings:
89  - name of target
90  - MacOS PPC Linker
91o PPC Target
92  - name of library
93o C/C++ language
94  - prefix file as described below
95o PPC Processor
96  - Struct Alignment: PowerPC
97  - uncheck "Store Static Data in TOC" -- important!
98    I don't think the others matter, I use full optimization and its ok
99o PPC Linker
100  - Factory Settings (SYM file with full paths, faster linking, dead-strip
101    static init, Main: __start)
102
103
10468K target settings
105-------------------
106o Target Settings:
107  - name of target
108  - MacOS 68K Linker
109o 68K Target
110  - name of library
111  - A5 relative data
112o C/C++ language
113  - prefix file as described below
114o 68K Processor
115  - Code model: smart
116  - Struct alignment: 68K
117  - FP: SANE
118  - enable 4-Byte Ints -- important!
119    I don't think the others matter. I selected...
120  - enable: 68020
121  - enable: global register allocation
122o IR Optimizer
123  - enable: Optimize Space, Optimize Speed
124    I suppose the others would work too, but haven't tried...
125o 68K Linker
126  - Factory Settings (New Style MacsBug,SYM file with full paths,
127    A6 Frames, fast link, Merge compiler glue into segment 1,
128    dead-strip static init)
129
130Prefix Files to configure the GC sources
131----------------------------------------
132The Codewarrior equivalent of commandline compilers -DNAME=X is to use
133prefix-files. A TEXT file that is automatically #included before the first byte
134of every source file. I used these:
135
136---- ( cut here ) ----  gc_prefix_tempmem.h     -- 68K and PPC -----
137    #include "gc_prefix_common.h"
138    #undef USE_TEMPORARY_MEMORY
139    #define USE_TEMPORARY_MEMORY
140---- ( cut here ) ----  gc_prefix_appmem.h      -- 68K and PPC -----
141    #include "gc_prefix_common.h"
142    #undef USE_TEMPORARY_MEMORY
143//  #define USE_TEMPORARY_MEMORY
144
145---- ( cut here ) ----  gc_prefix_common.h      --------------------
146// gc_prefix_common.h
147// ------------------
148// Codewarrior prefix file to configure the GC libraries
149//
150//   prefix files are the Codewarrior equivalent of the
151//   command line option -Dname=x frequently seen in makefiles
152
153#if !__MWERKS__
154  #error only tried this with Codewarrior
155#endif
156
157#if macintosh
158  #define MSL_USE_PRECOMPILED_HEADERS 0
159  #include <ansi_prefix.mac.h>
160  #ifndef __STDC__
161    #define __STDC__ 0
162  #endif
163
164  //  See list of #defines to configure the library in: 'MakeFile'
165  //  see also README
166
167  #define SILENT                // no collection messages. In case
168                                // of trouble you might want this off
169  #define ALL_INTERIOR_POINTERS // follows interior pointers.
170//#define DONT_ADD_BYTE_AT_END  // disables the padding if defined.
171//#define SMALL_CONFIG          // whether to use a smaller heap.
172  #define NO_SIGNALS            // signals aren't real on the Macintosh.
173  #define ATOMIC_UNCOLLECTABLE  // GC_malloc_atomic_uncollectable()
174
175  // define either or none as per personal preference
176  //   used in malloc.c
177  #define REDIRECT_MALLOC GC_malloc
178//#define REDIRECT_MALLOC GC_malloc_uncollectable
179  // if REDIRECT_MALLOC is #defined make sure that the GC library
180  // is listed before the ANSI/ISO libs in the Codewarrior
181  // 'Link order' panel
182//#define IGNORE_FREE
183
184  // mac specific configs
185//#define USE_TEMPORARY_MEMORY    // use Macintosh temporary memory.
186//#define SHARED_LIBRARY_BUILD    // build for use in a shared library.
187
188#else
189  // could build Win32 here too, or in the future
190  // Rhapsody PPC-mach, Rhapsody PPC-MacOS,
191  // Rhapsody Intel-mach, Rhapsody Intel-Win32,...
192  // ... ugh this will get messy ...
193#endif
194
195// make sure ints are at least 32-bit
196// ( could be set to 16-bit by compiler settings (68K) )
197
198struct gc_private_assert_intsize_{ char x[ sizeof(int)>=4 ? 1 : 0 ]; };
199
200#if __powerc
201  #if __option(toc_data)
202    #error turn off "store static data in TOC" when using GC
203    //     ... or find a way to add TOC to the root set...(?)
204  #endif
205#endif
206---- ( cut here ) ----  end of gc_prefix_common.h  -----------------
207
208Files to  build the GC libraries:
209--------------------------------
210    allchblk.c
211    alloc.c
212    blacklst.c
213    checksums.c
214    dbg_mlc.c
215    finalize.c
216    headers.c
217    mach_dep.c
218    MacOS.c    -- contains MacOS code
219    malloc.c
220    mallocx.c
221    mark.c
222    mark_rts.c
223    misc.c
224    new_hblk.c
225    obj_map.c
226    os_dep.c   -- contains MacOS code
227    ptr_chck.c
228    reclaim.c
229    stubborn.c
230    typd_mlc.c
231    gc++.cc    -- this is 'gc_cpp.cc' with less 'inline' and
232               -- throw std::bad_alloc when out of memory
233               -- gc_cpp.cc works just fine too
234
2352) Test that the library works with 'test.c'.
236=============================================
237
238The test app is just an ordinary ANSI-C console app. Make sure settings
239match the library you're testing.
240
241Files
242-----
243    test.c
244    the GC library to test        -- link order before ANSI libs
245    suitable Mac+ANSI libraries
246
247prefix:
248------
249---- ( cut here ) ----  gc_prefix_testlib.h     -- all libs -----
250#define MSL_USE_PRECOMPILED_HEADERS 0
251#include <ansi_prefix.mac.h>
252#undef NDEBUG
253
254#define ALL_INTERIOR_POINTERS	/* for GC_priv.h */
255---- ( cut here ) ----
256
2573) Test that the C++ interface 'gc_cpp.cc/h' works with 'test_cpp.cc'.
258
259The test app is just an ordinary ANSI-C console app. Make sure settings match
260the library you're testing.
261
262Files
263-----
264    test_cpp.cc
265    the GC library to test        -- link order before ANSI libs
266    suitable Mac+ANSI libraries
267
268prefix:
269------
270same as for test.c
271
272For convenience I used one test-project with several targets so that all
273test apps are build at once. Two for each library to test: test.c and
274gc_app.cc. When I was satisfied that the libraries were ok. I put the
275libraries + gc.h + the c++ interface-file in a folder that I then put into
276the MSL hierarchy so that I don't have to alter access-paths in projects
277that use the GC.
278
279After that, just add the proper GC library to your project and the GC is in
280action! malloc will call GC_malloc and free GC_free, new/delete too. You
281don't have to call free or delete. You may have to be a bit cautious about
282delete if you're freeing other resources than RAM. See gc_cpp.h. You can
283also keep coding as always with delete/free. That works too. If you want,
284"include <gc.h> and tweak it's use a bit.
285
286Symantec SPM
287============
288It has been a while since I tried the GC in SPM, but I think that the above
289instructions should be sufficient to guide you through in SPM too. SPM
290needs to know where the global data is. Use the files 'datastart.c' and
291'dataend.c'. Put 'datastart.c' at the top of your project and 'dataend.c'
292at the bottom  of your project so that all data is surrounded. This is not
293needed in Codewarrior because it provides intrinsic variables
294__datastart__, __data_end__ that wraps all globals.
295
296Source Changes (GC 4.12a2)
297==========================
298Very few. Just one tiny in the GC, not strictly needed.
299- MacOS.c line 131 in routine GC_MacFreeTemporaryMemory()
300  change #       if !defined(SHARED_LIBRARY_BUILD)
301  to     #       if !defined(SILENT) && !defined(SHARED_LIBRARY_BUILD)
302  To turn off a message when the application quits (actually, I faked
303  this change by #defining SHARED_LIBRARY_BUILD in a statically linked
304  library for more than a year without ill effects but perhaps this is
305  better).
306
307- test_cpp.cc
308  made the first lines of main() look like this:
309  ------------
310  int main( int argc, char* argv[] ) {
311  #endif
312  #if macintosh                             // MacOS
313    char* argv_[] = {"test_cpp","10"};      //   doesn't
314    argv=argv_;                             //     have a
315    argc = sizeof(argv_)/sizeof(argv_[0]);  //       commandline
316  #endif                                    //
317
318  int i, iters, n;
319  # ifndef __GNUC__
320   alloc dummy_to_fool_the_compiler_into_doing_things_it_currently_cant_handle;
321  ------------
322
323- config.h [now gcconfig.h]
324  __MWERKS__ does not have to mean MACOS. You can use Codewarrior to
325  build a Win32 or BeOS library and soon a Rhapsody library. You may
326  have to change that #if...
327
328
329
330   It worked for me, hope it works for you.
331
332   Lars Farm
333   18 July 1997
334----------------------------------------------------------------------------
335
336
337Patrick Beard's instructions (may be dated):
338
339v4.3 of the collector now runs under Symantec C++/THINK C v7.0.4, and
340Metrowerks C/C++ v4.5 both 68K and PowerPC. Project files are provided
341to build and test the collector under both development systems.
342
343Configuration
344-------------
345
346To configure the collector, under both development systems, a prefix file
347is used to set preprocessor directives. This file is called "MacOS_config.h".
348Also to test the collector, "MacOS_Test_config.h" is provided.
349
350Testing
351-------
352
353To test the collector (always a good idea), build one of the gctest projects,
354gctest.� (Symantec C++/THINK C), mw/gctest.68K.�, or mw/gctest.PPC.�. The
355test will ask you how many times to run; 1 should be sufficient.
356
357Building
358--------
359
360For your convenience project files for the major Macintosh development
361systems are provided.
362
363For Symantec C++/THINK C, you must build the two projects gclib-1.� and
364gclib-2.�. It has to be split up because the collector has more than 32k
365of static data and no library can have more than this in the Symantec
366environment. (Future versions will probably fix this.)
367
368For Metrowerks C/C++ 4.5 you build gc.68K.�/gc.PPC.� and the result will
369be a library called gc.68K.lib/gc.PPC.lib.
370
371Using
372-----
373
374Under Symantec C++/THINK C, you can just add the gclib-1.� and gclib-2.�
375projects to your own project. Under Metrowerks, you add gc.68K.lib or
376gc.PPC.lib and two additional files. You add the files called datastart.c
377and dataend.c to your project, bracketing all files that use the collector.
378See mw/gctest.� for an example.
379
380Include the projects/libraries you built above into your own project,
381#include "gc.h", and call GC_malloc. You don't have to call GC_free.
382
383
384Patrick C. Beard
385January 4, 1995
386

README.MacOSX

1See README.darwin for the latest Darwin/MacOSX information.
2

README.OS2

1The code assumes static linking, and a single thread.  The editor de has
2not been ported.  The cord test program has.  The supplied OS2_MAKEFILE
3assumes the IBM C Set/2 environment, but the code shouldn't.
4
5Since we haven't figured out hoe to do perform partial links or to build static
6libraries, clients currently need to link against a long list of executables.
7

README.amiga

1===========================================================================
2            Kjetil S. Matheussen's notes (28-11-2000)
3===========================================================================
4Compiles under SAS/C again. Should allso still compile under other
5amiga compilers without big changes. I haven't checked if it still
6works under gcc, because I don't have gcc for amiga. But I have
7updated 'Makefile', and hope it compiles fine.
8
9
10WHATS NEW:
11
121.
13   Made a pretty big effort in preventing GCs allocating-functions from returning
14   chip-mem.
15
16   The lower part of the new file AmigaOS.c does this in various ways, mainly by
17   wrapping GC_malloc, GC_malloc_atomic, GC_malloc_uncollectable,
18   GC_malloc_atomic_uncollectable, GC_malloc_stubborn, GC_malloc_ignore_off_page
19   and GC_malloc_atomic_ignore_off_page. GC_realloc is allso wrapped, but
20   doesn't do the same effort in preventing to return chip-mem.
21   Other allocating-functions (f.ex. GC_*_typed_) can probably be
22   used without any problems, but beware that the warn hook will not be called.
23   In case of problems, don't define GC_AMIGA_FASTALLOC.
24
25   Programs using more time actually using the memory allocated
26   (instead of just allocate and free rapidly) have
27   the most to earn on this, but even gctest now normally runs twice
28   as fast and uses less memory, on my poor 8MB machine.
29
30   The changes have only effect when there is no more
31   fast-mem left. But with the way GC works, it
32   could happen quite often. Beware that an atexit handler had to be added,
33   so using the abort() function will make a big memory-loss.
34   If you absolutely must call abort() instead of exit(), try calling
35   the GC_amiga_free_all_mem function before abort().
36
37   New amiga-spesific compilation flags:
38
39   GC_AMIGA_FASTALLOC - By NOT defining this option, GC will work like before,
40                        it will not try to force fast-mem out of the OS, and
41                        it will use normal calloc for allocation, and the rest
42                        of the following flags will have no effect.
43
44   GC_AMIGA_ONLYFAST - Makes GC never to return chip-mem. GC_AMIGA_RETRY have
45                       no effect if this flag is set.
46
47   GC_AMIGA_GC - If gc returns NULL, do a GC_gcollect, and try again. This
48                 usually is a success with the standard GC configuration.
49                 It is allso the most important flag to set to prevent
50                 GC from returning chip-mem. Beware that it slows down a lot
51                 when a program is rapidly allocating/deallocating when
52                 theres either very little fast-memory left or verly little
53                 chip-memory left. Its not a very common situation, but gctest
54                 sometimes (very rare) use many minutes because of this.
55
56   GC_AMIGA_RETRY - If gc succeed allocating memory, but it is chip-mem,
57                    try again and see if it is fast-mem. Most of the time,
58                    it will actually return fast-mem for the second try.
59                    I have set max number of retries to 9 or size/5000. You
60                    can change this if you like. (see GC_amiga_rec_alloc())
61
62   GC_AMIGA_PRINTSTATS - Gather some statistics during the execution of a
63                         program, and prints out the info when the atexit-handler
64                         is called.
65
66   My reccomendation is to set all this flags, except GC_AMIGA_PRINTSTATS and
67   GC_AMIGA_ONLYFAST.
68
69   If your program demands high response-time, you should
70   not define GC_AMIGA_GC, and possible allso define GC_AMIGA_ONLYFAST.
71   GC_AMIGA_RETRY does not seem to slow down much.
72
73   Allso, when compiling up programs, and GC_AMIGA_FASTALLOC was not defined when
74   compilling gc, you can define GC_AMIGA_MAKINGLIB to avoid having these allocation-
75   functions wrapped. (see gc.h)
76
77   Note that GC_realloc must not be called before any of
78   the other above mentioned allocating-functions have been called. (shouldn't be
79   any programs doing so either, I hope).
80
81   Another note. The allocation-function is wrapped when defining
82   GC_AMIGA_FASTALLOC by letting the function go thru the new
83   GC_amiga_allocwrapper_do function-pointer (see gc.h). Means that
84   sending function-pointers, such as GC_malloc, GC_malloc_atomic, etc.,
85   for later to be called like f.ex this, (*GC_malloc_functionpointer)(size),
86   will not wrap the function. This is normally not a big problem, unless
87   all allocation function is called like this, which will cause the
88   atexit un-allocating function never to be called. Then you either
89   have to manually add the atexit handler, or call the allocation-
90   functions function-pointer functions like this;
91   (*GC_amiga_allocwrapper_do)(size,GC_malloc_functionpointer).
92   There are probably better ways this problem could be handled, unfortunately,
93   I didn't find any without rewriting or replacing a lot of the GC-code, which
94   I really didn't want to. (Making new GC_malloc_* functions, and just
95   define f.ex GC_malloc as GC_amiga_malloc should allso work).
96
97
98   New amiga-spesific function:
99
100     void GC_amiga_set_toany(void (*func)(void));
101
102   'func' is a function that will be called right before gc has to change
103   allocation-method from MEMF_FAST to MEMF_ANY. Ie. when it is likely
104   it will return chip-mem.
105
106
1072. A few small compiler-spesific additions to make it compile with SAS/C again.
108
1093. Updated and rewritten the smakefile, so that it works again and that
110   the "unnecesarry" 'SCOPTIONS' files could be removed. Allso included
111   the cord-smakefile stuff in the main smakefile, so that the cord smakefile
112   could be removed too. By writing smake -f Smakefile.smk, both gc.lib and
113   cord.lib will be made.
114
115
116
117STILL MISSING:
118
119Programs can not be started from workbench, at least not for SAS/C. (Martin
120Tauchmanns note about that it now works with workbench is definitely wrong
121when concerning SAS/C). I guess it works if you use the old "#if 0'ed"-code,
122but I haven't tested it. I think the reason for MT to replace the
123"#if 0'ed"-code was only because it was a bit to SAS/C-spesific. But I
124don't know. An iconx-script solves this problem anyway.
125
126
127BEWARE!
128
129-To run gctest, set the stack to around 200000 bytes first.
130-SAS/C-spesific: cord will crash if you compile gc.lib with
131 either parm=reg or parm=both. (missing legal prototypes for
132 function-pointers someplace is the reason I guess.).
133
134
135tested with software: Radium, http://www.stud.ifi.uio.no/~ksvalast/radium/
136
137tested with hardware: MC68060
138
139
140-ksvalast@ifi.uio.no
141
142
143===========================================================================
144			   Martin Tauchmann's notes		(1-Apr-99)
145===========================================================================
146
147Works now, also with the GNU-C compiler V2.7.2.1. <ftp://ftp.unina.it/pub/amiga/geekgadgets/amiga/m68k/snapshots/971125/amiga-bin/>
148Modify the `Makefile`
149CC=cc $(ABI_FLAG)
150to
151CC=gcc $(ABI_FLAG)
152
153TECHNICAL NOTES
154
155- `GC_get_stack_base()`, `GC_register_data_segments()` works now with every
156   C compiler; also Workbench.
157
158- Removed AMIGA_SKIP_SEG, but the Code-Segment must not be scanned by GC.
159
160
161PROBLEMS
162- When the Linker, does`t merge all Code-Segments to an single one. LD of GCC
163  do it always.
164
165- With ixemul.library V47.3, when an GC program launched from another program
166  (example: `Make` or `if_mach M68K AMIGA gctest`), `GC_register_data_segments()`
167  found the Segment-List of the caller program.
168  Can be fixed, if the run-time initialization code (for C programs, usually *crt0*)
169  support `__data` and `__bss`.
170
171- PowerPC Amiga currently not supported.
172
173- Dynamic libraries (dyn_load.c) not supported.
174
175
176TESTED WITH SOFTWARE
177
178`Optimized Oberon 2 C` (oo2c) <http://cognac.informatik.uni-kl.de/download/index.html>
179
180
181TESTED WITH HARDWARE
182
183MC68030
184
185
186CONTACT
187
188Please, contact me at <martintauchmann@bigfoot.com>, when you change the
189Amiga port. <http://martintauchmann.home.pages.de>
190
191===========================================================================
192			   Michel Schinz's notes
193===========================================================================
194WHO DID WHAT
195
196The original Amiga port was made by Jesper Peterson. I (Michel Schinz)
197modified it slightly to reflect the changes made in the new official
198distributions, and to take advantage of the new SAS/C 6.x features. I also
199created a makefile to compile the "cord" package (see the cord
200subdirectory).
201
202TECHNICAL NOTES
203
204In addition to Jesper's notes, I have the following to say:
205
206- Starting with version 4.3, gctest checks to see if the code segment is
207  added to the root set or not, and complains if it is. Previous versions
208  of this Amiga port added the code segment to the root set, so I tried to
209  fix that. The only problem is that, as far as I know, it is impossible to
210  know which segments are code segments and which are data segments (there
211  are indeed solutions to this problem, like scanning the program on disk
212  or patch the LoadSeg functions, but they are rather complicated). The
213  solution I have chosen (see os_dep.c) is to test whether the program
214  counter is in the segment we are about to add to the root set, and if it
215  is, to skip the segment. The problems are that this solution is rather
216  awkward and that it works only for one code segment. This means that if
217  your program has more than one code segment, all of them but one will be
218  added to the root set. This isn't a big problem in fact, since the
219  collector will continue to work correctly, but it may be slower.
220
221  Anyway, the code which decides whether to skip a segment or not can be
222  removed simply by not defining AMIGA_SKIP_SEG. But notice that if you do
223  so, gctest will complain (it will say that "GC_is_visible produced wrong
224  failure indication"). However, it may be useful if you happen to have
225  pointers stored in a code segment (you really shouldn't).
226
227  If anyone has a good solution to the problem of finding, when a program
228  is loaded in memory, whether a segment is a code or a data segment,
229  please let me know.
230
231PROBLEMS
232
233If you have any problem with this version, please contact me at
234schinz@alphanet.ch (but do *not* send long files, since we pay for
235every mail!).
236
237===========================================================================
238			  Jesper Peterson's notes
239===========================================================================
240
241ADDITIONAL NOTES FOR AMIGA PORT
242
243These notes assume some familiarity with Amiga internals.
244
245WHY I PORTED TO THE AMIGA
246
247The sole reason why I made this port was as a first step in getting
248the Sather(*) language on the Amiga. A port of this language will
249be done as soon as the Sather 1.0 sources are made available to me.
250Given this motivation, the garbage collection (GC) port is rather
251minimal.
252
253(*) For information on Sather read the comp.lang.sather newsgroup.
254
255LIMITATIONS
256
257This port assumes that the startup code linked with target programs
258is that supplied with SAS/C versions 6.0 or later. This allows
259assumptions to be made about where to find the stack base pointer
260and data segments when programs are run from WorkBench, as opposed
261to running from the CLI. The compiler dependent code is all in the
262GC_get_stack_base() and GC_register_data_segments() functions, but
263may spread as I add Amiga specific features.
264
265Given that SAS/C was assumed, the port is set up to be built with
266"smake" using the "SMakefile". Compiler options in "SCoptions" can
267be set with "scopts" program. Both "smake" and "scopts" are part of
268the SAS/C commercial development system.
269
270In keeping with the porting philosophy outlined above, this port
271will not behave well with Amiga specific code. Especially not inter-
272process comms via messages, and setting up public structures like
273Intuition objects or anything else in the system lists. For the
274time being the use of this library is limited to single threaded
275ANSI/POSIX  compliant or near-complient code. (ie. Stick to stdio
276for now). Given this limitation there is currently no mechanism for
277allocating "CHIP" or "PUBLIC" memory under the garbage collector.
278I'll add this after giving it considerable thought. The major
279problem is the entire physical address space may have to me scanned,
280since there is no telling who we may have passed memory to.
281
282If you allocate your own stack in client code, you will have to
283assign the pointer plus stack size to GC_stackbottom.
284
285The initial stack size of the target program can be compiled in by
286setting the __stack symbol (see SAS documentaion). It can be over-
287ridden from the CLI by running the AmigaDOS "stack" program, or from
288the WorkBench by setting the stack size in the tool types window.
289
290SAS/C COMPILER OPTIONS (SCoptions)
291
292You may wish to check the "CPU" code option is appropriate for your
293intended target system.
294
295Under no circumstances set the "StackExtend" code option in either
296compiling the library or *ANY* client code.
297
298All benign compiler warnings have been suppressed. These mainly
299involve lack of prototypes in the code, and dead assignments
300detected by the optimizer.
301
302THE GOOD NEWS
303
304The library as it stands is compatible with the GigaMem commercial
305virtual memory software, and probably similar PD software.
306
307The performance of "gctest" on an Amiga 2630 (68030 @ 25Mhz)
308compares favourably with an HP9000 with similar architecture (a 325
309with a 68030 I think).
310
311-----------------------------------------------------------------------
312
313The Amiga port has been brought to you by:
314
315Jesper Peterson.
316
317jep@mtiame.mtia.oz.au		(preferred, but 1 week turnaround)
318jep@orca1.vic.design.telecom.au (that's orca<one>, 1 day turnaround)
319
320At least one of these addresses should be around for a while, even
321though I don't work for either of the companies involved.
322
323

README.arm.cross

1From: Margaret Fleck
2
3Here's the key details of what worked for me, in case anyone else needs them.
4There may well be better ways to do some of this, but ....
5   -- Margaret
6
7
8The badge4 has a StrongArm-1110 processor and a StrongArm-1111 coprocessor.
9
10Assume that the garbage collector distribution is unpacked into /home/arm/gc6.0,
11which is visible to both the ARM machine and a linux desktop (e.g. via NFS mounting).
12
13Assume that you have a file /home/arm/config.site with contents something like the
14example attached below.  Notice that our local ARM toolchain lives in
15/skiff/local.
16
17Go to /home/arm/gc6.0 directory.  Do
18  CONFIG_SITE=/home/arm/config.site ./configure --target=arm-linux
19--prefix=/home/arm/gc6.0
20
21On your desktop, do:
22   make
23   make install
24The main garbage collector library should now be in ../gc6.0/lib/libgc.so.
25
26To test the garbage collector, first do the following on your desktop
27   make gctest
28   ./gctest
29Then do the following on the ARM machine
30   cd .libs
31   ./lt-gctest
32
33Do not try to do "make test" (the usual way of running the test
34program).  This does not work and seems to erase some of the important
35files.
36
37The gctest program claims to have succeeded.  Haven't run any further tests
38with it, though I'll be doing so in the near future.
39
40-------------------------------
41# config.site for configure
42
43# Modified from the one provided by Bradley D. LaRonde
44# Edited by Andrej Cedilnik <acedil1@csee.umbc.edu>
45# Used some of solutions by Tilman Vogel <Tilman.Vogel@web.de>
46# Ported for iPAQ Familiar by Oliver Kurth <oliver.kurth@innominate.com>
47# Further modified by Margaret Fleck for the badge4
48
49HOSTCC=gcc
50
51# Names of the cross-compilers
52CC=/skiff/local/bin/arm-linux-gcc
53CXX=/skiff/local/bin/arm-linux-gcc
54
55# The cross compiler specific options
56CFLAGS="-O2 -fno-exceptions"
57CXXFLAGS="-O2 -fno-exceptions"
58CPPFLAGS="-O2 -fno-exceptions"
59LDFLAGS=""
60
61# Some other programs
62AR=/skiff/local/bin/arm-linux-ar
63RANLIB=/skiff/local/bin/arm-linux-ranlib
64NM=/skiff/local/bin/arm-linux-nm
65ac_cv_path_NM=/skiff/local/bin/arm-linux-nm
66ac_cv_func_setpgrp_void=yes
67x_includes=/skiff/local/arm-linux/include/X11
68x_libraries=/skiff/local/arm-linux/lib/X11
69

README.autoconf

1As of GC6.0alpha8, we attempt to support GNU-style builds based on automake,
2autoconf and libtool.  This is based almost entirely on Tom Tromey's work
3with gcj.
4
5To build and install libraries use
6
7configure; make; make install
8
9The advantages of this process are:
10
111) It should eventually do a better job of automatically determining the
12right compiler to use, etc.  It probably already does in some cases.
13
142) It tries to automatically set a good set of default GC parameters for
15the platform (e.g. thread support).  It provides an easier way to configure
16some of the others.
17
183) It integrates better with other projects using a GNU-style build process.
19
204) It builds both dynamic and static libraries.
21
22The known disadvantages are:
23
241) The build scripts are much more complex and harder to debug (though largely
25standard).  I don't understand them all, and there's probably lots of redundant
26stuff.
27
282) It probably doesn't work on all Un*x-like platforms yet.  It probably will
29never work on the rest.
30
313) The scripts are not yet complete.  Some of the standard GNU targets don't
32yet work.  (Corrections/additions are very welcome.)
33
34The distribution should contain all files needed to run "configure" and "make",
35as well as the sources needed to regenerate the derived files.  (If I missed
36some, please let me know.)
37
38Note that the distribution comes with a "Makefile" which will be overwritten
39by "configure" with one that is not at all equiavelent to the original.  The
40distribution contains a copy of the original "Makefile" in "Makefile.direct".
41
42Important options to configure:
43
44  --prefix=PREFIX         install architecture-independent files in PREFIX
45                          [/usr/local]
46  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
47                          [same as prefix]
48  --enable-threads=TYPE   choose threading package
49  --enable-parallel-mark  parallelize marking and free list construction
50  --enable-full-debug	include full support for pointer backtracing etc.
51
52Unless --prefix is set (or --exec-prefix or one of the more obscure options),
53make install will install libgc.a and libgc.so in /usr/local/bin, which
54would typically require the "make install" to be run as root.
55
56Most commonly --enable-threads=posix or will be needed.  --enable-parallel-mark
57is recommended for multiprocessors if it is supported on the platform.
58
59
60

README.changes

1This is a rough history of garbage collector bugs and versions.
2
3This has been maintained with varying diligence over the years.
4
5I made an attempt to include recent contributors here.  I apologize for any
6omissions.
7
8-------------------------
9
10  Version 1.3 and immediately preceding versions contained spurious
11assembly language assignments to TMP_SP.  Only the assignment in the PC/RT
12code is necessary.  On other machines, with certain compiler options,
13the assignments can lead to an unsaved register being overwritten.
14Known to cause problems under SunOS 3.5 WITHOUT the -O option.  (With
15-O the compiler recognizes it as dead code.  It probably shouldn't,
16but that's another story.)
17
18  Version 1.4 and earlier versions used compile time determined values
19for the stack base.  This no longer works on Sun 3s, since Sun 3/80s use
20a different stack base.  We now use a straightforward heuristic on all
21machines on which it is known to work (incl. Sun 3s) and compile-time
22determined values for the rest.  There should really be library calls
23to determine such values.
24
25  Version 1.5 and earlier did not ensure 8 byte alignment for objects
26allocated on a sparc based machine.
27
28  Version 1.8 added ULTRIX support in gc_private.h.
29
30  Version 1.9 fixed a major bug in gc_realloc.
31
32  Version 2.0 introduced a consistent naming convention for collector
33routines and added support for registering dynamic library data segments
34in the standard mark_roots.c.  Most of the data structures were revamped.
35The treatment of interior pointers was completely changed.  Finalization
36was added.  Support for locking was added.  Object kinds were added.
37We added a black listing facility to avoid allocating at addresses known
38to occur as integers somewhere in the address space.  Much of this
39was accomplished by adapting ideas and code from the PCR collector.
40The test program was changed and expanded.
41
42  Version 2.1 was the first stable version since 1.9, and added support
43for PPCR.
44
45  Version 2.2 added debugging allocation, and fixed various bugs.  Among them:
46- GC_realloc could fail to extend the size of the object for certain large object sizes.
47- A blatant subscript range error in GC_printf, which unfortunately
48  wasn't exercised on machines with sufficient stack alignment constraints.
49- GC_register_displacement did the wrong thing if it was called after
50  any allocation had taken place.
51- The leak finding code would eventually break after 2048 byte
52  byte objects leaked.
53- interface.c didn't compile.
54- The heap size remained much too small for large stacks.
55- The stack clearing code behaved badly for large stacks, and perhaps
56  on HP/PA machines.
57
58  Version 2.3 added ALL_INTERIOR_POINTERS and fixed the following bugs:
59- Missing declaration of etext in the A/UX version.
60- Some PCR root-finding problems.
61- Blacklisting was not 100% effective, because the plausible future
62  heap bounds were being miscalculated.
63- GC_realloc didn't handle out-of-memory correctly.
64- GC_base could return a nonzero value for addresses inside free blocks.
65- test.c wasn't really thread safe, and could erroneously report failure
66  in a multithreaded environment.  (The locking primitives need to be
67  replaced for other threads packages.)
68- GC_CONS was thoroughly broken.
69- On a SPARC with dynamic linking, signals stayed diabled while the
70  client code was running.
71  (Thanks to Manuel Serrano at INRIA for reporting the last two.)
72
73  Version 2.4 added GC_free_space_divisor as a tuning knob, added
74  support for OS/2 and linux, and fixed the following bugs:
75- On machines with unaligned pointers (e.g. Sun 3), every 128th word could
76  fail to be considered for marking.
77- Dynamic_load.c erroneously added 4 bytes to the length of the data and
78  bss sections of the dynamic library.  This could result in a bad memory
79  reference if the actual length was a multiple of a page.  (Observed on
80  Sun 3.  Can probably also happen on a Sun 4.)
81  (Thanks to Robert Brazile for pointing out that the Sun 3 version
82  was broken.  Dynamic library handling is still broken on Sun 3s
83  under 4.1.1U1, but apparently not 4.1.1.  If you have such a machine,
84  use -Bstatic.)
85
86  Version 2.5 fixed the following bugs:
87- Removed an explicit call to exit(1)
88- Fixed calls to GC_printf and GC_err_printf, so the correct number of
89  arguments are always supplied.  The OS/2 C compiler gets confused if
90  the number of actuals and the number of formals differ.  (ANSI C
91  doesn't require this to work.  The ANSI sanctioned way of doing things
92  causes too many compatibility problems.)
93
94  Version 3.0  added generational/incremental collection and stubborn
95  objects.
96
97  Version 3.1 added the following features:
98- A workaround for a SunOS 4.X SPARC C compiler
99  misfeature that caused problems when the collector was turned into
100  a dynamic library.
101- A fix for a bug in GC_base that could result in a memory fault.
102- A fix for a performance bug (and several other misfeatures) pointed
103  out by Dave Detlefs and Al Dosser.
104- Use of dirty bit information for static data under Solaris 2.X.
105- DEC Alpha/OSF1 support (thanks to Al Dosser).
106- Incremental collection on more platforms.
107- A more refined heap expansion policy.  Less space usage by default.
108- Various minor enhancements to reduce space usage, and to reduce
109  the amount of memory scanned by the collector.
110- Uncollectable allocation without per object overhead.
111- More conscientious handling of out-of-memory conditions.
112- Fixed a bug in debugging stubborn allocation.
113- Fixed a bug that resulted in occasional erroneous reporting of smashed
114  objects with debugging allocation.
115- Fixed bogus leak reports of size 4096 blocks with FIND_LEAK.
116
117  Version 3.2 fixed a serious and not entirely repeatable bug in
118  the incremental collector.  It appeared only when dirty bit info
119  on the roots was available, which is normally only under Solaris.
120  It also added GC_general_register_disappearing_link, and some
121  testing code.  Interface.c disappeared.
122
123  Version 3.3 fixes several bugs and adds new ports:
124- PCR-specific bugs.
125- Missing locking in GC_free, redundant FASTUNLOCK
126  in GC_malloc_stubborn, and 2 bugs in
127  GC_unregister_disappearing_link.
128  All of the above were pointed out by Neil Sharman
129  (neil@cs.mu.oz.au).
130- Common symbols allocated by the SunOS4.X dynamic loader
131  were not included in the root set.
132- Bug in GC_finalize (reported by Brian Beuning and Al Dosser)
133- Merged Amiga port from Jesper Peterson (untested)
134- Merged NeXT port from Thomas Funke (significantly
135  modified and untested)
136
137  Version 3.4:
138- Fixed a performance bug in GC_realloc.
139- Updated the amiga port.
140- Added NetBSD and 386BSD ports.
141- Added cord library.
142- Added trivial performance enhancement for
143  ALL_INTERIOR_POINTERS.  (Don't scan last word.)
144
145  Version 3.5
146- Minor collections now mark from roots only once, if that
147  doesn't cause an excessive pause.
148- The stack clearing heuristic was refined to prevent anomalies
149  with very heavily recursive programs and sparse stacks.
150- Fixed a bug that prevented mark stack growth in some cases.
151  GC_objects_are_marked should be set to TRUE after a call
152  to GC_push_roots and as part of GC_push_marked, since
153  both can now set mark bits.  I think this is only a performance
154  bug, but I wouldn't bet on it.  It's certainly very hard to argue
155  that the old version was correct.
156- Fixed an incremental collection bug that prevented it from
157  working at all when HBLKSIZE != getpagesize()
158- Changed dynamic_loading.c to include gc_priv.h before testing
159  DYNAMIC_LOADING.  SunOS dynamic library scanning
160  must have been broken in 3.4.
161- Object size rounding now adapts to program behavior.
162- Added a workaround (provided by Manuel Serrano and
163  colleagues) to a long-standing SunOS 4.X (and 3.X?) ld bug
164  that I had incorrectly assumed to have been squished.
165  The collector was broken if the text segment size was within
166  32 bytes of a multiple of 8K bytes, and if the beginning of
167  the data segment contained interesting roots.  The workaround
168  assumes a demand-loadable executable.  The original may have
169  have "worked" in some other cases.
170- Added dynamic library support under IRIX5.
171- Added support for EMX under OS/2 (thanks to Ari Huttunen).
172
173Version 3.6:
174- fixed a bug in the mark stack growth code that was introduced
175  in 3.4.
176- fixed Makefile to work around DEC AXP compiler tail recursion
177  bug.
178
179Version 3.7:
180- Added a workaround for an HP/UX compiler bug.
181- Fixed another stack clearing performance bug.  Reworked
182  that code once more.
183
184Version 4.0:
185- Added support for Solaris threads (which was possible
186  only by reimplementing some fraction of Solaris threads,
187  since Sun doesn't currently make the thread debugging
188  interface available).
189- Added non-threads win32 and win32S support.
190- (Grudgingly, with suitable muttering of obscenities) renamed
191  files so that the collector distribution could live on a FAT
192  file system.  Files that are guaranteed to be useless on
193  a PC still have long names.  Gc_inline.h and gc_private.h
194  still exist, but now just include  gc_inl.h and gc_priv.h.
195- Fixed a really obscure bug in finalization that could cause
196  undetected mark stack overflows.  (I would be surprised if
197  any real code ever tickled this one.)
198- Changed finalization code to dynamically resize the hash
199  tables it maintains.  (This probably does not matter for well-
200  -written code.  It no doubt does for C++ code that overuses
201  destructors.)
202- Added typed allocation primitives.  Rewrote the marker to
203  accommodate them with more reasonable efficiency.  This
204  change should also speed up marking for GC_malloc allocated
205  objects a little.  See gc_typed.h for new primitives.
206- Improved debugging facilities slightly.  Allocation time
207  stack traces are now kept by default on SPARC/SUNOS4.
208  (Thanks to Scott Schwartz.)
209- Added better support for small heap applications.
210- Significantly extended cord package.  Fixed a bug in the
211  implementation of lazily read files.  Printf and friends now
212  have cord variants.  Cord traversals are a bit faster.
213- Made ALL_INTERIOR_POINTERS recognition the default.
214- Fixed de so that it can run in constant space, independent
215  of file size.  Added simple string searching to cords and de.
216- Added the Hull-Ellis C++ interface.
217- Added dynamic library support for OSF/1.
218  (Thanks to Al Dosser and Tim Bingham at DEC.)
219- Changed argument to GC_expand_hp to be expressed
220  in units of bytes instead of heap blocks.  (Necessary
221  since the heap block size now varies depending on
222  configuration.  The old version was never very clean.)
223- Added GC_get_heap_size().  The previous "equivalent"
224  was broken.
225- Restructured the Makefile a bit.
226
227Since version 4.0:
228- Changed finalization implementation to guarantee that
229  finalization procedures are called outside of the allocation
230  lock, making direct use of the interface a little less dangerous.
231  MAY BREAK EXISTING CLIENTS that assume finalizers
232  are protected by a lock.  Since there seem to be few multithreaded
233  clients that use finalization, this is hopefully not much of
234  a problem.
235- Fixed a gross bug in CORD_prev.
236- Fixed a bug in blacklst.c that could result in unbounded
237  heap growth during startup on machines that do not clear
238  memory obtained from the OS (e.g. win32S).
239- Ported de editor to win32/win32S.  (This is now the only
240  version with a mouse-sensitive UI.)
241- Added GC_malloc_ignore_off_page to allocate large arrays
242  in the presence of ALL_INTERIOR_POINTERS.
243- Changed GC_call_with_alloc_lock to not disable signals in
244  the single-threaded case.
245- Reduced retry count in GC_collect_or_expand for garbage
246  collecting when out of memory.
247- Made uncollectable allocations bypass black-listing, as they
248  should.
249- Fixed a bug in typed_test in test.c that could cause (legitimate)
250  GC crashes.
251- Fixed some potential synchronization problems in finalize.c
252- Fixed a real locking problem in typd_mlc.c.
253- Worked around an AIX 3.2 compiler feature that results in
254  out of bounds memory references.
255- Partially worked around an IRIX5.2 beta problem (which may
256  or may not persist to the final release).
257- Fixed a bug in the heap integrity checking code that could
258  result in explicitly deallocated objects being identified as
259  smashed.  Fixed a bug in the dbg_mlc stack saving code
260  that caused old argument pointers to be considered live.
261- Fixed a bug in CORD_ncmp (and hence CORD_str).
262- Repaired the OS2 port, which had suffered from bit rot
263  in 4.0.  Worked around what appears to be CSet/2 V1.0
264  optimizer bug.
265- Fixed a Makefile bug for target "c++".
266
267Since version 4.1:
268- Multiple bug fixes/workarounds in the Solaris threads version.
269  (It occasionally failed to locate some register contents for
270  marking.  It also turns out that thr_suspend and friends are
271  unreliable in Solaris 2.3.  Dirty bit reads appear
272  to be unreliable under some weird
273  circumstances.  My stack marking code
274  contained a serious performance bug.  The new code is
275  extremely defensive, and has not failed in several cpu
276  hours of testing.  But  no guarantees ...)
277- Added MacOS support (thanks to Patrick Beard.)
278- Fixed several syntactic bugs in gc_c++.h and friends.  (These
279  didn't bother g++, but did bother most other compilers.)
280  Fixed gc_c++.h finalization interface.  (It didn't.)
281- 64 bit alignment for allocated objects was not guaranteed in a
282  few cases in which it should have been.
283- Added GC_malloc_atomic_ignore_off_page.
284- Added GC_collect_a_little.
285- Added some prototypes to gc.h.
286- Some other minor bug fixes (notably in Makefile).
287- Fixed OS/2 / EMX port (thanks to Ari Huttunen).
288- Fixed AmigaDOS port. (thanks to Michel Schinz).
289- Fixed the DATASTART definition under Solaris.  There
290  was a 1 in 16K chance of the collector missing the first
291  64K of static data (and thus crashing).
292- Fixed some blatant anachronisms in the README file.
293- Fixed PCR-Makefile for upcoming PPCR release.
294
295Since version 4.2:
296- Fixed SPARC alignment problem with GC_DEBUG.
297- Fixed Solaris threads /proc workaround.  The real
298  problem was an interaction with mprotect.
299- Incorporated fix from Patrick Beard for gc_c++.h (now gc_cpp.h).
300- Slightly improved allocator space utilization by
301  fixing the GC_size_map mechanism.
302- Integrated some Sony News and MIPS RISCos 4.51
303  patches.  (Thanks to Nobuyuki Hikichi of
304  Software Research Associates, Inc. Japan)
305- Fixed HP_PA alignment problem.  (Thanks to
306  xjam@cork.cs.berkeley.edu.)
307- Added GC_same_obj and friends.  Changed GC_base
308  to return 0 for pointers past the end of large objects.
309  Improved GC_base performance with ALL_INTERIOR_POINTERS
310  on machines with a slow integer mod operation.
311  Added GC_PTR_ADD, GC_PTR_STORE, etc. to prepare
312  for preprocessor.
313- changed the default on most UNIX machines to be that
314  signals are not disabled during critical GC operations.
315  This is still ANSI-conforming, though somewhat dangerous
316  in the presence of signal handlers. But the performance
317  cost of the alternative is sometimes problematic.
318  Can be changed back with a minor Makefile edit.
319- renamed IS_STRING in gc.h, to CORD_IS_STRING, thus
320  following my own naming convention.  Added the function
321  CORD_to_const_char_star.
322- Fixed a gross bug in GC_finalize.  Symptom: occasional
323  address faults in that function.  (Thanks to Anselm
324  Baird-Smith (Anselm.BairdSmith@inria.fr)
325- Added port to ICL DRS6000 running DRS/NX.  Restructured
326  things a bit to factor out common code, and remove obsolete
327  code.  Collector should now run under SUNOS5 with either
328  mprotect or /proc dirty bits.  (Thanks to Douglas Steel
329  (doug@wg.icl.co.uk)).
330- More bug fixes and workarounds for Solaris 2.X.  (These were
331  mostly related to putting the collector in a dynamic library,
332  which didn't really work before.  Also SOLARIS_THREADS
333  didn't interact well with dl_open.)  Thanks to btlewis@eng.sun.com.
334- Fixed a serious performance bug on the DEC Alpha.  The text
335  segment was getting registered as part of the root set.
336  (Amazingly, the result was still fast enough that the bug
337  was not conspicuous.) The fix works on OSF/1, version 1.3.
338  Hopefully it also works on other versions of OSF/1 ...
339- Fixed a bug in GC_clear_roots.
340- Fixed a bug in GC_generic_malloc_words_small that broke
341  gc_inl.h.  (Reported by Antoine de Maricourt.  I broke it
342  in trying to tweak the Mac port.)
343- Fixed some problems with cord/de under Linux.
344- Fixed some cord problems, notably with CORD_riter4.
345- Added DG/UX port.
346  Thanks to Ben A. Mesander (ben@piglet.cr.usgs.gov)
347- Added finalization registration routines with weaker ordering
348  constraints.  (This is necessary for C++ finalization with
349  multiple inheritance, since the compiler often adds self-cycles.)
350- Filled the holes in the SCO port. (Thanks to Michael Arnoldus
351  <chime@proinf.dk>.)
352- John Ellis' additions to the C++ support:  From John:
353
354* I completely rewrote the documentation in the interface gc_c++.h
355(later renamed gc_cpp.h).  I've tried to make it both clearer and more
356precise.
357
358* The definition of accessibility now ignores pointers from an
359finalizable object (an object with a clean-up function) to itself.
360This allows objects with virtual base classes to be finalizable by the
361collector.  Compilers typically implement virtual base classes using
362pointers from an object to itself, which under the old definition of
363accessibility prevented objects with virtual base classes from ever
364being collected or finalized.
365
366* gc_cleanup now includes gc as a virtual base.  This was enabled by
367the change in the definition of accessibility.
368
369* I added support for operator new[].  Since most (all?) compilers
370don't yet support operator new[], it is conditionalized on
371-DOPERATOR_NEW_ARRAY.  The code is untested, but its trivial and looks
372correct.
373
374* The test program test_gc_c++ (later renamed test_cpp.cc)
375tries to test for the C++-specific functionality not tested by the
376other programs.
377- Added <unistd.h> include to misc.c.  (Needed for ppcr.)
378- Added PowerMac port. (Thanks to Patrick Beard again.)
379- Fixed "srcdir"-related Makefile problems.  Changed things so
380  that all externally visible include files always appear in the
381  include subdirectory of the source.  Made gc.h directly
382  includable from C++ code.  (These were at Per
383  Bothner's suggestion.)
384- Changed Intel code to also mark from ebp (Kevin Warne's
385  suggestion).
386- Renamed C++ related files so they could live in a FAT
387  file system. (Charles Fiterman's suggestion.)
388- Changed Windows NT Makefile to include C++ support in
389  gc.lib.  Added C++ test as Makefile target.
390
391Since version 4.3:
392 - ASM_CLEAR_CODE was erroneously defined for HP
393   PA machines, resulting in a compile error.
394 - Fixed OS/2 Makefile to create a library.  (Thanks to
395   Mark Boulter (mboulter@vnet.ibm.com)).
396 - Gc_cleanup objects didn't work if they were created on
397   the stack.  Fixed.
398 - One copy of Gc_cpp.h in the distribution was out of
399   synch, and failed to document some known compiler
400   problems with explicit destructor invocation.  Partially
401   fixed.  There are probably other compilers on which
402   gc_cleanup is miscompiled.
403 - Fixed Makefile to pass C compiler flags to C++ compiler.
404 - Added Mac fixes.
405 - Fixed os_dep.c to work around what appears to be
406   a new and different VirtualQuery bug under newer
407   versions of win32S.
408 - GC_non_gc_bytes was not correctly maintained by
409   GC_free.  Fixed.  Thanks to James Clark (jjc@jclark.com).
410 - Added GC_set_max_heap_size.
411 - Changed allocation code to ignore blacklisting if it is preventing
412   use of a very large block of memory.  This has the advantage
413   that naive code allocating very large objects is much more
414   likely to work.  The downside is you might no
415   longer find out that such code should really use
416   GC_malloc_ignore_off_page.
417 - Changed GC_printf under win32 to close and reopen the file
418   between calls.  FAT file systems otherwise make the log file
419   useless for debugging.
420 - Added GC_try_to_collect and GC_get_bytes_since_gc.  These
421   allow starting an abortable collection during idle times.
422   This facility does not require special OS support.  (Thanks to
423   Michael Spertus of Geodesic Systems for suggesting this.  It was
424   actually an easy addition.  Kumar Srikantan previously added a similar
425   facility to a now ancient version of the collector.  At the time
426   this was much harder, and the result was less convincing.)
427 - Added some support for the Borland development environment.  (Thanks
428   to John Ellis and Michael Spertus.)
429 - Removed a misfeature from checksums.c that caused unexpected
430   heap growth.  (Thanks to Scott Schwartz.)
431 - Changed finalize.c to call WARN if it encounters a finalization cycle.
432   WARN is defined in gc_priv.h to write a message, usually to stdout.
433   In many environments, this may be inappropriate.
434 - Renamed NO_PARAMS in gc.h to GC_NO_PARAMS, thus adhering to my own
435   naming convention.
436 - Added GC_set_warn_proc to intercept warnings.
437 - Fixed Amiga port. (Thanks to Michel Schinz (schinz@alphanet.ch).)
438 - Fixed a bug in mark.c that could result in an access to unmapped
439   memory from GC_mark_from_mark_stack on machines with unaligned
440   pointers.
441 - Fixed a win32 specific performance bug that could result in scanning of
442   objects allocated with the system malloc.
443 - Added REDIRECT_MALLOC.
444
445Since version 4.4:
446 - Fixed many minor and one major README bugs. (Thanks to Franklin Chen
447   (chen@adi.com) for pointing out many of them.)
448 - Fixed ALPHA/OSF/1 dynamic library support. (Thanks to Jonathan Bachrach
449   (jonathan@harlequin.com)).
450 - Added incremental GC support (MPROTECT_VDB) for Linux (with some
451   help from Bruno Haible).
452 - Altered SPARC recognition tests in gc.h and config.h (mostly as
453   suggested by Fergus Henderson).
454 - Added basic incremental GC support for win32, as implemented by
455   Windows NT and Windows 95.  GC_enable_incremental is a noop
456   under win32s, which doesn't implement enough of the VM interface.
457 - Added -DLARGE_CONFIG.
458 - Fixed GC_..._ignore_off_page to also function without
459   -DALL_INTERIOR_POINTERS.
460 - (Hopefully) fixed RS/6000 port.  (Only the test was broken.)
461 - Fixed a performance bug in the nonincremental collector running
462   on machines supporting incremental collection with MPROTECT_VDB
463   (e.g. SunOS 4, DEC AXP).  This turned into a correctness bug under
464   win32s with win32 incremental collection.  (Not all memory protection
465   was disabled.)
466 - Fixed some ppcr related bit rot.
467 - Caused dynamic libraries to be unregistered before reregistering.
468   The old way turned out to be a performance bug on some machines.
469 - GC_root_size was not properly maintained under MSWIN32.
470 - Added -DNO_DEBUGGING and GC_dump.
471 - Fixed a couple of bugs arising with SOLARIS_THREADS +
472   REDIRECT_MALLOC.
473 - Added NetBSD/M68K port.  (Thanks to Peter Seebach
474   <seebs@taniemarie.solon.com>.)
475 - Fixed a serious realloc bug.  For certain object sizes, the collector
476   wouldn't scan the expanded part of the object.  (Thanks to Clay Spence
477   (cds@peanut.sarnoff.com) for noticing the problem, and helping me to
478   track it down.)
479
480Since version 4.5:
481 - Added Linux ELF support.  (Thanks to Arrigo Triulzi <arrigo@ic.ac.uk>.)
482 - GC_base crashed if it was called before any other GC_ routines.
483   This could happen if a gc_cleanup object was allocated outside the heap
484   before any heap allocation.
485 - The heap expansion heuristic was not stable if all objects had finalization
486   enabled.  Fixed finalize.c to count memory in finalization queue and
487   avoid explicit deallocation.  Changed alloc.c to also consider this count.
488   (This is still not recommended.  It's expensive if nothing else.)  Thanks
489   to John Ellis for pointing this out.
490 - GC_malloc_uncollectable(0) was broken.  Thanks to Phong Vo for pointing
491   this out.
492 - The collector didn't compile under Linux 1.3.X.  (Thanks to Fred Gilham for
493   pointing this out.)  The current workaround is ugly, but expected to be
494   temporary.
495 - Fixed a formatting problem for SPARC stack traces.
496 - Fixed some '=='s in os_dep.c that should have been assignments.
497   Fortunately these were in code that should never be executed anyway.
498   (Thanks to Fergus Henderson.)
499 - Fixed the heap block allocator to only drop blacklisted blocks in small
500   chunks.  Made BL_LIMIT self adjusting.  (Both of these were in response
501   to heap growth observed by Paul Graham.)
502 - Fixed the Metrowerks/68K Mac code to also mark from a6.  (Thanks
503   to Patrick Beard.)
504 - Significantly updated README.debugging.
505 - Fixed some problems with longjmps out of signal handlers, especially under
506   Solaris.  Added a workaround for the fact that siglongjmp doesn't appear to
507   do the right thing with -lthread under Solaris.
508 - Added MSDOS/djgpp port.  (Thanks to Mitch Harris  (maharri@uiuc.edu).)
509 - Added "make reserved_namespace" and "make user_namespace".  The
510   first renames ALL "GC_xxx" identifiers as "_GC_xxx".  The second is the
511   inverse transformation.  Note that doing this is guaranteed to break all
512   clients written for the other names.
513 - descriptor field for kind NORMAL in GC_obj_kinds with ADD_BYTE_AT_END
514   defined should be -ALIGNMENT not WORDS_TO_BYTES(-1).  This is
515   a serious bug on machines with pointer alignment of less than a word.
516 - GC_ignore_self_finalize_mark_proc didn't handle pointers to very near the
517   end of the object correctly.  Caused failures of the C++ test on a DEC Alpha
518   with g++.
519 - gc_inl.h still had problems.  Partially fixed.  Added warnings at the
520   beginning to hopefully specify the remaining dangers.
521 - Added DATAEND definition to config.h.
522 - Fixed some of the .h file organization.  Fixed "make floppy".
523
524Since version 4.6:
525 - Fixed some compilation problems with -DCHECKSUMS (thanks to Ian Searle)
526 - Updated some Mac specific files to synchronize with Patrick Beard.
527 - Fixed a serious bug for machines with non-word-aligned pointers.
528   (Thanks to Patrick Beard for pointing out the problem.  The collector
529   should fail almost any conceivable test immediately on such machines.)
530
531Since version 4.7:
532 - Changed a "comment" in a MacOS specific part of mach-dep.c that caused
533   gcc to fail on other platforms.
534
535Since version 4.8
536 - More README.debugging fixes.
537 - Objects ready for finalization, but not finalized in the same GC
538   cycle, could be prematurely collected.  This occasionally happened
539   in test_cpp.
540 - Too little memory was obtained from the system for very large
541   objects.  That could cause a heap explosion if these objects were
542   not contiguous (e.g. under PCR), and too much of them was blacklisted.
543 - Due to an improper initialization, the collector was too hesitant to
544   allocate blacklisted objects immediately after system startup.
545 - Moved GC_arrays from the data into the bss segment by not explicitly
546   initializing it to zero.  This significantly
547   reduces the size of executables, and probably avoids some disk accesses
548   on program startup.  It's conceivable that it might break a port that I
549   didn't test.
550 - Fixed EMX_MAKEFILE to reflect the gc_c++.h to gc_cpp.h renaming which
551   occurred a while ago.
552
553Since 4.9:
554 - Fixed a typo around a call to GC_collect_or_expand in alloc.c.  It broke
555   handling of out of memory.  (Thanks to Patrick Beard for noticing.)
556
557Since 4.10:
558 - Rationalized (hopefully) GC_try_to_collect in an incremental collection
559   environment.  It appeared to not handle a call while a collection was in
560   progress, and was otherwise too conservative.
561 - Merged GC_reclaim_or_delete_all into GC_reclaim_all to get rid of some
562   code.
563 - Added Patrick Beard's Mac fixes, with substantial completely untested
564   modifications.
565 - Fixed the MPROTECT_VDB code to deal with large pages and imprecise
566   fault addresses (as on an UltraSPARC running Solaris 2.5).  Note that this
567   was not a problem in the default configuration, which uses PROC_VDB.
568 - The DEC Alpha assembly code needed to restore $gp between calls.
569   Thanks to Fergus Henderson for tracking this down and supplying a
570   patch.
571 - The write command for "de" was completely broken for large files.
572   I used the easiest portable fix, which involved changing the semantics
573   so that f.new is written instead of overwriting f.  That's safer anyway.
574 - Added README.solaris2 with a discussion of the possible problems of
575   mixing the collector's sbrk allocation with malloc/realloc.
576 - Changed the data segment starting address for SGI machines.  The
577   old code failed under IRIX6.
578 - Required double word alignment for MIPS.
579 - Various minor fixes to remove warnings.
580 - Attempted to fix some Solaris threads problems reported by Zhiying Chen.
581   In particular, the collector could try to fork a thread with the
582   world stopped as part of GC_thr_init.  It also failed to deal with
583   the case in which the original thread terminated before the whole
584   process did.
585 - Added -DNO_EXECUTE_PERMISSION.  This has a major performance impact
586   on the incremental collector under Irix, and perhaps under other
587   operating systems.
588 - Added some code to support allocating the heap with mmap.  This may
589   be preferable under some circumstances.
590 - Integrated dynamic library support for HP.
591   (Thanks to Knut Tvedten <knuttv@ifi.uio.no>.)
592 - Integrated James Clark's win32 threads support, and made a number
593   of changes to it, many of which were suggested by Pontus Rydin.
594   This is still not 100% solid.
595 - Integrated Alistair Crooks' support for UTS4 running on an Amdahl
596   370-class machine.
597 - Fixed a serious bug in explicitly typed allocation.  Objects requiring
598   large descriptors where handled in a way that usually resulted in
599   a segmentation fault in the marker.  (Thanks to Jeremy Fitzhardinge
600   for helping to track this down.)
601 - Added partial support for GNU win32 development.  (Thanks to Fergus
602   Henderson.)
603 - Added optional support for Java-style finalization semantics.  (Thanks
604   to Patrick Bridges.)  This is recommended only for Java implementations.
605 - GC_malloc_uncollectable faulted instead of returning 0 when out of
606   memory.  (Thanks to dan@math.uiuc.edu for noticing.)
607 - Calls to GC_base before the collector was initialized failed on a
608   DEC Alpha.  (Thanks to Matthew Flatt.)
609 - Added base pointer checking to GC_REGISTER_FINALIZER in debugging
610   mode, at the suggestion of Jeremy Fitzhardinge.
611 - GC_debug_realloc failed for uncollectable objects.  (Thanks to
612   Jeremy Fitzhardinge.)
613 - Explicitly typed allocation could crash if it ran out of memory.
614   (Thanks to Jeremy Fitzhardinge.)
615 - Added minimal support for a DEC Alpha running Linux.
616 - Fixed a problem with allocation of objects whose size overflowed
617   ptrdiff_t.  (This now fails unconditionally, as it should.)
618 - Added the beginning of Irix pthread support.
619 - Integrated Xiaokun Zhu's fixes for djgpp 2.01.
620 - Added SGI-style STL allocator support (gc_alloc.h).
621 - Fixed a serious bug in README.solaris2.  Multithreaded programs must include
622   gc.h with SOLARIS_THREADS defined.
623 - Changed GC_free so it actually deallocates uncollectable objects.
624   (Thanks to Peter Chubb for pointing out the problem.)
625 - Added Linux ELF support for dynamic libararies.  (Thanks again to
626   Patrick Bridges.)
627 - Changed the Borland cc configuration so that the assembler is not
628   required.
629 - Fixed a bug in the C++ test that caused it to fail in 64-bit
630   environments.
631
632Since 4.11:
633 - Fixed ElfW definition in dyn_load.c. (Thanks to Fergus Henderson.)
634   This prevented the dynamic library support from compiling on some
635   older ELF Linux systems.
636 - Fixed UTS4 port (which I apparently mangled during the integration)
637   (Thanks to again to Alistair Crooks.)
638 - "Make C++" failed on Suns with SC4.0, due to a problem with "bool".
639   Fixed in gc_priv.h.
640 - Added more pieces for GNU win32.  (Thanks to Timothy N. Newsham.)
641   The current state of things should suffice for at least some
642   applications.
643 - Changed the out of memory retry count handling as suggested by
644   Kenjiro Taura.  (This matters only if GC_max_retries > 0, which
645   is no longer the default.)
646 - If a /proc read failed repeatedly, GC_written_pages was not updated
647   correctly.  (Thanks to Peter Chubb for diagnosing this.)
648 - Under unlikely circumstances, the allocator could infinite loop in
649   an out of memory situation.  (Thanks again to Kenjiro Taura for
650   identifying the problem and supplying a fix.)
651 - Fixed a syntactic error in the DJGPP code.  (Thanks to Fergus
652   Henderson for finding this by inspection.)  Also fixed a test program
653   problem with DJGPP (Thanks to Peter Monks.)
654 - Atomic uncollectable objects were not treated correctly by the
655   incremental collector.  This resulted in weird log statistics and
656   occasional performance problems.  (Thanks to Peter Chubb for pointing
657   this out.)
658 - Fixed some problems resulting from compilers that dont define
659   __STDC__.  In this case void * and char * were used inconsistently
660   in some cases.  (Void * should not have been used at all.  If
661   you have an ANSI superset compiler that does not define __STDC__,
662   please compile with -D__STDC__=0. Thanks to Manuel Serrano and others
663   for pointing out the problem.)
664 - Fixed a compilation problem on Irix with -n32 and -DIRIX_THREADS.
665   Also fixed some other IRIX_THREADS problems which may or may not have
666   had observable symptoms.
667 - Fixed an HP PA compilation problem in dyn_load.c.  (Thanks to
668   Philippe Queinnec.)
669 - SEGV fault handlers sometimes did not get reset correctly.  (Thanks
670   to David Pickens.)
671 - Added a fix for SOLARIS_THREADS on Intel.  (Thanks again to David
672   Pickens.)  This probably needs more work to become functional.
673 - Fixed struct sigcontext_struct in os_dep.c for compilation under
674   Linux 2.1.X.	(Thanks to Fergus Henderson.)
675 - Changed the DJGPP STACKBOTTOM and DATASTART values to those suggested
676   by Kristian Kristensen.  These may still not be right, but it is
677   it is likely to work more often than what was there before.  They may
678   even be exactly right.
679 - Added a #include <string.h> to test_cpp.cc.  This appears to help
680   with HP/UX and gcc.  (Thanks to assar@sics.se.)
681 - Version 4.11 failed to run in incremental mode on recent 64-bit Irix
682   kernels.  This was a problem related to page unaligned heap segments.
683   Changed the code to page align heap sections on all platforms.
684   (I had mistakenly identified this as a kernel problem earlier.
685   It was not.)
686 - Version 4.11 did not make allocated storage executable, except on
687   one or two platforms, due to a bug in a #if test.  (Thanks to Dave
688   Grove for pointing this out.)
689 - Added sparc_sunos4_mach_dep.s to support Sun's compilers under SunOS4.
690 - Added GC_exclude_static_roots.
691 - Fixed the object size mapping algorithm.  This shouldn't matter,
692   but the old code was ugly.
693 - Heap checking code could die if one of the allocated objects was
694   larger than its base address.  (Unsigned underflow problem.  Thanks
695   to Clay Spence for isolating the problem.)
696 - Added RS6000 (AIX) dynamic library support and fixed STACK_BOTTOM.
697   (Thanks to Fred Stearns.)
698 - Added Fergus Henderson's patches for improved robustness with large
699   heaps and lots of blacklisting.
700 - Added Peter Chubb's changes to support Solaris Pthreads, to support
701   MMAP allocation in Solaris, to allow Solaris to find dynamic libraries
702   through /proc, to add malloc_typed_ignore_off_page, and a few other
703   minor features and bug fixes.
704 - The Solaris 2 port should not use sbrk.  I received confirmation from
705   Sun that the use of sbrk and malloc in the same program is not
706   supported.  The collector now defines USE_MMAP by default on Solaris.
707 - Replaced the djgpp makefile with Gary Leavens' version.
708 - Fixed MSWIN32 detection test.
709 - Added Fergus Henderson's patches to allow putting the collector into
710   a DLL under GNU win32.
711 - Added Ivan V. Demakov's port to Watcom C on X86.
712 - Added Ian Piumarta's Linux/PowerPC port.
713 - On Brian Burton's suggestion added PointerFreeGC to the placement
714   options in gc_cpp.h.  This is of course unsafe, and may be controversial.
715   On the other hand, it seems to be needed often enough that it's worth
716   adding as a standard facility.
717
718Since 4.12:
719 - Fixed a crucial bug in the Watcom port.  There was a redundant decl
720   of GC_push_one in gc_priv.h.
721 - Added FINALIZE_ON_DEMAND.
722 - Fixed some pre-ANSI cc problems in test.c.
723 - Removed getpagesize() use for Solaris.  It seems to be missing in one
724   or two versions.
725 - Fixed bool handling for SPARCCompiler version 4.2.
726 - Fixed some files in include that had gotten unlinked from the main
727   copy.
728 - Some RS/6000 fixes (missing casts).  Thanks to Toralf Foerster.
729 - Fixed several problems in GC_debug_realloc, affecting mostly the
730   FIND_LEAK case.
731 - GC_exclude_static_roots contained a buggy unsigned comparison to
732   terminate a loop.  (Thanks to Wilson Ho.)
733 - CORD_str failed if the substring occurred at the last possible position.
734   (Only affects cord users.)
735 - Fixed Linux code to deal with RedHat 5.0 and integrated Peter Bigot's
736   os_dep.c code for dealing with various Linux versions.
737 - Added workaround for Irix pthreads sigaction bug and possible signal
738   misdirection problems.
739Since alpha1:
740 - Changed RS6000 STACKBOTTOM.
741 - Integrated Patrick Beard's Mac changes.
742 - Alpha1 didn't compile on Irix m.n, m < 6.
743 - Replaced Makefile.dj with a new one from Gary Leavens.
744 - Added Andrew Stitcher's changes to support SCO OpenServer.
745 - Added PRINT_BLACK_LIST, to allow debugging of high densities of false
746   pointers.
747 - Added code to debug allocator to keep track of return address
748   in GC_malloc caller, thus giving a bit more context.
749 - Changed default behavior of large block allocator to more
750   aggressively avoid fragmentation.  This is likely to slow down the
751   collector when it succeeds at reducing space cost.
752 - Integrated Fergus Henderson's CYGWIN32 changes.  They are untested,
753   but needed for newer versions.
754 - USE_MMAP had some serious bugs.  This caused the collector to fail
755   consistently on Solaris with -DSMALL_CONFIG.
756 - Added Linux threads support, thanks largely to Fergus Henderson.
757Since alpha2:
758 - Fixed more Linux threads problems.
759 - Changed default GC_free_space_divisor to 3 with new large block allocation.
760   (Thanks to Matthew Flatt for some measurements that suggest the old
761   value sometimes favors space too much over time.)
762 - More CYGWIN32 fixes.
763 - Integrated Tyson-Dowd's Linux-M68K port.
764 - Minor HP PA and DEC UNIX fixes from Fergus Henderson.
765 - Integrated Christoffe Raffali's Linux-SPARC changes.
766 - Allowed for one more GC fixup iteration after a full GC in incremental
767   mode.  Some quick measurements suggested that this significantly
768   reduces pause times even with smaller GC_RATE values.
769 - Moved some more GC data structures into GC_arrays.  This decreases
770   pause times and GC overhead, but makes debugging slightly less convenient.
771 - Fixed namespace pollution problem ("excl_table").
772 - Made GC_incremental a constant for -DSMALL_CONFIG, hopefully shrinking
773   that slightly.
774 - Added some win32 threads fixes.
775 - Integrated Ivan Demakov and David Stes' Watcom fixes.
776 - Various other minor fixes contributed by many people.
777 - Renamed config.h to gcconfig.h, since config.h tends to be used for
778   many other things.
779 - Integrated Matthew Flatt's support for 68K MacOS "far globals".
780 - Fixed up some of the dynamic library Makefile targets for consistency
781   across platforms.
782 - Fixed a USE_MMAP typo that caused out-of-memory handling to fail
783   on Solaris.
784 - Added code to test.c to test thread creation a bit more.
785 - Integrated GC_win32_free_heap, as suggested by Ivan Demakov.
786 - Fixed Solaris 2.7 stack base finding problem.  (This may actually
787   have been done in an earlier alpha release.)
788Since alpha3:
789 - Fixed MSWIN32 recognition test, which interfered with cygwin.
790 - Removed unnecessary gc_watcom.asm from distribution.  Removed
791   some obsolete README.win32 text.
792 - Added Alpha Linux incremental GC support.  (Thanks to Philipp Tomsich
793   for code for retrieving the fault address in a signal handler.)
794   Changed Linux signal handler context argument to be a pointer.
795 - Took care of some new warnings generated by the 7.3 SGI compiler.
796 - Integrated Phillip Musumeci's FreeBSD/ELF fixes.
797 - -DIRIX_THREADS was broken with the -o32 ABI (typo in gc_priv.h>
798
799Since 4.13:
800 - Fixed GC_print_source_ptr to not use a prototype.
801 - generalized CYGWIN test.
802 - gc::new did the wrong thing with PointerFreeGC placement.
803   (Thanks to Rauli Ruohonen.)
804 - In the ALL_INTERIOR_POINTERS (default) case, some callee-save register
805   values could fail to be scanned if the register was saved and
806   reused in a GC frame.  This showed up in verbose mode with gctest
807   compiled with an unreleased SGI compiler.  I vaguely recall an old
808   bug report that may have been related.  The bug was probably quite old.
809   (The problem was that the stack scanning could be deferred until
810   after the relevant frame was overwritten, and the new save location
811   might be outside the scanned area.  Fixed by more eager stack scanning.)
812 - PRINT_BLACK_LIST had some problems.  A few source addresses were garbage.
813 - Replaced Makefile.dj and added -I flags to cord make targets.
814   (Thanks to Gary Leavens.)
815 - GC_try_to_collect was broken with the nonincremental collector.
816 - gc_cleanup destructors could pass the wrong address to
817   GC_register_finalizer_ignore_self in the presence of multiple
818   inheritance.  (Thanks to Darrell Schiebel.)
819 - Changed PowerPC Linux stack finding code.
820
821Since 4.14alpha1
822 - -DSMALL_CONFIG did not work reliably with large (> 4K) pages.
823   Recycling the mark stack during expansion could result in a size
824   zero heap segment, which confused things.  (This was probably also an
825   issue with the normal config and huge pages.)
826 - Did more work to make sure that callee-save registers were scanned
827   completely, even with the setjmp-based code.  Added USE_GENERIC_PUSH_REGS
828   macro to facilitate testing on machines I have access to.
829 - Added code to explicitly push register contents for win32 threads.
830   This seems to be necessary.  (Thanks to Pierre de Rop.)
831
832Since 4.14alpha2
833 - changed STACKBOTTOM for DJGPP (Thanks to Salvador Eduardo Tropea).
834
835Since 4.14
836 - Reworked large block allocator.  Now uses multiple doubly linked free
837   lists to approximate best fit.
838 - Changed heap expansion heuristic.  Entirely free blocks are no longer
839   counted towards the heap size.  This seems to have a major impact on
840   heap size stability; the old version could expand the heap way too
841   much in the presence of large block fragmentation.
842 - added -DGC_ASSERTIONS and some simple assertions inside the collector.
843   This is mainlyt for collector debugging.
844 - added -DUSE_MUNMAP to allow the heap to shrink.  Suupported on only
845   a few UNIX-like platforms for now.
846 - added GC_dump_regions() for debugging of fragmentation issues.
847 - Changed PowerPC pointer alignment under Linux to 4.  (This needs
848   checking by someone who has one.  The suggestions came to me via a
849   rather circuitous path.)
850 - Changed the Linux/Alpha port to walk the data segment backwards until
851   it encounters a SIGSEGV.  The old way to find the start of the data
852   segment broke with a recent release.
853 - cordxtra.c needed to call GC_REGISTER_FINALIZER instead of
854   GC_register_finalizer, so that it would continue to work with GC_DEBUG.
855 - allochblk sometimes cleared the wrong block for debugging purposes
856   when it dropped blacklisted blocks.  This could result in spurious
857   error reports with GC_DEBUG.
858 - added MACOS X Server support.  (Thanks to Andrew Stone.)
859 - Changed the Solaris threads code to ignore stack limits > 8 MB with
860   a warning.  Empirically, it is not safe to access arbitrary pages
861   in such large stacks.  And the dirty bit implementation does not
862   guarantee that none of them will be accessed.
863 - Integrated Martin Tauchmann's Amiga changes.
864 - Integrated James Dominy's OpenBSD/SPARC port.
865
866Since 5.0alpha1
867 - Fixed bugs introduced in alpha1 (OpenBSD & large block initialization).
868 - Added -DKEEP_BACK_PTRS and backptr.h interface.  (The implementation
869   idea came from Al Demers.)
870
871Since 5.0alpha2
872 - Added some highly incomplete code to support a copied young generation.
873   Comments on nursery.h are appreciated.
874 - Changed -DFIND_LEAK, -DJAVA_FINALIZATION, and -DFINALIZE_ON_DEMAND,
875   so the same effect could be obtained with a runtime switch.   This is
876   a step towards standardizing on a single dynamic GC library.
877 - Significantly changed the way leak detection is handled, as a consequence
878   of the above.
879
880Since 5.0 alpha3
881 - Added protection fault handling patch for Linux/M68K from Fergus
882   Henderson and Roman Hodek.
883 - Removed the tests for SGI_SOURCE in new_gc_alloc.h.  This was causing that
884   interface to fail on nonSGI platforms.
885 - Changed the Linux stack finding code to use /proc, after changing it
886   to use HEURISTIC1.  (Thanks to David Mossberger for pointing out the
887   /proc hook.)
888 - Added HP/UX incremental GC support and HP/UX 11 thread support.
889   Thread support is currently still flakey.
890 - Added basic Linux/IA64 support.
891 - Integrated Anthony Green's PicoJava support.
892 - Integrated Scott Ananian's StrongARM/NetBSD support.
893 - Fixed some fairly serious performance bugs in the incremental
894   collector.  These have probably been there essentially forever.
895   (Mark bits were sometimes set before scanning dirty pages.
896   The reclaim phase unnecessarily dirtied full small object pages.)
897 - Changed the reclaim phase to ignore nearly full pages to avoid
898   touching them.
899 - Limited GC_black_list_spacing to roughly the heap growth increment.
900 - Changed full collection triggering heuristic to decrease full GC
901   frequency by default, but to explicitly trigger full GCs during
902   heap growth.  This doesn't always improve things, but on average it's
903   probably a win.
904 - GC_debug_free(0, ...) failed.  Thanks to Fergus Henderson for the
905   bug report and fix.
906
907Since 5.0 alpha4
908 - GC_malloc_explicitly_typed and friends sometimes failed to
909   initialize first word.
910 - Added allocation routines and support in the marker for mark descriptors
911   in a type structure referenced by the first word of an object.  This was
912   introduced to support gcj, but hopefully in a way that makes it
913   generically useful.
914 - Added GC_requested_heapsize, and inhibited collections in nonincremental
915   mode if the actual used heap size is less than what was explicitly
916   requested.
917 - The Solaris pthreads version of GC_pthread_create didn't handle a NULL
918   attribute pointer.  Solaris thread support used the wrong default thread
919   stack size.  (Thanks to Melissa O'Neill for the patch.)
920 - Changed PUSH_CONTENTS macro to no longer modify first parameter.
921   This usually doesn't matter, but it was certainly an accident waiting
922   to happen ...
923 - Added GC_register_finalizer_no_order and friends to gc.h.  They're
924   needed by Java implementations.
925 - Integrated a fix for a win32 deadlock resulting from clock() calling
926   malloc.  (Thanks to Chris Dodd.)
927 - Integrated Hiroshi Kawashima's port to Linux/MIPS.  This was designed
928   for a handheld platform, and may or may not be sufficient for other
929   machines.
930 - Fixed a va_arg problem with the %c specifier in cordprnt.c.  It appears
931   that this was always broken, but recent versions of gcc are the first to
932   report the (statically detectable) bug.
933 - Added an attempt at a more general solution to dlopen races/deadlocks.
934   GC_dlopen now temporarily disables collection.  Still not ideal, but ...
935 - Added -DUSE_I686_PREFETCH, -DUSE_3DNOW_PREFETCH, and support for IA64
936   prefetch instructions.  May improve performance measurably, but I'm not
937   sure the code will run correctly on processors that don't support the
938   instruction.  Won't build except with very recent gcc.
939 - Added caching for header lookups in the marker.  This seems to result
940   in a barely measurable performance gain.  Added support for interleaved
941   lookups of two pointers, but unconfigured that since the performance
942   gain is currently near zero, and it adds to code size.
943 - Changed Linux DATA_START definition to check both data_start and
944   __data_start, since nothing else seems to be portable.
945 - Added -DUSE_LD_WRAP to optionally take advantage of the GNU ld function
946   wrapping mechanism.  Probably currently useful only on Linux.
947 - Moved some variables for the scratch allocator into GC_arrays, on
948   Martin Hirzel's suggestion.
949 - Fixed a win32 threads bug that caused the collector to not look for
950   interior pointers from one of the thread stacks without
951   ALL_INTERIOR_POINTERS.  (Thanks to Jeff Sturm.)
952 - Added Mingw32 support.  (Thanks again to Jeff Sturm for the patch.)
953 - Changed the alpha port to use the generic register scanning code instead
954   of alpha_mach_dep.s.  Alpha_mach_dep.s doesn't look for pointers in fp
955   registers, but gcc sometimes spills pointers there.  (Thanks to Manuel
956   Serrano for helping me debug this by email.)  Changed the IA64 code to
957   do something similar for similar reasons.
958
959[5.0alpha5 doesn't really exist, but it may have escaped.]
960
961Since 5.0alpha6:
962 - -DREDIRECT_MALLOC was broken in alpha6. Fixed.
963 - Cleaned up gc_ccp.h slightly, thus also causing the HP C++ compiler to
964   accept it.
965 - Removed accidental reference to dbg_mlc.c, which caused dbg_mlc.o to be
966   linked into every executable.
967 - Added PREFETCH to bitmap marker.  Changed it to use the header cache.
968 - GC_push_marked sometimes pushed one object too many, resulting in a
969   segmentation fault in GC_mark_from_mark_stack.  This was probably an old
970   bug.  It finally showed up in gctest on win32.
971 - Gc_priv.h erroneously #defined GC_incremental to be TRUE instead of FALSE
972   when SMALL_CONFIG was defined.  This was no doubt a major performance bug for
973   the default win32 configuration.
974 - Removed -DSMALL_CONFIG from NT_MAKEFILE.  It seemed like an anchronism now
975   that the average PC has 64MB or so.
976 - Integrated Bryce McKinley's patches for linux threads and dynamic loading
977   from the libgcj tree.  Turned on dynamic loading support for Linux/PPC.
978 - Changed the stack finding code to use environ on HP/UX.  (Thanks
979   to Gustavo Rodriguez-Rivera for the suggestion.)  This should probably
980   be done on other platforms, too.  Since I can't test those, that'll
981   wait until after 5.0.
982
983Since 5.0alpha7:
984 - Fixed threadlibs.c for linux threads.  -DUSE_LD_WRAP was broken and
985   -ldl was omitted.  Fixed Linux stack finding code to handle
986   -DUSE_LD_WRAP correctly.
987 - Added MSWIN32 exception handler around marker, so that the collector
988   can recover from root segments that are unmapped during the collection.
989   This caused occasional failures under Windows 98, and may also be
990   an issue under Windows NT/2000.
991
992Since 5.0
993 - Fixed a gc.h header bug which showed up under Irix.  (Thanks to
994   Dan Sullivan.)
995 - Fixed a typo in GC_double_descr in typd_mlc.c.
996   This probably could result in objects described by array descriptors not
997   getting traced correctly.  (Thanks to Ben Hutchings for pointing this out.)
998 - The block nearly full tests in reclaim.c were not correct for 64 bit
999   environments.  This could result in unnecessary heap growth under unlikely
1000   conditions.
1001
1002Since 5.1
1003 - dyn_load.c declared GC_scratch_last_end_ptr as an extern even if it
1004   was defined as a macro.  This prevented the collector from building on
1005   Irix.
1006 - We quietly assumed that indirect mark descriptors were never 0.
1007   Our own typed allocation interface violated that.  This could result
1008   in segmentation faults in the marker with typed allocation.
1009 - Fixed a _DUSE_MUNMAP bug in the heap block allocation code.
1010   (Thanks to Ben Hutchings for the patch.)
1011 - Taught the collector about VC++ handling array operator new.
1012   (Thanks again to Ben Hutchings for the patch.)
1013 - The two copies of gc_hdrs.h had diverged.  Made one a link to the other
1014   again.
1015
1016Since 5.2  (A few 5.2 patches are not in 6.0alpha1)
1017 - Fixed _end declaration for OSF1.
1018 - There were lots of spurious leak reports in leak detection mode, caused
1019   by the fact that some pages were not being swept, and hence unmarked
1020   objects weren't making it onto free lists.  (This bug dated back to 5.0.)
1021 - Fixed a typo in the liblinuxgc.so Makefile rule.
1022 - Added the GetExitCodeThread to Win32 GC_stop_world to (mostly) work
1023   around a Windows 95 GetOpenFileName problem.  (Thanks to Jacob Navia.)
1024
1025Since 5.3
1026 - Fixed a typo that prevented compilation with -DUSE_3DNOW_PREFETCH.
1027   (Thanks to Shawn Wagner for actually testing this.)
1028 - Fixed GC_is_thread_stack in solaris_threads.c.  It forgot to return a value
1029   in the common case.  I wonder why nobody noticed?
1030 - Fixed another silly syntax problem in GC_double_descr.  (Thanks to
1031   Fergus Henderson for finding it.)
1032 - Fixed a GC_gcj_malloc bug: It tended to release the allocator lock twice.
1033
1034Since 5.4  (A few 5.3 patches are not in 6.0alpha2)
1035 - Added HP/PA prefetch support.
1036 - Added -DDBG_HDRS_ALL and -DSHORT_DBG_HDRS to reduce the cost and improve
1037   the reliability of generating pointer backtrace information, e.g. in
1038   the Bigloo environment.
1039 - Added parallel marking support (-DPARALLEL_MARK).  This currently
1040   works only under IA32 and IA64 Linux, but it shouldn't be hard to adapt
1041   to other platforms.  This is intended to be a lighter-weight (less
1042   new code, probably not as scalable) solution than the work by Toshio Endo
1043   et al, at the University of Tokyo.  A number of their ideas were
1044   reused, though the code wasn't, and the underlying data structure
1045   is significantly different.  In particular, we keep the global mark
1046   stack as a single shared data structure, but most of the work is done
1047   on smaller thread-local mark stacks.
1048 - Changed GC_malloc_many to be cheaper, and to require less mutual exclusion
1049   with -DPARALLEL_MARK.
1050 - Added full support for thread local allocation under Linux
1051   (-DTHREAD_LOCAL_ALLOC).  This is a thin veneer on GC_malloc_many, and
1052   should be easily portable to other platforms, especially those that
1053   support pthreads.
1054 - CLEAR_DOUBLE was not always getting invoked when it should have been.
1055 - GC_gcj_malloc and friends used different out of memory handling than
1056   everything else, probably because I forgot about one when I implemented
1057   the other.  They now both call GC_oom_fn(), not GC_oom_action().
1058 - Integrated Jakub Jelinek's fixes for Linux/SPARC.
1059 - Moved GC_objfreelist, GC_aobjfreelist, and GC_words_allocd out of
1060   GC_arrays, and separately registered the first two as excluded roots.
1061   This makes code compiled with gc_inl.h less dependent on the
1062   collector version.  (It would be nice to remove the inclusion of
1063   gc_priv.h by gc_inl.h completely, but we're not there yet.  The
1064   locking definitions in gc_priv.h are still referenced.)
1065   This change was later coniditoned on SEPARATE_GLOBALS, which
1066   is not defined by default, since it involves a performance hit.
1067 - Register GC_obj_kinds separately as an excluded root region.  The
1068   attempt to register it with GC_arrays was usually failing.  (This wasn't
1069   serious, but seemed to generate some confusion.)
1070 - Moved backptr.h to gc_backptr.h.
1071
1072Since 6.0alpha1
1073 - Added USE_MARK_BYTES to reduce the need for compare-and-swap on platforms
1074   for which that's expensive.
1075 - Fixed a locking bug ib GC_gcj_malloc and some locking assertion problems.
1076 - Added a missing volatile to OR_WORD and renamed the parameter to
1077   GC_compare_and_swap so it's not a C++ reserved word.  (Thanks to
1078   Toshio Endo for pointing out both of those.)
1079 - Changed Linux dynamic library registration code to look at /proc/self/maps
1080   instead of the rld data structures when REDIRECT_MALLOC is defined.
1081   Otherwise some of the rld data data structures may be prematurely garbage
1082   collected.  (Thanks to Eric Benson for helping to track this down.)
1083 - Fixed USE_LD_WRAP a bit more, so it should now work without threads.
1084 - Renamed XXX_THREADS macros to GC_XXX_THREADS for namespace correctness.
1085   Tomporarily added some backward compatibility definitions.  Renamed
1086   USE_LD_WRAP to GC_USE_LD_WRAP.
1087 - Many MACOSX POWERPC changes, some additions to the gctest output, and
1088   a few minor generic bug fixes.  (Thanks to Dietmar Planitzer.)
1089
1090Since 6.0 alpha2
1091 - Fixed the /proc/self/maps code to not seek, since that apparently is not
1092   reliable across all interesting kernels.
1093 - Fixed some compilation problems in the absence of PARALLEL_MARK
1094   (introduced in alpha2).
1095 - Fixed an algorithmic problem with PARALLEL_MARK.  If work needs to
1096   be given back to the main mark "stack", the BOTTOM entries of the local
1097   stack should be given away, not the top ones.  This has substantial
1098   performance impact, especially for > 2 processors, from what I can tell.
1099 - Extracted gc_lock.h from gc_priv.h.  This should eventually make it a
1100   bit easier to avoid including gc_priv.h in clients.
1101 - Moved all include files to include/ and removed duplicate links to the
1102   same file.  The old scheme was a bad idea because it was too easy to get the
1103   copies out of sync, and many systems don't support hard links.
1104   Unfortunately, it's likely that I broke some of the non-Unix Makefiles in
1105   the process, although I tried to update them appropriately.
1106 - Removed the partial support for a copied nursery.  It's not clear that
1107   this would be a tremendous win, since we don't consistently lose to
1108   generational copying collectors.  And it would significantly complicate
1109   many things.  May be reintroduced if/when it really turns out to win.
1110 - Removed references to IRIX_JDK_THREADS, since I believe there never
1111   were and never will be any clients.
1112 - Added some code to linux_threads.c to possibly support HPUX threads
1113   using the Linux code.  Unfortunately, it doesn't work yet, and is
1114   currently disabled.
1115 - Added support under Linux/X86 for saving the call chain, both in (debug)
1116   objects for client debugging, and in GC_arrays._last_stack for GC
1117   debugging.  This was previously supported only under Solaris.  It is
1118   not enabled by default under X86, since it requires that code be compiled
1119   to explicitly dave frame pointers on the call stack.  (With gcc this
1120   currently happens by default, but is often turned off explicitly.)
1121   To turn it on, define SAVE_CALL_CHAIN.
1122
1123Since 6.0 alpha3
1124 - Moved up the detection of mostly full blocks to the initiatiation of the
1125   sweep phase.  This eliminates some lock conention in the PARALLEL_MARK case,
1126   as multiple threads try to look at mostly full blocks concurrently.
1127 - Restored the code in GC_malloc_many that grabs a prefix of the global
1128   free list.  This avoids the case in which every GC_malloc_many call
1129   tries and fails to allocate a new heap block, and the returns a single
1130   object from the global free list.
1131 - Some minor fixes in new_hblk.c.  (Attempted to build free lists in order
1132   of increasing addresses instead of decreasing addresses for cache performance
1133   reasons.  But this seems to be only a very minor gain with -DEAGER_SWEEP,
1134   and a loss in other cases.  So the change was backed out.)
1135 - Fixed some of the documentation.  (Thanks in large part to Fergus
1136   Henderson.)
1137 - Fixed the Linux USE_PROC_FOR_LIBRARIES code to deal with apps that perform
1138   large numbers of mmaps.  (Thanks to Eric Benson.)  Also fixed that code to
1139   deal with short reads.
1140 - Added GC_get_total_bytes().
1141 - Fixed leak detection mode to avoid spurious messages under linuxthreads.
1142   (This should also now be easy for the other supported threads packages.
1143   But the code is tricky enough that I'm hesitant to do it without being able
1144   to test.  Everything allocated in the GC thread support itself should be
1145   explicitly deallocated.)
1146 - Made it possible (with luck) to redirect malloc to GC_local_malloc.
1147
1148Since 6.0 alpha4
1149 - Changed the definition of GC_pause in linux_threads.c to use a volatile
1150   asm.  Some versions of gcc apparently optimize away writes to local volatile
1151   variables.  This caused poor locking behaviour starting at about
1152   4 processors.
1153 - Added GC_start_blocking(), GC_end_blocking() calls and wrapper for sleep
1154   to linux_threads.c.
1155   The first two calls could be used to generally avoid sending GC signals to
1156   blocked threads, avoiding both premature wakeups and unnecessary overhead.
1157 - Fixed a serious bug in thread-local allocation.  At thread termination,
1158   GC_free could get called on small integers.  Changed the code for thread
1159   termination to more efficiently return left-over free-lists.
1160 - Integrated Kjetil Matheussen's BeOS support.
1161 - Rearranged the directory structure to create the doc and tests
1162   subdirectories.
1163 - Sort of integrated Eric Benson's patch for OSF1.  This provided basic
1164   OSF1 thread support by suitably extending hpux_irix_threads.c.  Based
1165   on earlier email conversations with David Butenhof, I suspect that it
1166   will be more reliable in the long run to base this on linux_threads.c
1167   instead.  Thus I attempted to patch up linux_threads.c based on Eric's code.
1168   The result is almost certainly broken, but hopefully close enough that
1169   someone with access to a machine can pick it up.
1170 - Integrated lots of minor changes from the NetBSD distribution.  (These
1171   were supplied by David Brownlee.  I'm not sure about the original
1172   authors.)
1173 - Hacked a bit more on the HP/UX thread-support in linux_threads.c.  It
1174   now appears to work in the absence of incremental collection.  Renamed
1175   hpux_irix_threads.c back to irix_threads.c, and removed the attempt to
1176   support HPUX there.
1177 - Changed gc.h to define _REENTRANT in cases in which it should already
1178   have been defined. It is still safer to also define it on the command
1179   line.
1180
1181Since 6.0alpha5:
1182 - Changed the definition of DATASTART on ALPHA and IA64, where data_start
1183   and __data_start are not defined by earlier versions of glibc.  This might
1184   need to be fixed on other platforms as well.
1185 - Changed the way the stack base and backing store base are found on IA64.
1186   This should now remain reliable on future kernels.  But since it relies
1187   on /proc, it will no longer work in the simulated NUE environment.
1188 - Made the call to random() in dbg_mlc.c with -DKEEP_BACK_PTRS dependent
1189   on the OS.  On non-Unix systems, rand() should be used instead.  Handled
1190   small RAND_MAX.  (Thanks to Peter Ross for pointing this out.)
1191 - Fixed the cord make rules to create the cord subdirectory, if necessary.
1192   (Thanks to Doug Moen.)
1193 - Changed fo_object_size calculation in finalize.c.  Turned finalization
1194   of nonheap object into a no-op.  Removed anachronism from GC_size()
1195   implementation.
1196 - Changed GC_push_dirty call in solaris_threads.c to GC_push_selected.
1197   It was missed in a previous renaming. (Thanks to Vladimir Tsichevski
1198   for pointing this out.)
1199 - Arranged to not not mask SIGABRT in linux_threads.c.  (Thanks to Bryce
1200   McKinlay.)
1201 - Added GC_no_dls hook for applications that want to register their own
1202   roots.
1203 - Integrated Kjetil Matheussen's Amiga changes.
1204 - Added FREEBSD_STACKBOTTOM.  Changed the X86/FreeBSD port to use it.
1205   (Thanks to Matthew Flatt.)
1206 - Added pthread_detach interception for platforms supported by linux_threads.c
1207   and irix_threads.c.  Should also be added for Solaris?
1208 - Changed the USE_MMAP code to check for the case in which we got the
1209   high end of the address space, i.e. mem_ptr + mem_sz == 0.  It appears
1210   that this can happen under Solaris 7.  It seems to be allowed by what
1211   I would claim is an oversight in the mmap specification.  (Thanks to Toshio
1212   Endo for pointing out the problem.)
1213 - Cleanup of linux_threads.c.  Some code was originally cloned from
1214   irix_threads.c and now unnecessary.  Some comments were obviously wrong.
1215 - (Mostly) fixed a longstanding problem with setting of dirty bits from
1216   a signal handler.  In the presence of threads, dirty bits could get lost,
1217   since the etting of a bit in the bit vector was not atomic with respect
1218   to other updates.  The fix is 100% correct only for platforms for which
1219   GC_test_and_set is defined.  The goal is to make that all platforms with
1220   thread support.  Matters only if incremental GC and threads are both
1221   enabled.
1222 - made GC_all_interior_pointers (a.k.a. ALL_INTERIOR_POINTERS) an
1223   initialization time, instead of build-time option.  This is a
1224   nontrivial, high risk change.  It should slow down the code measurably
1225   only if MERGE_SIZES is not defined, which is a very nonstandard
1226   configuration.
1227 - Added doc/README.environment, and implemented what it describes.  This
1228   allows a number of additional configuration options to be set through
1229   the environment.  It documents a few previously undocumented options.
1230 - Integrated Eric Benson's leak testing improvements.
1231 - Removed the option to throw away the beginning of each page (DISCARD_WORDS).
1232   This became less and less useful as processors enforce stricter alignment.
1233   And it hadn't been tested in ages, and was thus probably broken anyway.
1234
1235Since 6.0alpha6:
1236 - Added GC_finalizer_notifier.  Fixed GC_finalize_on_demand.  (The variable
1237   actually wasn't being tested at the right points.  The build-time flag
1238   was.)
1239 - Added Tom Tromey's S390 Linux patch.
1240 - Added code to push GC_finalize_now in GC_push_finalizer_structures.
1241   (Thanks to Matthew Flatt.)
1242 - Added GC_push_gc_structures() to push all GC internal roots.
1243 - Integrated some FreeBSD changes from Matthew Flatt.
1244 - It looks like USRSTACK is not always correctly defined under Solaris.
1245   Hacked gcconfig.h to attempt to work around the problem.  The result
1246   is not well tested.  (Thanks again to Matthew Flatt for pointing this
1247   out.  The gross hack is mine. - HB)
1248 - Added Ji-Yong Chung's win32 threads and C++ fixes.
1249 - Arranged for hpux_test_and_clear.s to no longer be needed or built.
1250   It was causing build problems with gas, and it's not clear this is
1251   better than the pthreads alternative on this platform.
1252 - Some MINGW32 fixes from Hubert Garavel.
1253 - Added Initial Hitachi SH4 port from Kaz Kojima.
1254 - Ported thread-local allocation and parallel mark code to HP/UX on PA_RISC.
1255 - Made include/gc_mark.h more public and separated out the really private
1256   pieces.  This is probably still not quite sufficient for clients that
1257   want to supply their own kind of type information.  But it's a start.
1258   This involved lots of identifier renaming to make it namespace clean.
1259 - Added GC_dont_precollect for clients that need complete control over
1260   the root set.
1261 - GC_is_visible didn't do the right thing with gcj objects.  (Not that
1262   many people are likely to care, but ...)
1263 - Don't redefine read with GC_USE_LD_WRAP.
1264 - Initial port to LINUX/HP_PA.  Incremental collection and threads are not
1265   yet supported.  (Incremental collection should work if you have the
1266   right kernel.  Threads may work with a sufficiently patched pthread
1267   library.)
1268 - Changed gcconfig.h to recognize __i386__ as an alternative to i386 in
1269   many places.  (Thanks to Benjamin Lerman.)
1270 - Made win32_threads.c more tolerant of detaching a thread that it didn't
1271   know about.  (Thanks to Paul Nash.)
1272 - Added Makefile.am and configure.in from gcc to the distribution, with
1273   minimal changes.  For the moment, those are just placeholders.  In the
1274   future, we're planning to switch to a GNU-style build environment for
1275   Un*x-like systems, though the old Makefile will remain as a backup.
1276 - Turned off STUBBORN_ALLOC by default, and added it back as a Makefile
1277   option.
1278 - Redistributed some functions between malloc.c and mallocx.c, so that
1279   simple statically linked apps no longer pull in mallocx.o.
1280 - Changed large object allocation to clear the first and last few words
1281   of each block before releassing the lock.  Otherwise the marker could see
1282   objects with nonsensical type descriptors.
1283 - Fixed a couple of subtle problems that could result in not recognizing
1284   interior pointers from the stack.  (I believe these were introduced
1285   in 6.0alpha6.)
1286 - GC_debug_free_inner called GC_free, which tried to reacquire the
1287   allocator lock, and hence deadlocked.  (DBG_HDRS_ALL probably never worked
1288   with threads?)
1289 - Fixed several problems with back traces.  Accidental references to a free
1290   list could cause the free list pointer to be overwritten by a back pointer.
1291   There seemed to be some problems with the encoding of root and finalizer
1292   references.
1293
1294Since 6.0alpha7:
1295 - Changed GC_debug_malloc_replacement and GC_debug_realloc_replacement
1296   so that they compile under Irix.  (Thanks to Dave Love.)
1297 - Updated powerpc_macosx_mach_dep.s so that it works if the collector
1298   is in a dynamic library.  (Thanks to Andrew Begel.)
1299 - Transformed README.debugging into debugging.html, updating and
1300   expanding it in the process.  Added gcdescr.html and tree.html
1301   from the web site to the GC distribution.
1302 - Fixed several problems related to PRINT_BLACK_LIST. This involved
1303   restructuring some of the marker macros.
1304 - Fixed some problems with the sizing of objects with debug information.
1305   Finalization was broken KEEP_BACK_PTRS or PRINT_BLACK_LIST.  Reduced the
1306   object size with SHORT_DEBUG_HDRS by another word.
1307 - The "Needed to allocate blacklisted ..." warning had inadvertently
1308   been turned off by default, due to a buggy test in allchblk.c.  Turned
1309   it back on.
1310 - Removed the marker macros to deal with 2 pointers in interleaved fashion.
1311   They were messy and the performance improvement seemed minimal.  We'll
1312   leave such scheduling issues to the compiler.
1313 - Changed Linux/PowerPC test to also check for __powerpc__ in response
1314   to a discussion on the gcc mailing list.
1315 - On Matthew Flatt's suggestion removed the "static" from the jmp_buf
1316   declaration in GC_generic_push_regs.  This was causing problems in
1317   systems that register all of their own roots.  It looks far more correct
1318   to me without the "static" anyway.
1319 - Fixed several problems with thread local allocation of pointerfree or
1320   typed objects.  The collector was reclaiming thread-local free lists, since
1321   it wasn't following the link fields.
1322 - There was apparently a long-standing race condition related to multithreaded
1323   incremental collection.  A collection could be started and a thread stopped
1324   between the memory unprotect system call and the setting of the
1325   corresponding dirt bit.  I believe this did not affect Solaris or PCR, which
1326   use a different dirty-bit implementation.  Fixed this by installing
1327   signal handlers with sigaction instead of signal, and disabling the thread
1328   suspend signal while in the write-protect handler.  (It is unclear
1329   whether this scenario ever actually occurred.  I found it while tracking
1330   down the following:)
1331 - Incremental collection did not cooperate correctly with the PARALLEL_MARK
1332   implementation of GC_malloc_many or the local_malloc primitves.  It still
1333   doesn't work well, but it shouldn't lose memory anymore.
1334 - Integrated some changes from the gcc source tree that I had previously
1335   missed.  (Thanks to Bryce McKinley for the reminder/diff.)
1336 - Added Makefile.direct as a copy of the default Makefile, which would
1337   normally be overwritten if configure is run.
1338 - Changed the gc.tar target in Makefile.direct to embed the version number
1339   in the gc directory name.  This will affect future tar file distributions.
1340 - Changed the Irix dynamic library finding code to no longer try to
1341   eliminate writable text segments under Irix6.x, since that is probably no
1342   longer necessary, and can apparently be unsafe on occasion.  (Thanks to
1343   Shiro Kawai for pointing this out.)
1344 - GC_cleanup with GC_DEBUG enabled passed a real object base address to
1345   GC_debug_register_finalizer_ignore_self, which expected a pointer past the
1346   debug header.  Call GC_register_finalizer_ignore_self instead, even with
1347   debugging enabled.  (Thanks to Jean-Daniel Fekete for catching this.)
1348 - The collector didn't build with call chain saving enabled but NARGS=0.
1349   (Thanks to Maarten Thibaut.)
1350 - Fixed up the GNU-style build files enough so that they work in some
1351   obvious cases.
1352 - Added initial port to Digital Mars compiler for win32. (Thanks to Walter
1353   Bright.)
1354
1355Since 6.0alpha8:
1356 - added README.macros.
1357 - Made gc.mak a symbolic link to work around winzip's tendency to ignore
1358   hard links.
1359 - Simplified the setting of NEED_FIND_LIMIT in os_dep.c, possibly breaking
1360   it on untested platforms.
1361 - Integrated initial GNU HURD port. (Thanks to Chris Lingard and Igor
1362   Khavkine.)
1363 - A few more fixes for Digital Mars compiler (Walter Bright).
1364 - Fixed gcc version recognition.  Renamed OPERATOR_NEW_ARRAY to
1365   GC_OPERATOR_NEW_ARRAY.  Changed GC_OPERATOR_NEW_ARRAY to be the default.
1366   It can be overridden with -DGC_NO_OPERATOR_NEW_ARRAY.  (Thanks to
1367   Cesar Eduardo Barros.)
1368 - Changed the byte size to free-list mapping in thread local allocation
1369   so that size 0 allocations are handled correctly.
1370 - Fixed Linux/MIPS stackbottom for new toolchain. (Thanks to Ryan Murray.)
1371 - Changed finalization registration to invoke GC_oom_fn when it runs out
1372   of memory.
1373 - Removed lvalue cast in finalize.c.  This caused some debug configurations
1374   not to build with some non-gcc compilers.
1375
1376Since 6.0alpha9:
1377 - Two more bug fixes for KEEP_BACK_PTRS and DBG_HDRS_ALL.
1378 - Fixed a stack clearing problem that resulted in SIGILL with a
1379   misaligned stack pointer for multithreaded SPARC builds.
1380 - Integrated another HURD patch (thanks to Igor Khavkine).
1381
1382Since 6.0:
1383 - Non-debug, atomic allocations could result in bogus smashed object
1384   reports with debugging on.  (Thanks to Patrick Doyle for the small
1385   test case.)
1386 - Fixed GC_get_register_stack_base (Itanium only) to work around a glibc
1387   2.2.4 bug.
1388 - Initial port to HP/UX on Itanium.  Thread support and both 32 and 64
1389   bit ABIs appear to work.  Parallel mark support doesn't yet, due to
1390   some inline assembly code issues.  Thread local allocation does appear
1391   to work.
1392 - ifdef'ed out glibc2.1/Itanium workaround.  I suspect nobody is using
1393   that combination anymore.
1394 - Added a patch to make new_gc_alloc.h usable with gcc3.0.  (Thanks to
1395   Dimitris Vyzovitis for the patch.)
1396 - Debugged 64-bit support on HP/UX PA-RISC.
1397 - Turned on dynamic loading support for FreeBSD/ELF.  (Thanks to Peter
1398   Housel.)
1399 - Unregistering of finalizers with debugging allocation was broken.
1400   (Thanks to Jani Kajala for the test case.)
1401 - Old finalizers were not returned correctly from GC_debug_register_finalizer.
1402 - Disabled MPROTECT_VDB for Linux/M68K based on a report that it doesn't work.
1403 - Cleaned up some statistics gathering code in reclaim.c (Thanks to Walter
1404   Bright.)
1405 - Added some support for OpenBSD/ELF/Linux.  (Thanks to Suzuki Toshiya.)
1406 - Added Jakub Jelinek's patch to use dl_iterate_phdr for dynamic library
1407   traversal to dyn_load.c.  Changed it to weakly reference dl_iterate_phdr,
1408   so that the old code is stilll used with old versions of glibc.
1409 - Cleaned up feature test macros for various threads packages and
1410   integrated (partially functional) FreeBSD threads code from Loren Rittle.
1411   It's likely that the cleanup broke something, since it touched lots of
1412   code.  It's also likelly that it fixed some unreported bugs in the
1413   less common thread implementations, since some of the original code
1414   didn't stand up to close scrutiny.  Support for the next pthreads
1415   implementation should be easier to add.
1416
1417Since 6.1alpha1:
1418 - No longer wrap read by default in multithreaded applications.  It was
1419   pointed out on the libgcj list that this holds the allocation lock for
1420   way too long if the read blocks.  For now, reads into the heap are
1421   broken with incremental collection.  It's possible to turn this back on
1422   if you make sure that read calls don't block (e.g. by calling select
1423   first).
1424 - Fix ifdef in Solaris_threads.h to refer to GC_SOLARIS_THREADS.
1425 - Added check for environment variable GC_IGNORE_GCJ_INFO.
1426 - Added printing of stop-the-world GC times if GC_PRINT_STATS environment
1427   variable is set.
1428 - The calloc definition in leak_detector.h was missing parentheses, and
1429   realloc was missing a second argument to GC_REALLOC.
1430   (Thanks to Elrond (elrond<at>samba-tng.org).)
1431 - Added GC_PRINT_BACK_HEIGHT environment variable and associated
1432   code, mostly in the new file backgraph.c.  See doc/README.environment.
1433 - Added -DUSE_GLOBAL_ALLOC to work around a Windows NT issue.  (Thanks to
1434   Jonathan Clark.)
1435 - Integrated port to NEC EWS4800 (MIPS-based workstation, with somewhat
1436   different address-space layout). This may help for other machines with
1437   holes in the data segment.  (Thanks to Hironori Sakamoto.)
1438 - Changed the order in which GC_push_roots and friends push things onto
1439   the mark stack.  GC_push_all calls need to come first, since we can't
1440   necessarily recovere if those overflow the mark stack.  (Thanks to
1441   Matthew Flatt for tracking down the problem.)
1442 - Some minor cleanups to mostly support the Intel compiler on Linux/IA64.
1443
1444Since 6.1 alpha2:
1445 - Minor cleanup on the gcconfig.h section for SPARC.
1446 - Minor fix to support Intel compiler for I386/Linux. (Thanks to Sven
1447   Hartrumpf.)
1448 - Added SPARC V9 (64-bit) support.  (Thanks to Jeff Sturm.)
1449 - Restructured the way in which we determine whether or not to keep
1450   call stacks for debug allocation.  By default SAVE_CALL_COUNT is
1451   now zero on all platforms.  Added SAVE_CALL_NARGS parameters.
1452   If possible, use execinfo.h to capture call stack.  (This should
1453   add support for a number of new platforms, though often at
1454   considerable runtime expense.)
1455 - Try to print symbolic information for call stacks.  On Linux, we
1456   do this with a combination of execinfo.h and running addr2line in
1457   a separate process.  This is both much more expensive and much more
1458   useful.  Amazingly, it seems to be fast enough for most purposes.
1459 - Redefined strdup if -DREDIRECT_MALLOC is given.
1460 - Changed incremental collector and MPROTECT_VDB implementation so that,
1461   under favorable conditions, pointerfree objects are not protected.
1462   Added GC_incremental_protection_needs() to determine ahead of time whether
1463   pointerfree objects may be protected.  Replaced GC_write_hint() with
1464   GC_remove_protection().
1465 - Added test for GC_ENABLE_INCREMENTAL environment variable.
1466 - Made GC_time_limit runtime configurable.  Added GC_PAUSE_TIME_TARGET
1467   environment variable.
1468 - Eliminated GC_page_sz, a duplicate of GC_page_size.
1469 - Caused the Solaris and Irix thread creation primitives to call
1470   GC_init_inner().
1471
1472Since 6.1alpha3:
1473 - Fixed typo in sparc_mach_dep.S, preventing the 64-bit version from
1474   building.  Increased 64-bit heap size limit in test.c slightly, since
1475   a functional SPARC collector seems to slightly exceed the old limits.
1476   (Thanks again to Jeff Sturm.)
1477 - Use NPRGREG in solaris_threads.c, thus printing all registers if things
1478   go wrong.
1479 - Added GC_MARKERS environment variable to allow use of a single marker
1480   thread on an MP without confusing the lock implementation.
1481 - Collect much less aggressively in incremental mode with GC_TIME_UNLIMITED.
1482   This is really a purely generational mode, and we can afford to
1483   postpone the collection until the heap is (nearly) full.
1484 - Remove read() wrapper for MPROTECT_VDB.  It was causing more harm than
1485   good.  It is often no longer needed if system calls avoid writing to
1486   pointerfull heap objects.
1487 - Fix MACOSX test in gcconfig.h. (Thanks to John Clements.)
1488 - Change GC_test_and_set so that it consistently has one argument.
1489   Add spaces to ::: in powerpc assembly code in gc_locks.h.
1490   (Thanks to Ryan Murray.)
1491 - Fixed a formatting error in dbg_mlc.c.  Added prototype to GC_abort()
1492   declaration.   (Thanks to Michael Smith.)
1493 - Removed "source" argument to GC_find_start().  Eliminate GC_FIND_START().
1494 - Added win32 recognition code in configure.in.  Changed some of the
1495   dllimport/export defines in gc.h.  (Thanks to Adam Megacz.)
1496 - GC_malloc_many didn't set hb_last_reclaimed when it called
1497   GC_reclaim_generic.  (I'm not sure this matters much, but ...)
1498 - Allocating uncollectable objects with debug information sometimes
1499   allocated objects that were one byte too small, since uncollectable
1500   objects don't have the extra byte added at the end.  (Thanks to
1501   Wink Saville for pointing this out.)
1502 - Added a bit more assertion checking to make sure that gcj objects
1503   on free lists never have a nonzero second word.
1504 - Replaced BCC_MAKEFILE with an up-to-date one.  (Thanks to
1505   Andre Leiradella.)
1506 - Upgraded libtool, cinfigure.in and some related files to hopefully
1507   support NetBSD/SPARC.  (Thanks to Adrian Bunk.)  Unfortunately,
1508   libtool 1.4.2 seemed to be buggy due to missing quotes in several
1509   "test" invocations.  Fixed those in the ltmain.sh script.
1510 - Some win32-specific patches, including the introduction of
1511   GC_CreateThread.  (Thanks to Adam Megacz.)
1512 - Merged in gcj changes from Anthony Green to support embedded systems.
1513 - Tried to consistently rename preprocessed assembly files with a capital
1514   .S extension.
1515 - Use alpha_mach_dep.S on ALPHA again.  It doesn't really matter, but this
1516   makes our distribution consistent with the gcc one, avoiding future merge
1517   problems.
1518 - Move GET_MEM definition into gcconfig.h.  Include gcconfig.h slightly
1519   later in gc_priv.h to avoid forward references to ptr_t.
1520 - Add some testing of local allocation to test.c.
1521 - Change definition of INVALID_QTID in specific.h.  The -1 value was used
1522   inconsistently, and too likely to collide with a valid stack address.
1523   Some general clean-up of specific.[ch].  Added assertions.  (Thanks
1524   to Michael Smith for tracking down an intermittent bug to this
1525   general area.  I'm not sure it has been squashed yet, however.)
1526 - On Pthread systems it was not safe to call GC_malloc() between fork()
1527   and exec().  According to the applicable standards, it doesn't appear
1528   to be safe to call malloc() or many other libc functions either, thus
1529   it's not clear this is fixable.  Added experimental support for
1530   -DHANDLE_FORK in linux_threads.c which tries to support it.  It may
1531   succeed if libc does the right thing.  I'm not sure whether it does.
1532   (Thanks to Kenneth Schalk for pointing out this issue.)
1533 - Documented thread local allocation primitives to require an
1534   explicit GC_init call.  GC_init_parallel is no longer declared to
1535   be a constructor function, since that isn't portable and often
1536   seems to lead to initialization order problems.
1537 - Changed gc_cpp.cc and gc_cpp.h in one more attempt to make them
1538   compatible with Visual C++ 6.  (Thanks to Wink Saville for the
1539   patch.)
1540 - Some more patches for Linux on HP PA-RISC.
1541 - Added include/gc_allocator.h.  It implements (hopefully) standard
1542   conforming (as opposed to SGI-style) allocators that allocate
1543   collectable (gc_allocator) or GC-traceable, but not collectable
1544   (traceable_allocator) objects.  This borrows heavily from libstc++,
1545   which borrows heavily from the SGI implementation, this part of
1546   which was written by Matt Austern.  Changed test_cpp.cc to very
1547   minimally test this.
1548 - On Linux/X86, retry mmap with a different start argument.  That should
1549   allow the collector to use more (closer to 3GB) of the address space.
1550   (Thanks to Jeffrey Mark Siskind for tracking this down.)
1551 - Force 64 bit alignment with GCJ support.  (Reflects Bryce McKinley's
1552   patch to the gcc tree.)
1553 - Refined the choice of sa_handler vs. sa_sigaction in GC_dirty_init
1554   to accomodate some glibc5 systems.  (Thanks to Dan Fandrich for the
1555   patch.)
1556 - Compensated for the fact that current versions of glibc set
1557   __libc_stack_end incorrectly on Linux/IA64 while initialization code
1558   is running.  This could cause the collector to miss 16 bytes of
1559   the memory stack if GC_malloc or friends where called before main().
1560 - Mostly integrated Takis Psarogiannakopoulos' port to DG/UX Inix 86.
1561   This will probably take another iteration to work, since his
1562   patch conflicted with the libtool upgrade.
1563 - Added README.arm.cross containing some information about cross-
1564   compiling to an ARM processor from Margaret Fleck.
1565
1566Since 6.1alpha4:
1567 - Added GC_finalizer_mem_freed, and changed some of the code that
1568   decided on heap expansion to look at it.  Memory explicitly
1569   deallocated by finalizers essentially needs to be counted as reclaimed
1570   by the GC.  Otherwise there are cases in which the heap can grow
1571   unboundedly.  (Thanks to Mark Reichert for the test case.)
1572 - Integrated Adam Megacz patches to not scan dynamic libraries if
1573   we are compiling with gcc on win32.  Otherwise we need structured
1574   exception handling to deal with asynchronously unmapped root
1575   segments, and gcc doesn't directly support that.
1576 - Integrated Anthony Green's patch to support Wine.
1577 - GC_OPERATOR_NEW_ARRAY was misspelled OPERATOR_NEW_ARRAY in several
1578   places, including gc_cpp.cc.  (Thanks to Wink Saville for pointing
1579   this out.)
1580 - Integrated Loren James Rittle's Alpha FreeBSD patches.  In
1581   response to Richard Henderson's suggestion, these also
1582   changed the declarations of symbols like _end on many platforms to
1583   that they wouldn't mistakenly be declared as short data symbols.
1584 - Integrated changes from the Debian distribution.  (Thanks to Ryan Murray
1585   for pointing these out.)  Fix C++ comments in POWERPC port.  Add ARM32
1586   incremental GC support.  Get rid of USE_GENERIC_PUSH_REGS for alpha/Linux,
1587   this time for real.  Use va_copy to get rid of cord printf problems
1588   (finally).
1589 - Close file descriptor used to count cpus.  Thanks to Jeff Sturm for
1590   pointing out the omission.
1591 - Don't just drop gcj free lists in GC_start_reclaim, since that can
1592   eventually cause the marker to see a bogus mark descriptor in the
1593   dropped objects.  The usual symptom was a very intermittent segmentation
1594   fault in the marker.  This mattered only if one of the GC_gcj_malloc
1595   variants was used.  (Thanks to Michael Smith, Jeff Sturm, Bryce
1596   McKinley and Tom Tromey for helping to track this down.)
1597 - Fixed Linux and Solaris/64 SPARC configuration.  (Thanks to David Miller,
1598   Jeff Sturm, Tom Tromey, and Christian Joensson.)
1599 - Fixed a typo in strdup definition.  (Thanks to Gerard A Allan.)
1600 - Changed Makefile.direct to invoke $(CC) to assemble alpha_mach_dep.S.
1601   This is needed on Linux.  I'm not sure whether it's better or worse
1602   on Tru64.
1603 - Changed gc_cpp.h once more to declare operator new and friends only in
1604   a Microsoft environment.  This may need further fine tuning.  (Thanks to
1605   Johannes Schmidt for pointing out that the older code breaks on gcc3.0.4.)
1606 - Don't ever override strdup if it's already macro defined.  (Thanks to
1607   Adnan Ali for pointing out the problem.)
1608 - Changed gc_cpp.h yet again to also overload placement new.  Due to the
1609   C++ overloading rules, the other overloaded new operations otherwise hide
1610   placement new, which causes many STL uses to break.  (Thanks to Reza
1611   Shahidi for reporting this, and to Matt Austern for proposing a fix.)
1612 - Integrated cygwin pthreads support from Dan Bonachea.
1613 - Turn on DYNAMIC_LOADING for NetBSD.  (Thanks to Krister Walfridsson.)
1614 - Changed printing code to print more complete GC times.
1615 - Applied Mark Mitchell's Irix patch to correct some bitrot.
1616 - Clarified which object-printing routines in dbg_mlc.c should hold
1617   the allocation lock.  Restructured the code to allow reasonable object
1618   printing with -DREDIRECT_MALLOC.
1619 - Fix the Linux mmap code to always start with 0x1000 as the initial hint.
1620   Minor patches for 64-bit AIX, particularly to STACKBOTTOM.
1621   (Thanks again to Jeffrey Mark Siskind.)
1622 - Renamed "SUSPENDED" flag for Solaris threads support to avoid a conflict
1623   with a system header. (Thanks to Philp Brown.)
1624 - Cause win32_threads.c to handle an out of range stack pointer correctly,
1625   though currently with a warning.  (Thanks to Jonathan Clark for
1626   observing that win32 applications may temporarily use the stack
1627   pointer for other purposes, and suggesting a fix.  Unfortunately, it's
1628   not clear that there is a complete solution to this problem.)
1629
1630Since 6.1alpha5:
1631 - Added GC_MAXIMUM_HEAP_SIZE environment variable.
1632 - Fix configure.in for MIPS/LINUX. (Thanks to H.J. Lu.)
1633 - Double page hash table size for -DLARGE_CONFIG.
1634 - Integrated Bo Thorsen's X86-64 support.
1635 - STACKBOTTOM definition for LINUX/MIPS was partially changed back.
1636   (Thanks to H.J. Lu and Hiroshi Kawashima for resolving this.)
1637 - Replaced all occurrences of LINUX_DATA_START in gcconfig.h with
1638   SEARCH_FOR_DATA_START.  It doesn't hurt to falll back to a search.
1639   And __data_start doesn't seem to get defined correctly of the GC
1640   library is loaded with LD_PRELOAD, e.g. for leak detection.
1641 - If the GC_find_leak environment variable is set, do a
1642   atexit(GC_gcollect) to give us at least one chance to detect leaks.
1643   This may report some very benign leaks, but ...
1644 - Addeded REDIRECT_FREE.  It's necessary if we want leak detection with
1645   LD_PRELOAD.
1646 - Defer printing of leaked objects, as for smashed objects.
1647 - Fixed process and descriptor leak in GC_print_callers.  Try for
1648   line number even if we got function name.)
1649 - Ported parallel GC support and thread local allocation to Alpha.
1650   Not yet well-tested.
1651 - Added GC_DUMP_REGULARLY and added finalization statistics to GC_dump().
1652 - Fixed Makefile.am to mention alpha_mach_dep.S instead of the defunct
1653   alpha_mach_dep.s.  (Thanks to Fergus Henderson.)
1654 - Incorporated a change to new_gc_alloc.h, suggested by Johannes Schmidt,
1655   which should make it work with gcc3.1.  (I would still like to encourage
1656   use of gc_allocator.h instead.)
1657 - Use alpha_mach_dep.S only on Linux.  (It's not clear that this is
1658   optimal, but it otherwise didn't build on Tru64.  Thanks to Fergus
1659   Henderson.)
1660 - Added ifdef to guard free() in os_dep.c.  Otherwise we get a
1661   compilation error on Irix.  (Thanks to Dai Sato.)
1662 - Added an experimental version of GC_memalign to mallocx.c.  This can't
1663   always work, since we don't handle alignment requests in the hblk-level
1664   allocator, and we can't handle arbitrary pointer displacements unless
1665   GC_all_interior_pointers is enabled.  But it should work for alignment
1666   requests up to HBLKSIZE.  This is not yet documented in the standard
1667   places.
1668 - Finally debugged the OSF1/Tru64 thread support.  This needs more testing,
1669   since I needed to add a somewhat unconvincing workaround for signal
1670   delivery issues that I don't yet completely understand.  But it does
1671   pass my tests, even in parallel GC mode.  Incremental GC support is
1672   disabled if thread support is enabled, due to the signal issues.
1673 - Eliminated name-space-incorrect definition of _cdecl from gc_cpp.h.
1674 - Added GC_debug_malloc_replacement and GC_debug_realloc_replacement
1675   declarations to gc.h.  On IA64, this is required for REDIRECT_MALLOC
1676   to work correctly with these.
1677 - Fixed Linux USE_PROC_FOR_LIBRARIES to work with a 64-bit /proc format.
1678
1679Since 6.1:
1680 - Guard the test for GC_DUMP_REGULARLY in misc.c with
1681   "#ifndef NO_DEBUGGING".  Otherwise it fails to build with NO_DEBUGGING
1682   defined.  (Thanks to Manuel Serrano.)
1683 - Message about retrying suspend signals was incorrectly generated even when
1684   flag was not set.
1685 - Cleaned up MACOSX/NEXT root registration code.  There was apparently a
1686   separate ifdef case in GC_register_data_segments() for no reason.
1687 - Removed MPROTECT_VDB for MACOSX port, based on one negative report.
1688 - Arrange for gc.h and friends to be correctly installed with GNU-style
1689   "make install".
1690 - Enable the GNU-style build facility include C++ support in the library
1691   with --enable-cplusplus. (Thanks to Thomas Maier for some of the patch.)
1692 - Mark from GC_thread_key in linux_threads.c, in case that's allocated
1693   from the garbage collected heap, as it is with our own thread-specific
1694   storage implementation.  (Thanks to Jeff Sturm.)
1695 - Mark all free list header blocks if they are heap allocated.  This avoids
1696   some unnecessary tracing.  And it remains correct if we clear the
1697   root set. (Thanks to Jeff Sturm for identifying the bug.)
1698 - Improved S390/Linux support.  Add S390/Linux 64-bit support.  (Thanks
1699   to Ulrich Weigand.)
1700 - Corrected the spelling of GC_{M,C}ALLOC_EXPLICTLY_TYPED to
1701   GC_{M,C}ALLOC_EXPLICITLY_TYPED in gc_typed.h.  This is technically
1702   an interface change.  Based on the fact that nobody reported this,
1703   I suspect/hope there were no clients.
1704 - Cleaned up gc_typed.h so that (1) it adds an extern "C" declaration
1705   when appropriate, (2) doesn't generate references to undefined internal
1706   macros, and (3) allows easier manual construction of descriptors.
1707 - Close the file descriptor used by GC_print_address_map().
1708 - Set the "close-on-exec" bit for various file descriptors maintained
1709   for the collector's internal use.
1710 - Added a hack to find memory segments owned by the system allocator
1711   under win32.  Based on my tests, this tends to eventually find all
1712   segments, though it may take a while.  There appear to be cleaner,
1713   but slower solutions under NT/XP.  But they rely on an API that's
1714   unsupported under 9X.
1715 - Changed Linux PowerPC stack finding to LINUX_STACKBOTTOM.  (Thanks
1716   to Akira Tagoh for pointing out that HEURISTIC1 doesn't work on
1717   64-bit kernels.)
1718 - Added GC_set_free_space_divisor to avoid some Windows dll issues.
1719 - Added FIXUP_POINTER, POINTER_SHIFT, POINTER_MASK to allow preprocessing
1720   of candidate pointers for tagging, etc.
1721 - Always lock around GC_notify_full_gc().  Simplified code for
1722   invoking GC_notify_full_gc().
1723 - Changed the way DATASTART is defined on FreeBSD to be robust against
1724   an unmapped page after etext.  (Thanks to Hironori Sakamoto for
1725   tracking down the intermittent failure.)
1726 - Made GC_enable() and GC_disable() official.  Deprecated direct update
1727   of GC_dont_gc.  Changed GC_gcollect to be a noop when garbage collection
1728   is disabled.
1729 - Call GC_register_dynamic_libraries before stopping the world on Linux,
1730   in order to avoid a potential deadlock due to the dl_iterate_phdr lock.
1731 - Introduced a more general mechanism for platform-dependent code to
1732   decide whether the main data segment should be handled separately
1733   from dynamic libraries, or registered by GC_register_dynamic_libraries.
1734   The latter is more reliable and easier on Linux with dl_iterate_phdr.
1735
1736Since 6.2alpha1:
1737 - Fixed the completely broken FreeBSD code in 6.2alpha1.  (Thanks to
1738   Hironori Sakamoto for the patch.)
1739 - Changed IRIX reference in dbg_mlc.c to IRIX5. (Thanks to Marcus Herbert.)
1740 - Attempted to work around the problems with .S filenames and the SGI
1741   compiler.  (Reported by several people. Untested.)
1742 - Worked around an HP/UX make issue with the GNU-style build process.
1743 - Fixed the --enable-cplusplus build machinery to allow builds without
1744   a C++ compiler.  (That was always the intent ...)
1745 - Changed the debugging allocation macros to explicitly pass the return
1746   address for Linux and XXXBSD on hardware for which we can't get stack
1747   traces.  Use __builtin_return_address(0) to generate it when possible.
1748   Some of the configuration work was cleaned up (good) and moved to gc.h
1749   (bad, but necessary).  This should make leak detection more useful
1750   on a number of platforms.  (Thanks to Fabian Thylman for the suggestion.)
1751 - Fixed compilation problems in dbg_mlc.c with GC_ADD_CALLER.
1752 - Bumped revision number for dynamic library.
1753
1754Since 6.2alpha2:
1755 - Don't include execinfo.h in os_dep.c when it's not needed, and may not exist.
1756
1757Since 6.2alpha3:
1758 - Use LINUX_STACKBOTTOM for >= glibc2.2 on Linux/MIPS.  (See Debian bug
1759   # 177204)
1760 - Integrated Jeff Sturm and Jesse Rosenstock's MACOSX threads patches.
1761 - Integrated Grzegorz Jakacki's substantial GNU build patch.  "Make dist"
1762   should now work for the GNU build process.  Documentation files
1763   are installed under share/gc.
1764 - Tweaked gc_cpp.h to again support the Borland compiler.  (Thanks to
1765   Rene Girard for pointing out the problems.)
1766 - Updated BCC_MAKEFILE (thanks to Rene Girard).
1767 - Added GC_ASSERT check for minimum thread stack size.
1768 - Added --enable-gc-assertions.
1769 - Added some web documentation to the distribution.  Updated it in the
1770   process.
1771 - Separate gc_conf_macros.h from gc.h.
1772 - Added generic GC_THREADS client-defined macro to set the appropriate
1773   GC_XXX_THREADS internal macro.  (gc_config_macros.h.)
1774 - Add debugging versions of _ignore_off_page allocation primitves.
1775 - Moved declarations of GC_make_closure and GC_debug_invoke_finalizer
1776   from gc.h to gc_priv.h.
1777 - Reset GC_fail_count even if only a small allocation succeeds.
1778 - Integrated Brian Alliet's patch for dynamic library support on Darwin.
1779 - gc_cpp.h's gc_cleanup destructor called GC_REGISTER_FINALIZER_IGNORE_SELF
1780   when it should have called the lower case version, since it was
1781   explicitly computing a base pointer.
1782
1783Since 6.2alpha4:
1784 - GC_invoke_finalizers could, under rare conditions, set
1785   GC_finalizer_mem_freed to an essentially random value.  This could
1786   possibly cause unbounded heap growth for long-running applications
1787   under some conditions.  (The bug was introduced in 6.1alpha5, and
1788   is not in gcc3.3.  Thanks to Ben Hutchings for finding it.)
1789 - Attempted to sanitize the various DLL macros.  GC_USE_DLL disappeared.
1790   GC_DLL is used instead.  All internal tests are now on GC_DLL.
1791   README.macros is now more precise about the intended meaning.
1792 - Include DllMain in the multithreaded win32 version only if the
1793   collector is actually built as a dll.  (Thanks to Mohan Embar for
1794   a version of the patch.)
1795 - Hide the cygwin threadAttach/Detach functions.  They were violating our
1796   namespace rules.
1797 - Fixed an assertion in GC_check_heap_proc.  Added GC_STATIC_ASSERT.
1798   (Thanks again to Ben Hutchings.)
1799 - Removed some obsolete definitions for Linux/PowerPC in gcconfig.h.
1800 - CORD_cat was not rebalancing unbalanced trees in some cases, violating
1801   a CORD invariant.  Also tweaked the rebalancing rule for
1802   CORD_cat_char_star.  (Thanks to Alexandr Petrosian for the bug report
1803   and patch.)
1804 - Added hand-coded structured exception handling support to mark.c.
1805   This should enable support of dynamic libraries under win32 with
1806   gcc-compiled code.  (Thanks to Ranjit Mathew for the patch.)
1807   Turned on dynamic library scanning for win32/gcc.
1808 - Removed some remnants of read wrapping.  (Thanks to Kenneth Schalk.)
1809   GC_USE_LD_WRAP ws probably broken in recent versions.
1810 - The build could fail on some platforms since gcconfig.h could include
1811   declarations mentioning ptr_t, which was not defined, e.g. when if_mach
1812   was built.  (Thanks to Yann Dirson for pointing this out.)  Also
1813   cleaned up tests for GC_PRIVATE_H in gcconfig.h a bit.
1814 - The GC_LOOP_ON_ABORT environment variable interfered with incremental
1815   collection, since the write fault handler was erroneously overridden.
1816   Handlers are now set up in the correct order.
1817 - It used to be possible to call GC_mark_thread_local_free_lists() while
1818   the world was not stopped during an incremental GC.  This was not safe.
1819   Fortunately, it was also unnecessary.  Added GC_world_stopped flag
1820   to avoid it.  (This caused occasional crashes in GC_set_fl_marks
1821   with thread local allocation and incremental GC.  This probably happened
1822   primarily on old, slow multiprocessors.)
1823 - Allowed overriding of MAX_THREADS in win32_threads.c from the build
1824   command line.  (Patch from Yannis Bres.)
1825 - Taught the IA64/linux code to determine the register backing store base from
1826   /proc/self/maps after checking the __libc symbol, but before guessing.
1827   (__libc symbols are on the endangered list, and the guess is likely to not
1828   always be right for 2.6 kernels.)  Restructured the code to read and parse
1829   /proc/self/maps so it only exists in one place (all platforms).
1830 - The -DUSE_PROC_FOR_LIBRARIES code was broken on Linux.  It claimed that it
1831   also registered the main data segment, but didn't actually do so.  (I don't
1832   think anyone actually uses this configuration, but ...)
1833 - Made another attempt to get --enablecplusplus to do the right thing.
1834   Since there are unavoidable problems with C programs linking against a
1835   dynamic library that includes C++ code, I separated out the c++ code into
1836   libgccpp.
1837
1838Since 6.2alpha5:
1839 - There was an extra underscore in the name of GC_save_registers_in_stack
1840   for NetBSD/SPARC.  (Thanks to Jaap Boender for the patch.)
1841 - Integrated Brian Alliet's patch for Darwin.  This restructured the
1842   linuxthreads/pthreads support to separate generic pthreads support
1843   from more the system-dependent thread-stopping code.  I believe this
1844   should make it easier to eliminate the code duplication between
1845   pthreads platforms in the future.  The patch included some other
1846   code cleanups.
1847 - Integrated Dan Bonachea's patch to support AIX threads.  This required
1848   substantial manual integration, mostly due to conflicts with other
1849   recent threads changes.  It may take another iteration to
1850   get it to work.
1851 - Removed HPUX/PA-RISC support from aix_irix_threads.c.  It wasn't used
1852   anyway and it cluttered up the code.  And anything we can do to migrate
1853   towards generic pthreads support is a good thing.
1854 - Added a more explicit test for tracing of function arguments to test.c.
1855   (Thanks to Dan Grayson.)
1856 - Added Akira Tagoh's PowerPC64 patch.
1857 - Fixed some bit rot in the Cygwin port.  (Thanks to Dan Bonachea for
1858   pointing it out.)  Gc.h now includes just windows.h, not winbase.h.
1859 - Declared GC_save_regs_in_stack() in gc_priv.h.  Remove other declarations.
1860 - Changed --enable-cplusplus to use automake consitionals.  The old way
1861   confused libtool.  "Make install" didn't work correctly for the old version.
1862   Previously --enable-cplusplus was broken on cygwin.
1863 - Changed the C version of GC_push_regs to fail at compile time if it is
1864   generated with an empty body.  This seems to have been the cause of one
1865   or two subtle failures on unusual platforms.  Those failures should
1866   now occur at build time and be easily fixable.
1867
1868Since 6.2alpha6:
1869 - Integrated a second round of Irix/AIX patches from Dan Bonachea.
1870   Renamed mips_sgi_mach_dep.S back to mips_sgi_mach_dep.s, since it requires
1871   the Irix assembler to do the C preprocessing; gcc -E doesn't work.
1872 - Fixed Makefile.direct for DARWIN.  (Thanks to Manuel Serrano.)
1873 - There was a race between GC_pthread_detach and thread exit that could
1874   result in a thread structure being deallocated by GC_pthread_detach
1875   eventhough it was still needed by the thread exit code.  (Thanks to
1876   Dick Porter for the small test case that allowed this to be debugged.)
1877 - Fixed version parsing for non-alpha versions in acinclude.m4 and
1878   version checking in version.h.
1879
1880Since 6.2:
1881 - Integrated some NetBSD patches forwarded to me by Marc Recht.  These
1882   were already in the NetBSD package.
1883 - GC_pthread_create waited for the semaphore even if pthread_create failed.
1884   Thanks to Dick Porter for the pthread_support.c patch.  Applied the
1885   analogous fix for aix_irix_threads.c.
1886 - Added Rainer Orth's Tru64 fixes.
1887 - The check for exceeding the thread table size in win32 threadDetach
1888   was incorrect.  (Thanks to Alexandr Petrosian for the patch.)
1889 - Applied Andrew Begel's patch to correct some reentrancy issues
1890   with dynamic loading on Darwin.
1891 - GC_CreateThread() was neglecting to duplicate the thread handle in
1892   the table.  (Thanks to Tum Nguyen for the patch.)
1893 - Pass +ESdbgasm only on PA-RISC machines with vendor compiler.
1894   (Thanks to Roger Sayle for the patch.)
1895 - Applied more AIX threads patches from Scott Ananian.
1896
1897Since 6.3alpha1:
1898 - Reenabled I_HOLD_LOCK assertion in aix_irix_threads.h.
1899 - Put back the WINABI qualifier for GC_CreateThread.  (Thanks to
1900   Danny Smith for the patch.  6.3alpha1 had the qualifier in one place
1901   but not elsewhere, which was clearly wrong.)
1902 - Sometimes explicitly define __private_extern__ before DARWIN dyld.h
1903   include.  (Thanks to Andreas Tobker for postting the patch.)
1904 - Included signal.h from pthread_support.c.  Removed GC_looping_handler,
1905   which was dead code.
1906 - GC_find_start was misdeclared by gc_pmark.h if PRINT_BLACK_LIST was
1907   defined.  (Thanks to Glauco Masotti for testing and reporting this.)
1908   Changed GC_find_start to never just return 0.  According to its
1909   comment it doesn't, and it's unclear that's correct.
1910 - GC_alloc_large had several largely compensating bugs in the
1911   computation of GC_words_wasted.  (It was confused about bytes vs.
1912   words in two places.)
1913 - Integrated Slava Sysoltev's patch to support more recent versions of
1914   the Intel compiler on IA64/Linux.
1915 - Changed win32 spinlock initialization to conditionally set a spin count.
1916   (Emmanual Stumpf pointed out that enabling this makes a large performance
1917   difference on win32 multiprocessors.)  Also cleaned up the win32 spinlock
1918   initialization code a bit.
1919 - Fixed thread support for HP/UX/IA64.  The register backing store base for
1920   the main thread was sometimes not set correctly.  (Thanks to Laurent
1921   Morichetti.)
1922 - Added -DEMPTY_GETENV_RESULTS flag to work around Wine problem.
1923 - Declare GC_stack_alloc and GC_stack_free in solaris_threads.h to
1924   avoid 64-bit size mismatches.  (Thanks to Bernie Solomon.)
1925 - Fixed GC_generic_push_regs to avoid a potential and very unfortunate
1926   tail call optimization.  This could lead to prematurely reclaimed
1927   objects on configurations that used the generic routine and the new
1928   build infrastructure (which potentially optimizes mach_dep.c).
1929   This was a serious bug, but it's unclear whether it has resulted in
1930   any real failures.
1931 - Fixed CORD_str to deal with signed characters.  (Thanks to Alexandr
1932   Petrosian for noticing the problem and supplying the patch.)
1933 - Merged a couple of NOSYS/ECOS tests into os_dep.c from gcj.  (Thanks
1934   to Anthony Green.)
1935 - Partially merged a win32 patch from Ben Hutchings, and substantially
1936   revised other parts of win32_threads.c.  It had several problems.
1937   Under MinGW with a statically linked library, the main thread was
1938   not registered.  Cygwin detached threads leaked thread descriptors.
1939   There were several race conditions.  For now, unfortunately the
1940   static threads limit remains, though we increased it, and made table
1941   traversal cost depend on the actual thread count.
1942   There is also still some code duplication with pthread_support.c.
1943   (Thread descriptors did become much smaller, since Ben Hutchings
1944   removed the thread context from them.)
1945 - Integrated a Solaris configure.in patch from Rainer Orth.
1946 - Added GC_IGNORE_FB and associated warning to very partially address
1947   the issue of the collector treating a mapped frame buffer as part
1948   of the root set.  (Thanks to David Peroutka for providing some
1949   insight.  More would be helpful.  Is there anything that can be used
1950   to at least partially identify such memory segments?)
1951
1952Since 6.3alpha2:
1953 - Removed -DSMALL_CONFIG from BCC_MAKEFILE.
1954 - Changed macros to test for an ARM processor (Patch from Richard Earnshaw.)
1955 - Mostly applied a DJGPP patch from Doug Kaufman.  Especially Makefile.dj
1956   had suffered from serious bit rot.
1957 - Rewrote GC_apply_to_maps, eliminating an off-by-one subscript error,
1958   and a call to alloca (for lcc compatibility).
1959 - Changed USE_MUNMAP behavior on posixy platforms to immediately remap
1960   the memory with PROT_NONE instead of unmapping it.  The latter risks
1961   an intervening mmap grabbing the address space out from underneath us.
1962   Updated this code to reflect a cleaner patch from Ulrich Drepper.
1963 - Replaced _T with _Tp in new_gc_alloc.h to avoid a MACOS X conflict.
1964   (Patch from Andrew Begel.)
1965 - Dynamically choose whether or not lock should spin on win32.  (Thanks
1966   to Maurizio Vairani for the patch.)  This may be a significant performance
1967   improvement for win32.
1968 - Fix Makefile.direct to actually include NT_STATIC_THREADS_MAKEFILE
1969   in the distribution.  (Again thanks to Maurizio Vairani.)
1970 - Maybe_install_looping_handler() was accidentally exported, violating
1971   our name space convention.
1972 - Made os_dep.c use sigsetjmp and SA_NODEFER for NetBSD.  (Thanks to
1973   Christian Limpach.)  (I generalized the patch to use sigsetjmp on all
1974   UNIX_LIKE platforms, admittedly a slightly risky move.  But it may avoid
1975   similar problems on some other platforms. I also cleaned up the defn
1976   of UNIX_LIKE a bit. - Hans)
1977 - Integrated Andrew Begel's Darwin threads patch, adjusted according to
1978   some of Fergus Hendersons's comments.  (Patch didn't apply cleanly,
1979   errors are possible.)
1980 - Added another test or two for the Intel 8.0 compiler to avoid
1981   confusing it with gcc.  The single-threaded collector should now build
1982   with icc, at least on ia64.
1983
1984Since 6.3alpha3:
1985 - USE_MMAP was broken by confusion in the code dealing with USE_MMAP_ANON.
1986   (This was pointed out, and fixes were suggested by several other people.)
1987 - Darwin supprt was broken in alpha3 as a result of my misintegration of
1988   Andrew Begel's patches.  Fixed with another patch from Andrew Begel.
1989 - A new sanity check in pthread_stop_world.c:GC_push_all_stacks() was
1990   overly aggressive.  We may collect from an unregistered thread during
1991   thread creation.  Fixed by explicitly checking for that case.  (Added
1992   GC_in_thread_creation.)
1993
1994Since 6.3alpha4:
1995 - Fix & vs && typo in GC_generic_malloc and
1996   GC_generic_malloc_ignore_off_page.  (Propagated from the gcc tree.)
1997 - Removed SA_NODEFER hack from NetBSD and Solaris write-protect handler.
1998   (According to Christian Limpach, the NetBSD problem is fixed.
1999   Presumably so is the Solaris 2.3 problem.)
2000 - Removed placement delete from gc_cpp.h for the SGI compiler.
2001   (Thanks to Simon Gornall for the patch.)
2002 - Changed semantics of the GC_IGNORE_FB environment variable, based
2003   on experimentation by Nicolas Cannasse pointing out that the old
2004   interpretation was useless.  We still need help in identifying win32
2005   graphics memory mappings.  The current "solution" is a hack.
2006 - Removed "MAKEOVERRIDES =" from Makefile.am and thus Makefile.in.
2007   It probably made more sense in the gcc context.
2008 - Explicitly ensure that NEED_FIND_LIMIT is defined for {Open,Net}BSD/ELF.
2009 - Replaced USE_HPUX_TLS macro by USE_COMPILER_TLS, since gcc often
2010   supports the same extension on various platforms.
2011 - Added some basic (completely untested) defines for win64, in support
2012   of future work.
2013 - Declared GC_jmp_buf in os_dep.s as JMP_BUF instead of jmp_buf, fixing
2014   a memory overwrite bug on Solaris and perhaps other platforms.
2015 - Added 0 != __libc_stack_end test to GC_linux_stack_base.  (Thanks to Jakub
2016   Jelinek, both for the patch, and for explaining the problem to me.)
2017   Otherwise "prelink"ing could cause the collector to fail.
2018 - Changed default thread local storage implementation to USE_PTHREAD_SPECIFIC
2019   for HP/UX with gcc.  The compiler-based implementation appears to work
2020   only with the vendor compiler.
2021 - Export GC_debug_header_size and GC_USR_PTR_FROM_BASE from gc_mark.h,
2022   making client mark code cleaner and less dependent on GC version.
2023 - Export several new procedures and GC_generic_malloc from gc_mark.h
2024   to support user-defined kinds.  Use the new procedures to replace existing
2025   code in gcj_mlc.c and typd_mlc.c.
2026 - Added support for GC_BACKTRACES.
2027 - Fixed a remaining problem in CORD_str with signed characters.  (Thanks
2028   to Alexandr Petrosian for the patch.)
2029 - Removed supposedly redundant, but very buggy, definitions of finalizer
2030   macros from javaxfc.h.  Fortunately this file probably has no users.
2031   The correct declarations were already in gc.h.
2032 - Also need to set GC_in_thread_creation while waiting for GC during
2033   thread termination, since it is also possible to collect from an
2034   unregistered thread in that case.
2035 - Define NO_GETENV for Windows CE, since getenv doesn't appear to exist.
2036   + some other minor WinCE fixes. (Thanks to Alain Novak.)
2037 - Added GC_register_describe_type_fn.
2038 - Arrange for debugging finalizer registration to ignore non-heap
2039   registrations, since the regular version of the routine also behaves
2040   that way.
2041 - GC_gcj_malloc and friends need to check for finalizers waiting to be run.
2042   One of the more obscure allocation routines with missing a LOCK() call.
2043 - Fixed cvtres invocations in NT_MAKEFILE and NT_STATIC_THREADS_MAKEFILE
2044   to work with VS.NET.
2045 - Cleaned up GC_INIT calls in test.  Updated gc.man to encourage GC_INIT
2046   use in portable code.
2047 - Taught the GC to use libunwind if --enable-full-debug is specified on
2048   IA64 and libunwind is present.
2049 - The USE_MUNMAP code could get confused about the age of a block and
2050   prematurely unmap it.  GC_unmap_old had a bug related to wrapping of
2051   GC_gc_no.  GC_freehblk and GC_merge_unmapped didn't maintain
2052   hb_last_reclaimed reasonably when blocks were merged.  The code was
2053   fixed to reflect original intent, but that may not always be an
2054   improvement.  See todo list item.
2055
2056Since 6.3alpha5:
2057 - Define USE_GENERIC_PUSH_REGS for NetBSD/M68K.
2058 - Fixed the X86_64 PREFETCH macros to correctly handle ia32e (which uses
2059   different prefetch instructions from AMD64).  (Thanks to H.J. Lu.)
2060 - GC_config_macros.h did not correctly define GC_WIN32_THREADS from
2061   GC_THREADS.
2062 - Added simple_example.html.
2063 - Merged Andrew Gray's patch to correctly restore signal handlers on
2064   FreeBSD.
2065 - Merged a patch from Andreas Jaeger to deal with prefetch-related warnings
2066   on x86-64.  Added some other casts so that the PREFETCH macros
2067   always get a ptr_t argument.  Removed some casts inthe PREFETCH
2068   implementations.
2069 - At Jesse Jones suggestion: Added a header guard for gc_allocator.h
2070   and changed GC_debug_free to clobber contents of deallocated object.
2071 - The signal masking code in pthread_stop_world.c contained some errors.
2072   In particular SIGSEGV was masked in the handler, in spite of the fact that
2073   it wrote to the heap.  This could lead to an uncaught SIGSEGV, which
2074   apparently became much more likely in Linux 2.6.  Also fixed some
2075   typos, and reduced code duplication in the same area.
2076 - Remove ltconfig, clean up configure messages for DGUX (thanks to
2077   Adrian Bunk for the patches).
2078 - Integrated NetBSD/OpenBSD patches from Marc Recht and Matthias Drochner.
2079
2080Since gc6.3alpha6:
2081 - Compile test_cpp.cc with CXXCOMPILE instead of COMPILE.
2082 - Very large allocations could cause a collector hang.  Correct
2083   calculation of GC_collect_at_heapsize.
2084 - GC_print_hblkfreelist printed some bogus results if USE_MUNMAP
2085   was defined.
2086 - The generic GC_THREADS macro didn't work correctly on Solaris,
2087   since the implementation failed to include gc_config_macros.h
2088   before deciding whether or not to compile the rest of the file.
2089 - Threadlibs.c failed to expand the generic GC_THREADS macro.
2090 - Correct MacOSX thread stop code. (Thanks to Dick Porter.)
2091 - SMALL_OBJ definition was off by one.  This could cause crashes
2092   at startup.  (Thanks to Zoltan Varga for narrowing this down to
2093   a trivial test case.)
2094 - Integrate Paolo Molara's patch to deal with a race in the Darwin
2095   thread stopping code.
2096 - Changed X86_64 implementation to use SA_SIGINFO in the MPROTECT_VDB
2097   implementation.  The old approach appears to have been broken by
2098   recent kernels.
2099 - Add GC_ATTR_UNUSED to eliminate a warning in gc_allocator.h.  (Thanks
2100   to Andrew Begel.)
2101 - Fix GC_task_self declaration in os_dep.c.  (Thanks to Andrew Pinski.)
2102 - Increase INITIAL_BUF_SZ in os_dep.c for Solaris /proc reads.
2103
2104Since 6.3:
2105 - Merge gcconfig.h changes from gcc tree.
2106 - Unconditionally include gc_priv.h in solaris_pthreads.c, win32_threads.h,
2107   aix_irix_threads.c, and solaris_threads.c to get thread definitions.
2108 - Start marker threads in GC_thr_init, so that they get started even
2109   if no other threads are ever started.  (Oddly enough, the parallel
2110   collector worked correctly, though not well, with no helper threads.)
2111 - Go ahead and split large blocks in GC_allochblk_nth if GC_dont_gc
2112   is set.  (Thanks to Alexander Petrossian.)
2113 - GC_PRINT_BACK_HEIGHT would deadlock with thread support.
2114 - Let in_progress_space in backgraph.s grow dynamically.
2115 - Fix README.solaris2.  The GC_thr_init() hack doesn't work anymore.
2116 - Convert GC_finalizer_mem_freed to bytes in allchblk.c.
2117 - Add missing declaration for GC_generic_malloc_words_small_inner.
2118   Without it, s390x breaks.  (Thanks to Ulrich Weigand.)
2119 - Applied several MacOSX patches to support older tool chains.
2120   (Thanks to Stefan Ring.)
2121 - Bug fix for NetBSD/amd64.  (Thanks to Marc Recht.)  Add NetBSD/sh3
2122   support.  (Thanks to Uchiyama Yasushi.)
2123 - Fixed an uninitialized variable in cordprnt.c.  (Thanks to gcc for
2124   providing the warning.)
2125 - Eliminated some, but not all, gcc -Wall warnings.
2126 - Changed some old style casts to reinterpret_cast in new_gc_alloc.h.
2127   (Thanks to Dan Grayson.)
2128 - GC_extend_size_map shouldn't adjust for GC_all_interior_pointers if
2129   GC_DONT_ADD_BYTE_AT_END is set.
2130 - Changed some (long) casts to (word) in preparation for win64.
2131   (Thanks to Peter Colson.)
2132 - Changed "int stack_size" declaration in pthread_support.c to use
2133   size_t.  (Only mattered with GC_ASSERTIONS enabled.)
2134 - Added CRIS (etrax) support.  (Thanks to Simon Posnjak and
2135   Hans-Peter Nilsson.)
2136 - Removed GC_IGNORE_FB frame buffer recognition, and replaced
2137   it with a check that the mapping type is MEM_IMAGE.
2138   In theory, this should work much better, but it is a high
2139   risk change for win32.  (Thanks to Ashley Bone for the crucial
2140   experimental data behind this, and to Rutger Ovidus for
2141   some further experiments.)
2142 - Fixed print_block_list to print the correct kind number for
2143   STUBBORN.  (Thanks to Rutger Ovidus.)
2144 - GC_allochblk_nth incremented GC_words_wasted by bytes rather than
2145   words.
2146 - Consider GC_words_wasted in GC_adj_words_allocd only if it is within
2147   reason.  (A hack to avoid some extremely unlikely scenarios in which
2148   we manage to allocate only "wasted" space.  7.0 has a better fix.)
2149 - Changed PowerPC GC_clear implementation to use lwsync instead of
2150   eieio, since the documentation recommends against eieio, and
2151   it seems to be incorrect if the preceding memory op is a load.
2152 - Fixed print_block_list to print the correct kind number for
2153   STUBBORN.  (Thanks to Rutger Ovidus.)
2154 - Have configure.in generate an error if it is asked to support
2155   pthreads, but doesn't know how to.
2156 - Added Kazuhiro Inaoka's patch for Renesas M32R support.
2157 - Have the GNU build mechanism link with -ldl.  Rename THREADLIBS
2158   to THREADDLLIBS to reflect this.  (Thanks to Sven Verdoolaege.)
2159 - Added Hannes Mehnert's patch for FreeBSD/SPARC support.
2160 - Merged some FreeBSD specific patches to threadlibs.c and dyn_load.c.
2161   (Thanks tp John Merryweather Cooper.)
2162 - Define MPROTECT_VDB on MACOSX only if threads are being used, since the
2163   dirty page tracking mechanism uses threads.  (This avoids an undefined
2164   reference to _GC_darwin_register_mach_handler_thread.)
2165 - By popular demand, use __libc symbols only if we are built with
2166   USE_LIBC_PRIVATES, which is off by default, and not otherwise documented.
2167 - Ignore GC_enable_incremental() requests when KEEP_BACK_PTRS is set.
2168   The GC itself will dirty lots of pages in this cases, probably making
2169   it counterproductive on all platforms.  And the DARWIN port crashes.
2170
2171Since GC6.4:
2172 - Integrated Paolo Molaro's patch to deal with EINTR in sem_wait.
2173 - Make GC_approx_sp() write to dummy location to ensure that stack
2174   is grown here, when sp looks reasonable, rather than later, when
2175   it might look like a bad memory reference.  (Problem was never
2176   observed that I know of.  But on rereading the code it seemed
2177   dubious.)
2178 - Separate out GC_with_callee_saves_pushed and sometimes call
2179   it from GC_suspend_handler in pthread_stop_world.c.  Callee-save
2180   register values sometimes failed to get traced under HP/UX on
2181   PA-RISC.  Linux/IA64 had the same problem, though non-stacked
2182   callee-save registers seem to be so rarely used there that nobody
2183   ever noticed.
2184 - Integrated an ancient Darwin powerpc_darwin_machine_dep.s patch
2185   from Andreas Tobler, which I had lost.
2186 - Fix compare_and_exchange implementation for gcc/IA64 to deal with
2187   pickier compiler versions.
2188 - Fixed Itanium 32-bit ABI support (HP/UX).  In particular, the
2189   compare_and_exchange implementation didn't consider that possibility.
2190 - Undefine GC_pthread_detach in win32_threads.c.  (Thanks to
2191   Tagliapietra Tommaso.)
2192 - Fixed inclusion of frame.h for NETBSD in os_dep.c.
2193 - Applied Dan Bonachea's patch to use mmap on AIX.
2194 - Several fixes to resurrect the Irix port on recent OS versions.
2195 - Change ALPHA to use LINUX_STACKBOTTOM.
2196 - Change SPARC64/LINUX to also use LINUX_STACKBOTTOM.  Deal with potential
2197   bad values of __libc_stack_end on that platform.  (Thanks to David Miller.)
2198 - Relax gctest to allow larger heap if ALIGN_DOUBLE isn't set.
2199   (Unnecessary in 7.0)
2200 - Force a define of __STDC__=0 for the IBM compiler on AIX, so that
2201   we get prototypes.  (Unnecessary in 7.0)
2202 - GC_INIT definition for AIX and CYGWIN referred to DATASTART and DATAEND
2203   which are only defined in private include files.
2204 - Integrated some small gcconfig.h patches from Dan Bonachea.  Also
2205   relaxed assertion about FreeBSD stack size in pthread_support.c.
2206 - Integrated Andrew Begel's darwin_stop_world.c patch for 64-bit
2207   support.  This may need additional work.
2208 - Avoided potentially infinite recursion in GC_save_callers if
2209   the system backtrace calls malloc.  The workaround currently requires
2210   __thread support if this code is used with threads.
2211 - Avoided another similar infinite recursion by conditionally
2212   invoking GC_save_callers in alloc.c.  (Thanks to Matthias Andree
2213   for helping to track down both of these.)
2214 - Removed all traces of aix_irix_threads.c.  AIX and Irix now use
2215   pthread_support.c and pthread_stop_world.c.  The old code appeared
2216   to be unreliable for AIX, and was not regularly maintained.
2217 - On Irix, ignore segments with MA_FETCHOP or MA_NOTCACHED attributed;
2218   they're not always safe to read.
2219 - Fixed a previously vacuous assertion (diagnosed by the SGI compiler)
2220   in GC_remove_from_fl.
2221 - Fix stack_size assertion in GC_pthread_create.
2222 - Fix assertion in GC_steal_mark_stack.
2223
2224Since 6.5
2225 - Fix CPU count detection for Irix and FreeBSD. (Thanks to Dan Bonachea.)
2226 - Integrate Dan Bonachea's patch for the IBM XLC compiler on Darwin.
2227 - Integrated Andreas Tobler's FreeBSD/PowerPC patch.
2228 - Don't access the GC thread structure from the restart handler.  It's
2229   unsafe, since the handler may run too late.  (Thanks to Ben Maurer for
2230   tracking this down.)
2231 - Applied Christian Thalinger's patch to change comment syntax in
2232   alpha_mach_dep.S.
2233 - Added test for GC_no_dls in GC_dyld_image_add for DARWIN. (Thanks to
2234   Juan Jose Garcia Ripoli).
2235 - Use LINUX_STACKBOTTOM for Linux/SH and LINUX/ARM. (Thanks to Sugioka
2236   Toshinobu and Christian Thalinger.)
2237 - Rewrote GC_parse_map_entry.  This assumed a fixed column layout of
2238   /proc/self/maps on Linux.  This ceased to be true about 2 years ago.
2239   The old code is probably quite problemetic with -DREDIRECT_MALLOC.  It
2240   is also used by default for IA64, though I haven't seen actual failures
2241   there.
2242 - More consistently define HBLKSIZE to 4096 on 64 bit architectures with
2243   4K pages.  (Thanks to Andrew Haley.)
2244 - With win32 threads, GC_stop_world needs to acquire GC_write_cs.  (Thanks
2245   to Ben Hutchings for the observation and patch.)
2246 - Move up struct callinfo declaration to make gcc 4.0.2. happy.
2247
2248To do:
2249 - The USE_MUNMAP code should really use a separate data structure
2250   indexed by physical page to keep track of time since last use of
2251   a page.  Using hblk headers means we lose track of ages when
2252   blocks are merged, and we can't unmap pages that have been allocated and
2253   dropped by the blacklisting code.  I suspect both of these matter.
2254 - A dynamic libgc.so references dlopen unconditionally, but doesn't link
2255   against libdl.
2256 - GC_proc_fd for Solaris is not correctly updated in response to a
2257   fork() call.  Thus incremental collection in the child won't work
2258   correctly.  (Thanks to Ben Cottrell for pointing this out.)
2259 - --enable-redirect-malloc is mostly untested and known not to work
2260   on some platforms.
2261 - There seem to be outstanding issues on Solaris/X86, possibly with
2262   finding the data segment starting address.  Information/patches would
2263   be appreciated.
2264 - Very large root set sizes (> 16 MB or so) could cause the collector
2265   to abort with an unexpected mark stack overflow.  (Thanks again to
2266   Peter Chubb.)  NOT YET FIXED.  Workaround is to increase the initial
2267   size.
2268 - The SGI version of the collector marks from mmapped pages, even
2269   if they are not part of dynamic library static data areas.  This
2270   causes performance problems with some SGI libraries that use mmap
2271   as a bitmap allocator.  NOT YET FIXED.  It may be possible to turn
2272   off DYNAMIC_LOADING in the collector as a workaround.  It may also
2273   be possible to conditionally intercept mmap and use GC_exclude_static_roots.
2274   The real fix is to walk rld data structures, which looks possible.
2275 - Incremental collector should handle large objects better.  Currently,
2276   it looks like the whole object is treated as dirty if any part of it
2277   is.
2278
2279

README.contributors

1This is an attempt to acknowledge early contributions to the garbage
2collector.  Later contributions should instead be mentioned in
3README.changes.
4
5HISTORY -
6
7  Early versions of this collector were developed as a part of research
8projects supported in part by the National Science Foundation
9and the Defense Advance Research Projects Agency.
10
11The garbage collector originated as part of the run-time system for
12the Russell programming language implementation. The first version of the
13garbage collector was written primarily by Al Demers.  It was then refined
14and mostly rewritten, primarily by Hans-J. Boehm, at Cornell U.,
15the University of Washington, Rice University (where it was first used for
16C and assembly code), Xerox PARC, SGI, and HP Labs.  However, significant
17contributions have also been made by many others.
18
19Some other contributors:
20
21More recent contributors are mentioned in the modification history in
22README.changes.  My apologies for any omissions.
23
24The SPARC specific code was originally contributed by Mark Weiser.
25The Encore Multimax modifications were supplied by
26Kevin Kenny (kenny@m.cs.uiuc.edu).  The adaptation to the IBM PC/RT is largely
27due to Vernon Lee, on machines made available to Rice by IBM.
28Much of the HP specific code and a number of good suggestions for improving the
29generic code are due to Walter Underwood.
30Robert Brazile (brazile@diamond.bbn.com) originally supplied the ULTRIX code.
31Al Dosser (dosser@src.dec.com) and Regis Cridlig (Regis.Cridlig@cl.cam.ac.uk)
32subsequently provided updates and information on variation between ULTRIX
33systems.  Parag Patel (parag@netcom.com) supplied the A/UX code.
34Jesper Peterson(jep@mtiame.mtia.oz.au), Michel Schinz, and
35Martin Tauchmann (martintauchmann@bigfoot.com) supplied the Amiga port.
36Thomas Funke (thf@zelator.in-berlin.de(?)) and
37Brian D.Carlstrom (bdc@clark.lcs.mit.edu) supplied the NeXT ports.
38Douglas Steel (doug@wg.icl.co.uk) provided ICL DRS6000 code.
39Bill Janssen (janssen@parc.xerox.com) supplied the SunOS dynamic loader
40specific code. Manuel Serrano (serrano@cornas.inria.fr) supplied linux and
41Sony News specific code.  Al Dosser provided Alpha/OSF/1 code.  He and
42Dave Detlefs(detlefs@src.dec.com) also provided several generic bug fixes.
43Alistair G. Crooks(agc@uts.amdahl.com) supplied the NetBSD and 386BSD ports.
44Jeffrey Hsu (hsu@soda.berkeley.edu) provided the FreeBSD port.
45Brent Benson (brent@jade.ssd.csd.harris.com) ported the collector to
46a Motorola 88K processor running CX/UX (Harris NightHawk).
47Ari Huttunen (Ari.Huttunen@hut.fi) generalized the OS/2 port to
48nonIBM development environments (a nontrivial task).
49Patrick Beard (beard@cs.ucdavis.edu) provided the initial MacOS port.
50David Chase, then at Olivetti Research, suggested several improvements.
51Scott Schwartz (schwartz@groucho.cse.psu.edu) supplied some of the
52code to save and print call stacks for leak detection on a SPARC.
53Jesse Hull and John Ellis supplied the C++ interface code.
54Zhong Shao performed much of the experimentation that led to the
55current typed allocation facility.  (His dynamic type inference code hasn't
56made it into the released version of the collector, yet.)
57
58

README.cords

1Copyright (c) 1993-1994 by Xerox Corporation.  All rights reserved.
2
3THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
4OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
5
6Permission is hereby granted to use or copy this program
7for any purpose,  provided the above notices are retained on all copies.
8Permission to modify the code and to distribute modified code is granted,
9provided the above notices are retained, and a notice that the code was
10modified is included with the above copyright notice.
11
12Please send bug reports to Hans-J. Boehm (Hans_Boehm@hp.com or
13boehm@acm.org).
14
15This is a string packages that uses a tree-based representation.
16See cord.h for a description of the functions provided.  Ec.h describes
17"extensible cords", which are essentially output streams that write
18to a cord.  These allow for efficient construction of cords without
19requiring a bound on the size of a cord.
20
21More details on the data structure can be found in
22
23Boehm, Atkinson, and Plass, "Ropes: An Alternative to Strings",
24Software Practice and Experience 25, 12, December 1995, pp. 1315-1330.
25
26A fundamentally similar "rope" data structure is also part of SGI's standard
27template library implementation, and its descendents, which include the
28GNU C++ library.  That uses reference counting by default.
29There is a short description of that data structure at
30http://reality.sgi.com/boehm/ropeimpl.html .  (The more official location
31http://www.sgi.com/tech/stl/ropeimpl.html is missing a figure.)
32
33All of these are descendents of the "ropes" in Xerox Cedar.
34
35de.c is a very dumb text editor that illustrates the use of cords.
36It maintains a list of file versions.  Each version is simply a
37cord representing the file contents.  Nonetheless, standard
38editing operations are efficient, even on very large files.
39(Its 3 line "user manual" can be obtained by invoking it without
40arguments.  Note that ^R^N and ^R^P move the cursor by
41almost a screen.  It does not understand tabs, which will show
42up as highlighred "I"s.  Use the UNIX "expand" program first.)
43To build the editor, type "make cord/de" in the gc directory.
44
45This package assumes an ANSI C compiler such as gcc.  It will
46not compile with an old-style K&R compiler.
47
48Note that CORD_printf iand friends use C functions with variable numbers
49of arguments in non-standard-conforming ways.  This code is known to
50break on some platforms, notably PowerPC.  It should be possible to
51build the remainder of the library (everything but cordprnt.c) on
52any platform that supports the collector.
53
54

README.darwin

16.5 update:
2I disabled incremental GC on Darwin in this version, since I couldn't
3get gctest to pass when the GC was built as a dynamic library.  Building
4with -DMPROTECT_VDB (and threads) on the command line should get you
5back to the old state.			- HB
6
7./configure --enable-cplusplus results in a "make check" failure, probably
8because the ::delete override ends up in a separate dl, and Darwin dynamic
9loader semantics appear to be such that this is not really visible to the
10main program, unlike on ELF systems.  Someone who understands dynamic
11loading needs to lookat this.  For now, gc_cpp.o needs to be linked
12statically, if needed.			- HB
13
14Darwin/MacOSX Support - December 16, 2003
15=========================================
16
17Important Usage Notes
18=====================
19
20GC_init() MUST be called before calling any other GC functions. This
21is necessary to properly register segments in dynamic libraries. This
22call is required even if you code does not use dynamic libraries as the
23dyld code handles registering all data segments.
24
25When your use of the garbage collector is confined to dylibs and you
26cannot call GC_init() before your libraries' static initializers have
27run and perhaps called GC_malloc(), create an initialization routine
28for each library to call GC_init():
29
30#include <gc/gc.h>
31extern "C" void my_library_init() { GC_init(); }
32
33Compile this code into a my_library_init.o, and link it into your
34dylib. When you link the dylib, pass the -init argument with
35_my_library_init (e.g. gcc -dynamiclib -o my_library.dylib a.o b.o c.o
36my_library_init.o -init _my_library_init). This causes
37my_library_init() to be called before any static initializers, and
38will initialize the garbage collector properly.
39
40Note: It doesn't hurt to call GC_init() more than once, so it's best,
41if you have an application or set of libraries that all use the
42garbage collector, to create an initialization routine for each of
43them that calls GC_init(). Better safe than sorry.
44
45The incremental collector is still a bit flaky on darwin. It seems to
46work reliably with workarounds for a few possible bugs in place however
47these workaround may not work correctly in all cases. There may also
48be additional problems that I have not found.
49
50Thread-local GC allocation will not work with threads that are not
51created using the GC-provided override of pthread_create(). Threads
52created without the GC-provided pthread_create() do not have the
53necessary data structures in the GC to store this data.
54
55
56Implementation Information
57==========================
58Darwin/MacOSX support is nearly complete. Thread support is reliable on
59Darwin 6.x (MacOSX 10.2) and there have been reports of success on older
60Darwin versions (MacOSX 10.1). Shared library support had also been
61added and the gc can be run from a shared library. There is currently only
62support for Darwin/PPC although adding x86 support should be trivial.
63
64Thread support is implemented in terms of mach thread_suspend and
65thread_resume calls. These provide a very clean interface to thread
66suspension. This implementation doesn't rely on pthread_kill so the
67code works on Darwin < 6.0 (MacOSX 10.1). All the code to stop and
68start the world is located in darwin_stop_world.c.
69
70Since not all uses of the GC enable clients to override pthread_create()
71before threads have been created, the code for stopping the world has
72been rewritten to look for threads using Mach kernel calls. Each
73thread identified in this way is suspended and resumed as above. In
74addition, since Mach kernel threads do not contain pointers to their
75stacks, a stack-walking function has been written to find the stack
76limits. Given an initial stack pointer (for the current thread, a
77pointer to a stack-allocated local variable will do; for a non-active
78thread, we grab the value of register 1 (on PowerPC)), it
79will walk the PPC Mach-O-ABI compliant stack chain until it reaches the
80top of the stack. This appears to work correctly for GCC-compiled C,
81C++, Objective-C, and Objective-C++ code, as well as for Java
82programs that use JNI. If you run code that does not follow the stack
83layout or stack pointer conventions laid out in the PPC Mach-O ABI,
84then this will likely crash the garbage collector.
85
86The original incremental collector support unfortunatelly no longer works
87on recent Darwin versions. It also relied on some undocumented kernel
88structures. Mach, however, does have a very clean interface to exception
89handing. The current implementation uses Mach's exception handling.
90
91Much thanks goes to Andrew Stone, Dietmar Planitzer, Andrew Begel,
92Jeff Sturm, and Jesse Rosenstock for all their work on the
93Darwin/OS X port.
94
95-Brian Alliet
96brian@brianweb.net
97
98
99Older Information (Most of this no longer applies to the current code)
100======================================================================
101
102While the GC should work on MacOS X Server, MacOS X and Darwin, I only tested
103it on MacOS X Server.
104I've added a PPC assembly version of GC_push_regs(), thus the setjmp() hack is
105no longer necessary. Incremental collection is supported via mprotect/signal.
106The current solution isn't really optimal because the signal handler must decode
107the faulting PPC machine instruction in order to find the correct heap address.
108Further, it must poke around in the register state which the kernel saved away
109in some obscure register state structure before it calls the signal handler -
110needless to say the layout of this structure is no where documented.
111Threads and dynamic libraries are not yet supported (adding dynamic library
112support via the low-level dyld API shouldn't be that hard).
113
114The original MacOS X port was brought to you by Andrew Stone.
115
116
117June, 1 2000
118
119Dietmar Planitzer
120dave.pl@ping.at
121
122Note from Andrew Begel:
123
124One more fix to enable gc.a to link successfully into a shared library for
125MacOS X. You have to add -fno-common to the CFLAGS in the Makefile. MacOSX
126disallows common symbols in anything that eventually finds its way into a
127shared library. (I don't completely understand why, but -fno-common seems to
128work and doesn't mess up the garbage collector's functionality).
129
130Feb 26, 2003
131
132Jeff Sturm and Jesse Rosenstock provided a patch that adds thread support.
133GC_MACOSX_THREADS should be defined in the build and in clients.  Real
134dynamic library support is still missing, i.e. dynamic library data segments
135are still not scanned.  Code that stores pointers to the garbage collected
136heap in statically allocated variables should not reside in a dynamic
137library.  This still doesn't appear to be 100% reliable.
138
139Mar 10, 2003
140Brian Alliet contributed dynamic library support for MacOSX.  It could also
141use more testing.
142

README.dj

1[Original version supplied by Xiaokun Zhu <xiaokun@aero.gla.ac.uk>]
2[This version came mostly from Gary Leavens.			  ]
3
4Look first at Makefile.dj, and possibly change the definitions of
5RM and MV if you don't have rm and mv installed.
6Then use Makefile.dj to compile the garbage collector.
7For example, you can do:
8
9	make -f Makefile.dj test
10
11All the tests should work fine.
12
13

README.environment

1The garbage collector looks at a number of environment variables which are
2then used to affect its operation.  These are examined only on Un*x-like
3platforms and win32.
4
5GC_INITIAL_HEAP_SIZE=<bytes> -	Initial heap size in bytes.  May speed up
6				process start-up.
7
8GC_MAXIMUM_HEAP_SIZE=<bytes> - Maximum collected heap size.
9
10GC_LOOP_ON_ABORT - Causes the collector abort routine to enter a tight loop.
11		   This may make it easier to debug, such a process, especially
12		   for multithreaded platforms that don't produce usable core
13		   files, or if a core file would be too large.  On some
14		   platforms, this also causes SIGSEGV to be caught and
15		   result in an infinite loop in a handler, allowing
16		   similar debugging techniques.
17
18GC_PRINT_STATS - Turn on as much logging as is easily feasible without
19		 adding signifcant runtime overhead.  Doesn't work if
20		 the collector is built with SMALL_CONFIG.  Overridden
21		 by setting GC_quiet.  On by default if the collector
22		 was built without -DSILENT.
23
24GC_DUMP_REGULARLY - Generate a GC debugging dump GC_dump() on startup
25		    and during every collection.  Very verbose.  Useful
26		    if you have a bug to report, but please include only the
27		    last complete dump.
28
29GC_BACKTRACES=<n> - Generate n random backtraces (for heap profiling) after
30		    each GC.  Collector must have been built with
31		    KEEP_BACK_PTRS.  This won't generate useful output unless
32		    most objects in the heap were allocated through debug
33		    allocators.  This is intended to be only a statistical
34		    sample;  individual traces may be erroneous due to
35		    concurrent heap mutation.
36
37GC_PRINT_ADDRESS_MAP - Linux only.  Dump /proc/self/maps, i.e. various address
38		       maps for the process, to stderr on every GC.  Useful for
39		       mapping root addresses to source for deciphering leak
40		       reports.
41
42GC_NPROCS=<n> - Linux w/threads only.  Explicitly sets the number of processors
43	        that the GC should expect to use.  Note that setting this to 1
44		when multiple processors are available will preserve
45		correctness, but may lead to really horrible performance,
46		since the lock implementation will immediately yield without
47		first spinning.
48
49GC_MARKERS=<n> - Linux w/threads and parallel marker only.  Set the number
50		of marker threads.  This is normaly set to the number of
51		processors.  It is safer to adjust GC_MARKERS than GC_NPROCS,
52		since GC_MARKERS has no impact on the lock implementation.
53
54GC_NO_BLACKLIST_WARNING - Prevents the collector from issuing
55		warnings about allocations of very large blocks.
56		Deprecated.  Use GC_LARGE_ALLOC_WARN_INTERVAL instead.
57
58GC_LARGE_ALLOC_WARN_INTERVAL=<n> - Print every nth warning about very large
59		block allocations, starting with the nth one.  Small values
60		of n are generally benign, in that a bounded number of
61		such warnings generally indicate at most a bounded leak.
62		For best results it should be set at 1 during testing.
63		Default is 5.  Very large numbers effectively disable the
64		warning.
65
66GC_IGNORE_GCJ_INFO - Ignore the type descriptors implicitly supplied by
67		     GC_gcj_malloc and friends.  This is useful for debugging
68		     descriptor generation problems, and possibly for
69		     temporarily working around such problems.  It forces a
70		     fully conservative scan of all heap objects except
71		     those known to be pointerfree, and may thus have other
72		     adverse effects.
73
74GC_PRINT_BACK_HEIGHT - Print max length of chain through unreachable objects
75		     ending in a reachable one.  If this number remains
76		     bounded, then the program is "GC robust".  This ensures
77		     that a fixed number of misidentified pointers can only
78		     result in a bounded space leak.  This currently only
79		     works if debugging allocation is used throughout.
80		     It increases GC space and time requirements appreciably.
81		     This feature is still somewhat experimental, and requires
82		     that the collector have been built with MAKE_BACK_GRAPH
83		     defined.  For details, see Boehm, "Bounding Space Usage
84		     of Conservative Garbage Collectors", POPL 2001, or
85		     http://lib.hpl.hp.com/techpubs/2001/HPL-2001-251.html .
86
87GC_RETRY_SIGNALS, GC_NO_RETRY_SIGNALS - Try to compensate for lost
88		     thread suspend signals in linux_threads.c.  On by
89		     default for GC_OSF1_THREADS, off otherwise.  Note
90		     that this does not work around a possible loss of
91		     thread restart signals.  This seems to be necessary for
92		     some versions of Tru64.  Since we've previously seen
93		     similar issues on some other operating systems, it
94		     was turned into a runtime flag to enable last-minute
95		     work-arounds.
96
97GC_IGNORE_FB[=<n>] -  (Win32 only.) Try to avoid treating a mapped
98		frame buffer as part of the root set.  Certain (higher end?)
99		graphics cards seems to result in the graphics memory mapped
100		into the user address space as writable memory.
101		Unfortunately, there seems to be no systematic way to
102		identify such memory.  Setting the environment variable to n
103		causes the collector to ignore mappings longer than n MB.
104		The default value of n is currently 15.  (This should cover
105		a 16 MB graphics card, since the mapping appears to be slightly
106		shorter than all of graphics memory.  It will fail if a dll
107		writes pointers to collectable objects into a data segment
108		whose length is >= 15MB.  Empirically that's rare, but
109		certainly possible.)  WARNING: Security sensitive applications
110		should probably disable this feature by setting
111		GC_disallow_ignore_fb, or by building with -DNO_GETENV,
112		since small values could force collection of reachable
113		objects, which is conceivably a	(difficult to exploit)
114		security hole.  GC_IGNORE_FB values less than 3 MB
115		are never honored, eliminating this risk for most,
116		but not all, applications.  This feature is likely to disappear
117		if/when we find a less disgusting "solution".
118		IN VERSION 6.4 AND LATER, THIS SHOULD BE UNNECESSARY.
119
120The following turn on runtime flags that are also program settable.  Checked
121only during initialization.  We expect that they will usually be set through
122other means, but this may help with debugging and testing:
123
124GC_ENABLE_INCREMENTAL - Turn on incremental collection at startup.  Note that,
125		     depending on platform and collector configuration, this
126		     may involve write protecting pieces of the heap to
127		     track modifications.  These pieces may include pointerfree
128		     objects or not.  Although this is intended to be
129		     transparent, it may cause unintended system call failures.
130		     Use with caution.
131
132GC_PAUSE_TIME_TARGET - Set the desired garbage collector pause time in msecs.
133		     This only has an effect if incremental collection is
134		     enabled.  If a collection requires appreciably more time
135		     than this, the client will be restarted, and the collector
136		     will need to do additional work to compensate.  The
137		     special value "999999" indicates that pause time is
138		     unlimited, and the incremental collector will behave
139		     completely like a simple generational collector.  If
140		     the collector is configured for parallel marking, and
141		     run on a multiprocessor, incremental collection should
142		     only be used with unlimited pause time.
143
144GC_FIND_LEAK - Turns on GC_find_leak and thus leak detection.  Forces a
145	       collection at program termination to detect leaks that would
146	       otherwise occur after the last GC.
147
148GC_ALL_INTERIOR_POINTERS - Turns on GC_all_interior_pointers and thus interior
149			   pointer recognition.
150
151GC_DONT_GC - Turns off garbage collection.  Use cautiously.
152

README.ews4800

1GC on EWS4800
2-------------
3
41. About EWS4800
5   EWS4800 is 32bit/64bit workstation.
6
7     Vender: NEC Corporation
8     OS: UX/4800 R9.* - R13.* (SystemV R4.2)
9     CPU: R4000, R4400, R10000 (MIPS)
10
112. Compiler
12
13 32bit:
14   Use ANSI C compiler.
15     CC = /usr/abiccs/bin/cc
16
17 64bit:
18   Use 64bit ANSI C compiler.
19     CC = /usr/ccs64/bin/cc
20     AR = /usr/ccs64/bin/ar
21
223. ELF file format
23   *** Caution: The following infomation is empirical. ***
24
25 32bit:
26   ELF file has an unique format. (See a.out(4) and end(3C).)
27
28     &_start
29        :      text segment
30     &etext
31     DATASTART
32        :      data segment (initialized)
33     &edata
34     DATASTART2
35        :      data segment (uninitialized)
36     &end
37
38   Here, DATASTART and DATASTART2 are macros of GC, and are defined as
39   the following equations. (See include/private/gcconfig.h.)
40   The algorithm for DATASTART is similar with the function
41   GC_SysVGetDataStart() in os_dep.c.
42
43     DATASTART  = ((&etext + 0x3ffff) & ~0x3ffff) + (&etext & 0xffff)
44
45    Dynamically linked:
46     DATASTART2 = (&_gp + 0x8000 + 0x3ffff) & ~0x3ffff
47
48    Statically linked:
49     DATASTART2 = &edata
50
51   GC has to check addresses both between DATASTART and &edata, and
52   between DATASTART2 and &end. If a program accesses between &etext
53   and DATASTART, or between &edata and DATASTART2, the segmentation
54   error occurs and the program stops.
55
56   If a program is statically linked, there is not a gap between
57   &edata and DATASTART2. The global symbol &_DYNAMIC_LINKING is used
58   for the detection.
59
60 64bit:
61   ELF file has a simple format. (See end(3C).)
62
63     _ftext
64        :      text segment
65     _etext
66     _fdata = DATASTART
67        :      data segment (initialized)
68     _edata
69     _fbss
70        :      data segment (uninitialized)
71     _end = DATAEND
72
73--
74Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
75
76
77When using the new "configure; make" build process, please
78run configure with the --disable-shared option.  "Make check" does not
79yet pass with dynamic libraries.  Ther reasons for that are not yet
80understood.  (HB, paraphrasing message from Hironori SAKAMOTO.)
81
82

README.hp

1Dynamic loading support requires that executables be linked with -ldld.
2The alternative is to build the collector without defining DYNAMIC_LOADING
3in gcconfig.h and ensuring that all garbage collectable objects are
4accessible without considering statically allocated variables in dynamic
5libraries.
6
7The collector should compile with either plain cc or cc -Ae.  Cc -Aa
8fails to define _HPUX_SOURCE and thus will not configure the collector
9correctly.
10
11Incremental collection support was reccently added, and should now work.
12
13In spite of past claims, pthread support under HP/UX 11 should now work.
14Define GC_HPUX_THREADS for the build.  Incremental collection still does not
15work in combination with it.
16
17The stack finding code can be confused by putenv calls before collector
18initialization.  Call GC_malloc or GC_init before any putenv calls.
19

README.linux

1See README.alpha for Linux on DEC AXP info.
2
3This file applies mostly to Linux/Intel IA32.  Ports to Linux on an M68K, IA64,
4SPARC, MIPS, Alpha and PowerPC are also integrated.  They should behave
5similarly, except that the PowerPC port lacks incremental GC support, and
6it is unknown to what extent the Linux threads code is functional.
7See below for M68K specific notes.
8
9Incremental GC is generally supported.
10
11Dynamic libraries are supported on an ELF system.  A static executable
12should be linked with the gcc option "-Wl,-defsym,_DYNAMIC=0".
13
14The collector appears to work reliably with Linux threads, but beware
15of older versions of glibc and gdb.
16
17The garbage collector uses SIGPWR and SIGXCPU if it is used with
18Linux threads.  These should not be touched by the client program.
19
20To use threads, you need to abide by the following requirements:
21
221) You need to use LinuxThreads or NPTL (which are included in libc6).
23
24   The collector relies on some implementation details of the LinuxThreads
25   package.  This code may not work on other
26   pthread implementations (in particular it will *not* work with
27   MIT pthreads).
28
292) You must compile the collector with -DGC_LINUX_THREADS and -D_REENTRANT
30   specified in the Makefile.
31
323a) Every file that makes thread calls should define GC_LINUX_THREADS and
33   _REENTRANT and then include gc.h.  Gc.h redefines some of the
34   pthread primitives as macros which also provide the collector with
35   information it requires.
36
373b) A new alternative to (3a) is to build the collector and compile GC clients
38   with -DGC_USE_LD_WRAP, and to link the final program with
39
40   (for ld) --wrap read --wrap dlopen --wrap pthread_create \
41	    --wrap pthread_join --wrap pthread_detach \
42	    --wrap pthread_sigmask --wrap sleep
43
44   (for gcc) -Wl,--wrap -Wl,read -Wl,--wrap -Wl,dlopen -Wl,--wrap \
45	     -Wl,pthread_create -Wl,--wrap -Wl,pthread_join -Wl,--wrap \
46	     -Wl,pthread_detach -Wl,--wrap -Wl,pthread_sigmask \
47	     -Wl,--wrap -Wl,sleep
48
49   In any case, _REENTRANT should be defined during compilation.
50
514) Dlopen() disables collection during its execution.  (It can't run
52   concurrently with the collector, since the collector looks at its
53   data structures.  It can't acquire the allocator lock, since arbitrary
54   user startup code may run as part of dlopen().)  Under unusual
55   conditions, this may cause unexpected heap growth.
56
575) The combination of GC_LINUX_THREADS, REDIRECT_MALLOC, and incremental
58   collection fails in seemingly random places.  This hasn't been tracked
59   down yet, but is perhaps not completely astonishing.  The thread package
60   uses malloc, and thus can presumably get SIGSEGVs while inside the
61   package.  There is no real guarantee that signals are handled properly
62   at that point.
63
646) Thread local storage may not be viewed as part of the root set by the
65   collector.  This probably depends on the linuxthreads version.  For the
66   time being, any collectable memory referenced by thread local storage should
67   also be referenced from elsewhere, or be allocated as uncollectable.
68   (This is really a bug that should be fixed somehow.)
69
70
71M68K LINUX:
72(From Richard Zidlicky)
73The bad news is that it can crash every linux-m68k kernel on a 68040,
74so an additional test is needed somewhere on startup. I have meanwhile
75patches to correct the problem in 68040 buserror handler but it is not
76yet in any standard kernel.
77
78Here is a simple test program to detect whether the kernel has the
79problem. It could be run as a separate check in configure or tested
80upon startup. If it fails (return !0) than mprotect can't be used
81on that system.
82
83/*
84 * test for bug that may crash 68040 based Linux
85 */
86
87#include <sys/mman.h>
88#include <signal.h>
89#include <unistd.h>
90#include <stdio.h>
91#include <stdlib.h>
92
93
94char *membase;
95int pagesize=4096;
96int pageshift=12;
97int x_taken=0;
98
99int sighandler(int sig)
100{
101   mprotect(membase,pagesize,PROT_READ|PROT_WRITE);
102   x_taken=1;
103}
104
105main()
106{
107  long l;
108
109   signal(SIGSEGV,sighandler);
110   l=(long)mmap(NULL,pagesize,PROT_READ,MAP_PRIVATE | MAP_ANON,-1,0);
111  if (l==-1)
112     {
113       perror("mmap/malloc");
114       abort();
115     }
116  membase=(char*)l;
117    *(long*)(membase+sizeof(long))=123456789;
118  if (*(long*)(membase+sizeof(long)) != 123456789 )
119    {
120      fprintf(stderr,"writeback failed !\n");
121      exit(1);
122    }
123  if (!x_taken)
124    {
125      fprintf(stderr,"exception not taken !\n");
126      exit(1);
127    }
128  fprintf(stderr,"vmtest Ok\n");
129  exit(0);
130}
131
132
133

README.macros

1The collector uses a large amount of conditional compilation in order to
2deal with platform dependencies.  This violates a number of known coding
3standards.  On the other hand, it seems to be the only practical way to
4support this many platforms without excessive code duplication.
5
6A few guidelines have mostly been followed in order to keep this manageable:
7
81) #if and #ifdef directives are properly indented whenever easily possible.
9All known C compilers allow whitespace between the "#" and the "if" to make
10this possible.  ANSI C also allows white space before the "#", though we
11avoid that.  It has the known disadvantages that it differs from the normal
12GNU conventions, and that it makes patches larger than otherwise necessary.
13In my opinion, it's still well worth it, for the same reason that we indent
14ordinary "if" statements.
15
162) Whenever possible, tests are performed on the macros defined in gcconfig.h
17instead of directly testing patform-specific predefined macros.  This makes it
18relatively easy to adapt to new compilers with a different set of predefined
19macros.  Currently these macros generally identify platforms instead of
20features.  In many cases, this is a mistake.
21
223) The code currently avoids #elif, eventhough that would make it more
23readable.  This was done since #elif would need to be understood by ALL
24compilers used to build the collector, and that hasn't always been the case.
25It makes sense to reconsider this decision at some point, since #elif has been
26standardized at least since 1989.
27
28Many of the tested configuration macros are at least somewhat defined in
29either include/private/gcconfig.h or in Makefile.direct.  Here is an attempt
30at defining some of the remainder:  (Thanks to Walter Bright for suggesting
31this.  This is a work in progress)
32
33MACRO		EXPLANATION
34-----		-----------
35
36__DMC__	Always #define'd by the Digital Mars compiler. Expands
37		to the compiler version number in hex, i.e. 0x810 is
38		version 8.1b0
39
40_ENABLE_ARRAYNEW
41		#define'd by the Digital Mars C++ compiler when
42		operator new[] and delete[] are separately
43		overloadable. Used in gc_cpp.h.
44
45_MSC_VER	Expands to the Visual C++ compiler version.  Assumed to
46		not be defined for other compilers (at least if they behave
47		appreciably differently).
48
49_DLL		Defined by Visual C++ if dynamic libraries are being built
50		or used.  Used to test whether __declspec(dllimport) or
51		__declspec(dllexport) needs to be added to declarations
52		to support the case in which the collector is in a dll.
53
54GC_DLL		User-settable macro that forces the effect of _DLL.  Set
55		by gc.h if _DLL is defined and GC_NOT_DLL is undefined.
56		This is the macro that is tested internally to determine
57		whether the GC is in its own dynamic library.  May need
58		to be set by clients before including gc.h.  Note that
59		inside the GC implementation it indicates that the
60		collector is in its own dynamic library, should export
61		its symbols, etc.  But in clients it indicates that the
62		GC resides in a different DLL, its entry points should
63		be referenced accordingly, and precautions may need to
64		be taken to properly deal with statically allocated
65		variables in the main program.  Used only for MS Windows.
66
67GC_NOT_DLL	User-settable macro that overrides _DLL, e.g. if dynamic
68		libraries are used, but the collector is in a static library.
69
70__STDC__	Assumed to be defined only by compilers that understand
71		prototypes and other C89 features.  Its value is generally
72		not used, since we are fine with most nonconforming extensions.
73
74SUNOS5SIGS	Solaris-like signal handling.  This is probably misnamed,
75		since it really doesn't guarantee much more than Posix.
76		Currently set only for Solaris2.X, HPUX, and DRSNX.  Should
77		probably be set for some other platforms.
78
79PCR		Set if the collector is being built as part of the Xerox
80		Portable Common Runtime.
81
82SRC_M3		Set if the collector is being built as a replacement of the
83		one in the DEC/Compaq SRC Modula-3 runtime.  I suspect this
84		was last used around 1994, and no doubt broke a long time ago.
85		It's there primarily incase someone wants to port to a similar
86		system.
87
88USE_COMPILER_TLS  Assume the existence of __thread-style thread-local
89		storage.  Set automatically for thread-local allocation with
90		the HP/UX vendor compiler.  Usable with gcc on sufficiently
91		up-to-date ELF platforms.
92
93
94
95

README.rs6000

1We have so far failed to find a good way to determine the stack base.
2It is highly recommended that GC_stackbottom be set explicitly on program
3startup.  The supplied value sometimes causes failure under AIX 4.1, though
4it appears to work under 3.X.  HEURISTIC2 seems to work under 4.1, but
5involves a substantial performance penalty, and will fail if there is
6no limit on stack size.
7
8There is no thread support.  (I assume recent versions of AIX provide
9pthreads?  I no longer have access to a machine ...)
10

README.sgi

1Performance of the incremental collector can be greatly enhanced with
2-DNO_EXECUTE_PERMISSION.
3
4The collector should run with all of the -32, -n32 and -64 ABIs.  Remember to
5define the AS macro in the Makefile to be "as -64", or "as -n32".
6
7If you use -DREDIRECT_MALLOC=GC_malloc with C++ code, your code should make
8at least one explicit call to malloc instead of new to ensure that the proper
9version of malloc is linked in.
10
11Sproc threads are not supported in this version, though there may exist other
12ports.
13
14Pthreads support is provided.  This requires that:
15
161) You compile the collector with -DGC_IRIX_THREADS specified in the Makefile.
17
182) You have the latest pthreads patches installed.
19
20(Though the collector makes only documented pthread calls,
21it relies on signal/threads interactions working just right in ways
22that are not required by the standard.  It is unlikely that this code
23will run on other pthreads platforms.  But please tell me if it does.)
24
253) Every file that makes thread calls should define IRIX_THREADS and then
26include gc.h.  Gc.h redefines some of the pthread primitives as macros which
27also provide the collector with information it requires.
28
294) pthread_cond_wait and pthread_cond_timed_wait should be prepared for
30premature wakeups.  (I believe the pthreads and realted standards require this
31anyway.  Irix pthreads often terminate a wait if a signal arrives.
32The garbage collector uses signals to stop threads.)
33
345) It is expensive to stop a thread waiting in IO at the time the request is
35initiated.  Applications with many such threads may not exhibit acceptable
36performance with the collector.  (Increasing the heap size may help.)
37
386) The collector should not be compiled with -DREDIRECT_MALLOC.  This
39confuses some library calls made by the pthreads implementation, which
40expect the standard malloc.
41
42

README.solaris2

1The collector supports both incremental collection and threads under
2Solaris 2.  The incremental collector normally retrieves page dirty information
3through the appropriate /proc calls.  But it can also be configured
4(by defining MPROTECT_VDB instead of PROC_VDB in gcconfig.h) to use mprotect
5and signals.  This may result in shorter pause times, but it is no longer
6safe to issue arbitrary system calls that write to the heap.
7
8Under other UNIX versions,
9the collector normally obtains memory through sbrk.  There is some reason
10to expect that this is not safe if the client program also calls the system
11malloc, or especially realloc.  The sbrk man page strongly suggests this is
12not safe: "Many library routines use malloc() internally, so use brk()
13and sbrk() only when you know  that malloc() definitely will not be used by
14any library routine."  This doesn't make a lot of sense to me, since there
15seems to be no documentation as to which routines can transitively call malloc.
16Nonetheless, under Solaris2, the collector now (since 4.12) allocates
17memory using mmap by default.  (It defines USE_MMAP in gcconfig.h.)
18You may want to reverse this decisions if you use -DREDIRECT_MALLOC=...
19
20
21SOLARIS THREADS:
22
23The collector must be compiled with -DGC_SOLARIS_THREADS (thr_ functions)
24or -DGC_SOLARIS_PTHREADS (pthread_ functions) to be thread safe.
25It is also essential that gc.h be included in files that call thr_create,
26thr_join, thr_suspend, thr_continue, or dlopen.  Gc.h macro defines
27these to also do GC bookkeeping, etc.  Gc.h must be included with
28one or both of these macros defined, otherwise
29these replacements are not visible.
30A collector built in this way way only be used by programs that are
31linked with the threads library.
32
33In this mode, the collector contains various workarounds for older Solaris
34bugs.  Mostly, these should not be noticeable unless you look at system
35call traces.  However, it cannot protect a guard page at the end of
36a thread stack.  If you know that you will only be running Solaris2.5
37or later, it should be possible to fix this by compiling the collector
38with -DSOLARIS23_MPROTECT_BUG_FIXED.
39
40Since 5.0 alpha5, dlopen disables collection temporarily,
41unless USE_PROC_FOR_LIBRARIES is defined.  In some unlikely cases, this
42can result in unpleasant heap growth.  But it seems better than the
43race/deadlock issues we had before.
44
45If solaris_threads are used on an X86 processor with malloc redirected to
46GC_malloc a deadlock is likely to result.
47
48It appears that there is a problem in using gc_cpp.h in conjunction with
49Solaris threads and Sun's C++ runtime.  Apparently the overloaded new operator
50is invoked by some iostream initialization code before threads are correctly
51initialized.  As a result, call to thr_self() in garbage collector
52initialization  segfaults.  Currently the only known workaround is to not
53invoke the garbage collector from a user defined global operator new, or to
54have it invoke the garbage-collector's allocators only after main has started.
55(Note that the latter requires a moderately expensive test in operator
56delete.)
57
58Hans-J. Boehm
59(The above contains my personal opinions, which are probably not shared
60by anyone else.)
61

README.uts

1Alistair Crooks supplied the port.  He used Lexa C version 2.1.3 with
2-Xa to compile.
3

README.win32

1The collector has at various times been compiled under Windows 95 & later, NT,
2and XP, with the original Microsoft SDK, with Visual C++ 2.0, 4.0, and 6, with
3the GNU win32 tools, with Borland 4.5,  with Watcom C, and recently
4with the Digital Mars compiler.  It is likely that some of these have been
5broken in the meantime.  Patches are appreciated.
6
7For historical reasons,
8the collector test program "gctest" is linked as a GUI application,
9but does not open any windows.  Its output appears in the file
10"gc.log".  It may be started from the file manager.  The hour glass
11cursor may appear as long as it's running.  If it is started from the
12command line, it will usually run in the background.  Wait a few
13minutes (a few seconds on a modern machine) before you check the output.
14You should see either a failure indication or a "Collector appears to
15work" message.
16
17The cord test program has not been ported (but should port
18easily).  A toy editor (cord/de.exe) based on cords (heavyweight
19strings represented as trees) has been ported and is included.
20It runs fine under either win32 or win32S.  It serves as an example
21of a true Windows application, except that it was written by a
22nonexpert Windows programmer.  (There are some peculiarities
23in the way files are displayed.  The <cr> is displayed explicitly
24for standard DOS text files.  As in the UNIX version, control
25characters are displayed explicitly, but in this case as red text.
26This may be suboptimal for some tastes and/or sets of default
27window colors.)
28
29In general -DREDIRECT_MALLOC is unlikely to work unless the
30application is completely statically linked.
31
32The collector normally allocates memory from the OS with VirtualAlloc.
33This appears to cause problems under Windows NT and Windows 2000 (but
34not Windows 95/98) if the memory is later passed to CreateDIBitmap.
35To work around this problem, build the collector with -DUSE_GLOBAL_ALLOC.
36This is currently incompatible with -DUSE_MUNMAP.  (Thanks to Jonathan
37Clark for tracking this down.  There's some chance this may be fixed
38in 6.1alpha4, since we now separate heap sections with an unused page.)
39
40Microsoft Tools
41---------------
42For Microsoft development tools, rename NT_MAKEFILE as
43MAKEFILE.  (Make sure that the CPU environment variable is defined
44to be i386.)  In order to use the gc_cpp.h C++ interface, all
45client code should include gc_cpp.h.
46
47For historical reasons,
48the collector test program "gctest" is linked as a GUI application,
49but does not open any windows.  Its output appears in the file
50"gc.log".  It may be started from the file manager.  The hour glass
51cursor may appear as long as it's running.  If it is started from the
52command line, it will usually run in the background.  Wait a few
53minutes (a few seconds on a modern machine) before you check the output.
54You should see either a failure indication or a "Collector appears to
55work" message.
56
57If you would prefer a VC++.NET project file, ask boehm@acm.org.  One has
58been contributed, but it seems to contain some absolute paths etc., so
59it can presumably only be a starting point, and is not in the standard
60distribution.  It is unclear (to me, Hans Boehm) whether it is feasible to
61change that.
62
63Clients may need to define GC_NOT_DLL before including gc.h, if the
64collector was built as a static library (as it normally is in the
65absence of thread support).
66
67GNU Tools
68---------
69For GNU-win32, use the regular makefile, possibly after uncommenting
70the line "include Makefile.DLLs".  The latter should be necessary only
71if you want to package the collector as a DLL.
72[Is the following sentence obsolete? -HB] The GNU-win32 port is
73believed to work only for b18, not b19, probably due to linker changes
74in b19.  This is probably fixable with a different definition of
75DATASTART and DATAEND in gcconfig.h.
76
77The collector should also be buildable under Cygwin with either the
78old standard Makefile, or with the "configure;make" machinery.
79
80Borland Tools
81-------------
82[Rarely tested.]
83For Borland tools, use BCC_MAKEFILE.  Note that
84Borland's compiler defaults to 1 byte alignment in structures (-a1),
85whereas Visual C++ appears to default to 8 byte alignment (/Zp8).
86The garbage collector in its default configuration EXPECTS AT
87LEAST 4 BYTE ALIGNMENT.  Thus the BORLAND DEFAULT MUST
88BE OVERRIDDEN.  (In my opinion, it should usually be anyway.
89I expect that -a1 introduces major performance penalties on a
90486 or Pentium.)  Note that this changes structure layouts.  (As a last
91resort, gcconfig.h can be changed to allow 1 byte alignment.  But
92this has significant negative performance implications.)
93The Makefile is set up to assume Borland 4.5.  If you have another
94version, change the line near the top.  By default, it does not
95require the assembler.  If you do have the assembler, I recommend
96removing the -DUSE_GENERIC.
97
98Incremental Collection
99----------------------
100There is some support for incremental collection.  This is
101currently pretty simple-minded.  Pages are protected.  Protection
102faults are caught by a handler installed at the bottom of the handler
103stack.  This is both slow and interacts poorly with a debugger.
104Whenever possible, I recommend adding a call to
105GC_enable_incremental at the last possible moment, after most
106debugging is complete.  Unlike the UNIX versions, no system
107calls are wrapped by the collector itself.  It may be necessary
108to wrap ReadFile calls that use a buffer in the heap, so that the
109call does not encounter a protection fault while it's running.
110(As usual, none of this is an issue unless GC_enable_incremental
111is called.)
112
113Note that incremental collection is disabled with -DSMALL_CONFIG.
114
115Threads
116-------
117
118James Clark has contributed the necessary code to support win32 threads
119with the collector in a DLL.
120Use NT_THREADS_MAKEFILE (a.k.a gc.mak) instead of NT_MAKEFILE
121to build this version.  Note that this requires some files whose names
122are more than 8 + 3 characters long.  Thus you should unpack the tar file
123so that long file names are preserved.  To build the garbage collector
124test with VC++ from the command line, use
125
126nmake /F ".\gc.mak" CFG="gctest - Win32 Release"
127
128This requires that the subdirectory gctest\Release exist.
129The test program and DLL will reside in the Release directory.
130
131This version relies on the collector residing in a dll.
132
133This version currently supports incremental collection only if it is
134enabled before any additional threads are created.
135
136Since 6.3alpha2, threads are also better supported in static library builds
137with Microsoft tools (use NT_STATIC_THREADS_MAKEFILE) and with the GNU
138tools.  In all cases,the collector must be built with GC_WIN32_THREADS
139defined, even if the Cygwin pthreads interface is used.
140(NT_STATIC_THREADS_MAKEFILE does this implicitly.  Under Cygwin,
141./configure --enable-threads=posix defines GC_WIN32_THREADS.)  Threads must be
142created with GC_CreateThread.  This can be accomplished by
143including gc.h and then calling CreateThread, which is redefined
144by gc.h.
145
146For the statically linked versions, it is required that GC_init()
147be called before other GC calls, since there seems to be no implicit way
148to initialize the allocation lock.  The easiest way to ensure this in
149portable code is to call GC_INIT() from the main executable (not
150a dynamic library) before calling any other GC_ routines.
151
152We strongly advise against using the TerminateThread() win32 API call,
153especially with the garbage collector.  Any use is likely to provoke a
154crash in the GC, since it makes it impossible for the collector to
155correctly track threads.
156
157
158Watcom compiler
159---------------
160
161Ivan V. Demakov's README for the Watcom port:
162
163The collector has been compiled with Watcom C 10.6 and 11.0.
164It runs under win32, win32s, and even under msdos with dos4gw
165dos-extender. It should also run under OS/2, though this isn't
166tested. Under win32 the collector can be built either as dll
167or as static library.
168
169Note that all compilations were done under Windows 95 or NT.
170For unknown reason compiling under Windows 3.11 for NT (one
171attempt has been made) leads to broken executables.
172
173Incremental collection is not supported.
174
175cord is not ported.
176
177Before compiling you may need to edit WCC_MAKEFILE to set target
178platform, library type (dynamic or static), calling conventions, and
179optimization options.
180
181To compile the collector and testing programs use the command:
182    wmake -f WCC_MAKEFILE
183
184All programs using gc should be compiled with 4-byte alignment.
185For further explanations on this see comments about Borland.
186
187If the gc is compiled as dll, the macro ``GC_DLL'' should be defined before
188including "gc.h" (for example, with -DGC_DLL compiler option). It's
189important, otherwise resulting programs will not run.
190
191Ivan Demakov (email: ivan@tgrad.nsk.su)
192
193Win32S
194------
195
196[The following is probably obsolete.  The win32s support is still in the
197collector, but I doubt anyone cares, or has tested it recently.]
198
199The collector runs under both win32s and win32, but with different semantics.
200Under win32, all writable pages outside of the heaps and stack are
201scanned for roots.  Thus the collector sees pointers in DLL data
202segments.  Under win32s, only the main data segment is scanned.
203(The main data segment should always be scanned.  Under some
204versions of win32s, other regions may also be scanned.)
205Thus all accessible objects should be accessible from local variables
206or variables in the main data segment.  Alternatively, other data
207segments (e.g. in DLLs) may be registered with the collector by
208calling GC_init() and then GC_register_root_section(a), where
209a is the address of some variable inside the data segment.  (Duplicate
210registrations are ignored, but not terribly quickly.)
211
212(There are two reasons for this.  We didn't want to see many 16:16
213pointers.  And the VirtualQuery call has different semantics under
214the two systems, and under different versions of win32s.)
215
216