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

..11-Aug-2015-

READMEH A D11-Aug-201527.2 KiB549451

README.DGUX386H A D11-Aug-20155.9 KiB216188

README.MacH A D11-Aug-201513.3 KiB391319

README.MacOSXH A D11-Aug-201560 21

README.OS2H A D11-Aug-2015365 75

README.amigaH A D11-Aug-201513.5 KiB323232

README.arm.crossH A D11-Aug-20152.1 KiB6952

README.autoconfH A D11-Aug-20152.3 KiB6040

README.changesH A D11-Aug-2015139.4 KiB2,5952,490

README.contributorsH A D11-Aug-20153.1 KiB5850

README.cordsH A D11-Aug-20152.5 KiB5441

README.darwinH A D11-Aug-20156.3 KiB143111

README.djH A D11-Aug-2015376 138

README.environmentH A D11-Aug-20156.5 KiB136112

README.ews4800H A D11-Aug-20152.1 KiB8261

README.hpH A D11-Aug-2015846 1914

README.linuxH A D11-Aug-20154.3 KiB132102

README.macrosH A D11-Aug-20153.7 KiB8364

README.rs6000H A D11-Aug-2015509 108

README.sgiH A D11-Aug-20151.8 KiB4229

README.solaris2H A D11-Aug-20153.3 KiB6554

README.utsH A D11-Aug-201586 32

README.win32H A D11-Aug-201510 KiB222180

README.win64H A D11-Aug-2015836 1814

barrett_diagramH A D11-Aug-20156.3 KiB10795

doc.amH A D11-Aug-20151.4 KiB5652

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

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

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

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

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

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

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 GC logging.  Not functional with -DSMALL_CONFIG.
19
20GC_LOG_FILE - The name of the log file.  Stderr by default.
21
22GC_PRINT_VERBOSE_STATS - Turn on even more logging.
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 normally 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
97The following turn on runtime flags that are also program settable.  Checked
98only during initialization.  We expect that they will usually be set through
99other means, but this may help with debugging and testing:
100
101GC_ENABLE_INCREMENTAL - Turn on incremental collection at startup.  Note that,
102		     depending on platform and collector configuration, this
103		     may involve write protecting pieces of the heap to
104		     track modifications.  These pieces may include pointerfree
105		     objects or not.  Although this is intended to be
106		     transparent, it may cause unintended system call failures.
107		     Use with caution.
108
109GC_PAUSE_TIME_TARGET - Set the desired garbage collector pause time in msecs.
110		     This only has an effect if incremental collection is
111		     enabled.  If a collection requires appreciably more time
112		     than this, the client will be restarted, and the collector
113		     will need to do additional work to compensate.  The
114		     special value "999999" indicates that pause time is
115		     unlimited, and the incremental collector will behave
116		     completely like a simple generational collector.  If
117		     the collector is configured for parallel marking, and
118		     run on a multiprocessor, incremental collection should
119		     only be used with unlimited pause time.
120
121GC_FIND_LEAK - Turns on GC_find_leak and thus leak detection.  Forces a
122	       collection at program termination to detect leaks that would
123	       otherwise occur after the last GC.
124
125GC_ALL_INTERIOR_POINTERS - Turns on GC_all_interior_pointers and thus interior
126			   pointer recognition.
127
128GC_DONT_GC - Turns off garbage collection.  Use cautiously.
129
130GC_TRACE=addr - Intended for collector debugging.  Requires that the collector
131		have been built with ENABLE_TRACE defined.  Causes the debugger
132		to log information about the tracing of address ranges containing
133		addr.  Typically addr is the address that contains a pointer to
134		an object that mysteriously failed to get marked.  Addr must be
135		specified as a hexadecimal integer.
136

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 (or
30   just -DGC_THREADS) and -D_REENTRANT 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 is probably not fully reliable, though it now seems to work
59   in simple cases.
60
616) Thread local storage may not be viewed as part of the root set by the
62   collector.  This probably depends on the linuxthreads version.  For the
63   time being, any collectable memory referenced by thread local storage should
64   also be referenced from elsewhere, or be allocated as uncollectable.
65   (This is really a bug that should be fixed somehow.  The current GC
66   version probably gets things right if there are not too many tls locations
67   and if dlopen is not used.)
68
69
70M68K LINUX:
71(From Richard Zidlicky)
72The bad news is that it can crash every linux-m68k kernel on a 68040,
73so an additional test is needed somewhere on startup. I have meanwhile
74patches to correct the problem in 68040 buserror handler but it is not
75yet in any standard kernel.
76
77Here is a simple test program to detect whether the kernel has the
78problem. It could be run as a separate check in configure or tested
79upon startup. If it fails (return !0) than mprotect can't be used
80on that system.
81
82/*
83 * test for bug that may crash 68040 based Linux
84 */
85
86#include <sys/mman.h>
87#include <signal.h>
88#include <unistd.h>
89#include <stdio.h>
90#include <stdlib.h>
91
92
93char *membase;
94int pagesize=4096;
95int pageshift=12;
96int x_taken=0;
97
98int sighandler(int sig)
99{
100   mprotect(membase,pagesize,PROT_READ|PROT_WRITE);
101   x_taken=1;
102}
103
104main()
105{
106  long l;
107
108   signal(SIGSEGV,sighandler);
109   l=(long)mmap(NULL,pagesize,PROT_READ,MAP_PRIVATE | MAP_ANON,-1,0);
110  if (l==-1)
111     {
112       perror("mmap/malloc");
113       abort();
114     }
115  membase=(char*)l;
116    *(long*)(membase+sizeof(long))=123456789;
117  if (*(long*)(membase+sizeof(long)) != 123456789 )
118    {
119      fprintf(stderr,"writeback failed !\n");
120      exit(1);
121    }
122  if (!x_taken)
123    {
124      fprintf(stderr,"exception not taken !\n");
125      exit(1);
126    }
127  fprintf(stderr,"vmtest Ok\n");
128  exit(0);
129}
130
131
132

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
22Many of the tested configuration macros are at least somewhat defined in
23either include/private/gcconfig.h or in Makefile.direct.  Here is an attempt
24at defining some of the remainder:  (Thanks to Walter Bright for suggesting
25this.  This is a work in progress)
26
27MACRO		EXPLANATION
28-----		-----------
29
30__DMC__	Always #define'd by the Digital Mars compiler. Expands
31		to the compiler version number in hex, i.e. 0x810 is
32		version 8.1b0
33
34_ENABLE_ARRAYNEW
35		#define'd by the Digital Mars C++ compiler when
36		operator new[] and delete[] are separately
37		overloadable. Used in gc_cpp.h.
38
39_MSC_VER	Expands to the Visual C++ compiler version.  Assumed to
40		not be defined for other compilers (at least if they behave
41		appreciably differently).
42
43_DLL		Defined by Visual C++ if dynamic libraries are being built
44		or used.  Used to test whether __declspec(dllimport) or
45		__declspec(dllexport) needs to be added to declarations
46		to support the case in which the collector is in a dll.
47
48GC_DLL		User-settable macro that forces the effect of _DLL.  Set
49		by gc.h if _DLL is defined and GC_NOT_DLL is undefined.
50		This is the macro that is tested internally to determine
51		whether the GC is in its own dynamic library.  May need
52		to be set by clients before including gc.h.  Note that
53		inside the GC implementation it indicates that the
54		collector is in its own dynamic library, should export
55		its symbols, etc.  But in clients it indicates that the
56		GC resides in a different DLL, its entry points should
57		be referenced accordingly, and precautions may need to
58		be taken to properly deal with statically allocated
59		variables in the main program.  Used only for MS Windows.
60
61GC_NOT_DLL	User-settable macro that overrides _DLL, e.g. if dynamic
62		libraries are used, but the collector is in a static library.
63
64__STDC__	Assumed to be defined only by compilers that understand
65		prototypes and other C89 features.  Its value is generally
66		not used, since we are fine with most nonconforming extensions.
67
68SUNOS5SIGS	Solaris-like signal handling.  This is probably misnamed,
69		since it really doesn't guarantee much more than Posix.
70		Currently set only for Solaris2.X, HPUX, and DRSNX.  Should
71		probably be set for some other platforms.
72
73PCR		Set if the collector is being built as part of the Xerox
74		Portable Common Runtime.
75
76USE_COMPILER_TLS  Assume the existence of __thread-style thread-local
77		storage.  Set automatically for thread-local allocation with
78		the HP/UX vendor compiler.  Usable with gcc on sufficiently
79		up-to-date ELF platforms.
80
81
82
83

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_THREADS to be thread safe.  This assumes use of the pthread_
25interface.  Old style Solaris threads are no longer supported.
26
27It is also essential that gc.h be included in files that call thr_create,
28thr_join, thr_suspend, thr_continue, or dlopen.  Gc.h macro defines
29these to also do GC bookkeeping, etc.  Gc.h must be included with
30one or both of these macros defined, otherwise
31these replacements are not visible.
32A collector built in this way way only be used by programs that are
33linked with the threads library.
34
35Since 5.0 alpha5, dlopen disables collection temporarily,
36unless USE_PROC_FOR_LIBRARIES is defined.  In some unlikely cases, this
37can result in unpleasant heap growth.  But it seems better than the
38race/deadlock issues we had before.
39
40If solaris_threads are used on an X86 processor with malloc redirected to
41GC_malloc, it is necessary to call GC_thr_init explicitly before forking the
42first thread.  (This avoids a deadlock arising from calling GC_thr_init
43with the allocation lock held.)
44
45It appears that there is a problem in using gc_cpp.h in conjunction with
46Solaris threads and Sun's C++ runtime.  Apparently the overloaded new operator
47is invoked by some iostream initialization code before threads are correctly
48initialized.  As a result, call to thr_self() in garbage collector
49initialization  segfaults.  Currently the only known workaround is to not
50invoke the garbage collector from a user defined global operator new, or to
51have it invoke the garbage-collector's allocators only after main has started.
52(Note that the latter requires a moderately expensive test in operator
53delete.)
54
55I encountered "symbol <unknown>: offet .... is non-aligned" errors.  These
56appear to be traceable to the use of the GNU assembler with the Sun linker.
57The former appears to generate a relocation not understood by the latter.
58The fix appears to be to use a consistent tool chain.  (As a non-Solaris-expert
59my solution involved hacking the libtool script, but I'm sure you can
60do something less ugly.)
61
62Hans-J. Boehm
63(The above contains my personal opinions, which are probably not shared
64by anyone else.)
65

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 normally appears in the file
10"gctest.exe.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
40[Threads and incremental collection are discussed near the end, below.]
41
42Microsoft Tools
43---------------
44For Microsoft development tools, rename NT_MAKEFILE as
45MAKEFILE.  (Make sure that the CPU environment variable is defined
46to be i386.)  In order to use the gc_cpp.h C++ interface, all
47client code should include gc_cpp.h.
48
49For historical reasons,
50the collector test program "gctest" is linked as a GUI application,
51but does not open any windows.  Its output appears in the file
52"gc.log".  It may be started from the file manager.  The hour glass
53cursor may appear as long as it's running.  If it is started from the
54command line, it will usually run in the background.  Wait a few
55minutes (a few seconds on a modern machine) before you check the output.
56You should see either a failure indication or a "Collector appears to
57work" message.
58
59If you would prefer a VC++.NET project file, ask boehm@acm.org.  One has
60been contributed, but it seems to contain some absolute paths etc., so
61it can presumably only be a starting point, and is not in the standard
62distribution.  It is unclear (to me, Hans Boehm) whether it is feasible to
63change that.
64
65Clients may need to define GC_NOT_DLL before including gc.h, if the
66collector was built as a static library (as it normally is in the
67absence of thread support).
68
69GNU Tools
70---------
71The collector should be buildable under Cygwin with either the old standard
72Makefile, or possibly with the "configure --diable-shared;make" machinery.
73(For the latter use --enable-threads=posix for thread support.) The major issue
74here seems to be that dynamic library support is not currently enabled for
75Cygwin.  (This is probably fixable without a great deal of difficulty by
76reusing the standard WIN32 code.  But it requires some tweaking.)  As a result
77of this, "configure; make; make check" currently does not completely succeed,
78though the static library appears to be OK when used only from the main
79programs, and correspondingly the Makefile.direct self tests succeed.
80
81Mingw32 builds are not regularly tested, and may or may not work.
82The following paragraph is probably obsolete:
83
84For GNU-win32, use the regular makefile, possibly after uncommenting
85the line "include Makefile.DLLs".  The latter should be necessary only
86if you want to package the collector as a DLL.
87[Is the following sentence obsolete? -HB] The GNU-win32 port is
88believed to work only for b18, not b19, probably due to linker changes
89in b19.  This is probably fixable with a different definition of
90DATASTART and DATAEND in gcconfig.h.
91
92Borland Tools
93-------------
94[Rarely tested.]
95For Borland tools, use BCC_MAKEFILE.  Note that
96Borland's compiler defaults to 1 byte alignment in structures (-a1),
97whereas Visual C++ appears to default to 8 byte alignment (/Zp8).
98The garbage collector in its default configuration EXPECTS AT
99LEAST 4 BYTE ALIGNMENT.  Thus the BORLAND DEFAULT MUST
100BE OVERRIDDEN.  (In my opinion, it should usually be anyway.
101I expect that -a1 introduces major performance penalties on a
102486 or Pentium.)  Note that this changes structure layouts.  (As a last
103resort, gcconfig.h can be changed to allow 1 byte alignment.  But
104this has significant negative performance implications.)
105The Makefile is set up to assume Borland 4.5.  If you have another
106version, change the line near the top.  By default, it does not
107require the assembler.  If you do have the assembler, I recommend
108removing the -DUSE_GENERIC.
109
110
111Watcom compiler
112---------------
113
114Ivan V. Demakov's README for the Watcom port:
115
116The collector has been compiled with Watcom C 10.6 and 11.0.
117It runs under win32, win32s, and even under msdos with dos4gw
118dos-extender. It should also run under OS/2, though this isn't
119tested. Under win32 the collector can be built either as dll
120or as static library.
121
122Note that all compilations were done under Windows 95 or NT.
123For unknown reason compiling under Windows 3.11 for NT (one
124attempt has been made) leads to broken executables.
125
126Incremental collection is not supported.
127
128cord is not ported.
129
130Before compiling you may need to edit WCC_MAKEFILE to set target
131platform, library type (dynamic or static), calling conventions, and
132optimization options.
133
134To compile the collector and testing programs use the command:
135    wmake -f WCC_MAKEFILE
136
137All programs using gc should be compiled with 4-byte alignment.
138For further explanations on this see comments about Borland.
139
140If the gc is compiled as dll, the macro ``GC_DLL'' should be defined before
141including "gc.h" (for example, with -DGC_DLL compiler option). It's
142important, otherwise resulting programs will not run.
143
144Ivan Demakov (email: ivan@tgrad.nsk.su)
145
146Incremental Collection
147----------------------
148There is some support for incremental collection.  By default, the
149collector chooses between explicit page protection, anf GetWriteWatch-based
150write tracking automatically, depending on the platform.
151
152The former is slow and interacts poorly with a debugger.
153Pages are protected.  Protection faults are caught by a handler
154installed at the bottom of the handler
155stack.  Whenever possible, I recommend adding a call to
156GC_enable_incremental at the last possible moment, after most
157debugging is complete.  No system
158calls are wrapped by the collector itself.  It may be necessary
159to wrap ReadFile calls that use a buffer in the heap, so that the
160call does not encounter a protection fault while it's running.
161(As usual, none of this is an issue unless GC_enable_incremental
162is called.)
163
164Note that incremental collection is disabled with -DSMALL_CONFIG.
165
166Threads
167-------
168
169This version of the collector by default handles threads similarly
170to other platforms.  James Clark's code which tracks threads attached
171to the collector DLL still exists, but requires that both
172- the collector is built in a DLL with GC_DLL defined, and
173- GC_use_DllMain() is called before GC initialization, which
174  in turn must happen before creating additional threads.
175We generally recommend avoiding this if possible, since it seems to
176be less than 100% reliable.
177
178Use NT_THREADS_MAKEFILE (a.k.a gc.mak) instead of NT_MAKEFILE
179to build a version that supports both kinds of thread tracking.
180To build the garbage collector
181test with VC++ from the command line, use
182
183nmake /F ".\gc.mak" CFG="gctest - Win32 Release"
184
185This requires that the subdirectory gctest\Release exist.
186The test program and DLL will reside in the Release directory.
187
188This version currently supports incremental collection only if it is
189enabled before any additional threads are created.
190
191Since 6.3alpha2, threads are also better supported in static library builds
192with Microsoft tools (use NT_STATIC_THREADS_MAKEFILE) and with the GNU
193tools.  In all cases,the collector must be built with GC_WIN32_THREADS
194defined, even if the Cygwin pthreads interface is used.
195(NT_STATIC_THREADS_MAKEFILE does this implicitly.  Under Cygwin,
196./configure --enable-threads=posix defines GC_WIN32_THREADS.)
197
198For the normal, non-dll-based thread tracking to work properly,
199threads should be created with GC_CreateThread or GC_beginthreadex,
200and exit normally or call GC_endthreadex or GC_ExitThread.  (For
201Cygwin, use standard pthread calls instead.)  As in the pthread
202case, including gc.h will redefine CreateThread, _beginthreadex,
203_endthreadex, and ExitThread to call the GC_ versions instead.
204
205Note that, as usual, GC_CreateThread tends to introduce resource leaks
206that are avoided by GC_beginthreadex.  There is currently no equivalent of
207_beginthread, and it should not be used.
208
209GC_INIT should be called from the main executable before other GC calls.
210
211We strongly advise against using the TerminateThread() win32 API call,
212especially with the garbage collector.  Any use is likely to provoke a
213crash in the GC, since it makes it impossible for the collector to
214correctly track threads.
215
216To build the collector for Mingw32 Pthreads, use Makefile.direct and
217explicitly set GC_WIN32_PTHREADS.  Use -DPTW32_STATIC_LIB for the static
218threads library.  Note that the DEBUG_WIN32_PTHREADS support in
219win32_threads.c is currently broken and looking for someone to debug it.
220(This information and the port came from Romano Paolo Tenca).
221
222

README.win64

164-bit Windows on AMD64/Intel EM64T is somewhat supported in the 7.0
2release.  A collector can be built with Microsoft Visual C++ 2005.
3The resulting test programs have been known to work at least once.
4More testing would clearly be helpful.
5
6Currently only NT_X64_STATIC_THREADS_MAKEFILE has been used in
7this environment.  Copy this file to MAKEFILE, and then type "nmake"
8in a Visual C++ command line window to build the static library
9and the usual test programs.  To verify that the colllector is
10at least somewhat functional, run gctest.exe.  This should create
11gctest.exe.log after a few seconds.
12
13This process is completely analogous to NT_STATIC_THREADS_MAKEFILE
14for the 32-bit version.
15
16Note that currently a few warnings are still generated by default,
17and a number of others have been explicitly turned off in the makefile.
18