[BACK]Return to README CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gc

Annotation of OpenXM_contrib/gc/README, Revision 1.1.1.1

1.1       maekawa     1: Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
                      2: Copyright (c) 1991-1996 by Xerox Corporation.  All rights reserved.
                      3: Copyright (c) 1996-1998 by Silicon Graphics.  All rights reserved.
                      4:
                      5: THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
                      6: OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
                      7:
                      8: Permission is hereby granted to use or copy this program
                      9: for any purpose,  provided the above notices are retained on all copies.
                     10: Permission to modify the code and to distribute modified code is granted,
                     11: provided the above notices are retained, and a notice that the code was
                     12: modified is included with the above copyright notice.
                     13:
                     14: This is version 4.14 of a conservative garbage collector for C and C++.
                     15:
                     16: You might find a more recent version of this at
                     17:
                     18: http://reality.sgi.com/boehm/gc.html
                     19:
                     20: HISTORY -
                     21:
                     22:   Early versions of this collector were developed as a part of research
                     23: projects supported in part by the National Science Foundation
                     24: and the Defense Advance Research Projects Agency.
                     25: Much of the code was rewritten by Hans-J. Boehm at Xerox PARC
                     26: and is now maintained by him at SGI (boehm@sgi.com).
                     27:
                     28: Some other contributors:
                     29:
                     30: More recent contributors are mentioned in the modification history at the
                     31: end of this file.  My apologies for any omissions.
                     32:
                     33: The SPARC specific code was contributed by Mark Weiser
                     34: (weiser@parc.xerox.com).  The Encore Multimax modifications were supplied by
                     35: Kevin Kenny (kenny@m.cs.uiuc.edu).  The adaptation to the RT is largely due
                     36: to Vernon Lee (scorpion@rice.edu), on machines made available by IBM.
                     37: Much of the HP specific code and a number of good suggestions for improving the
                     38: generic code are due to Walter Underwood (wunder@hp-ses.sde.hp.com).
                     39: Robert Brazile (brazile@diamond.bbn.com) originally supplied the ULTRIX code.
                     40: Al Dosser (dosser@src.dec.com) and Regis Cridlig (Regis.Cridlig@cl.cam.ac.uk)
                     41: subsequently provided updates and information on variation between ULTRIX
                     42: systems.  Parag Patel (parag@netcom.com) supplied the A/UX code.
                     43: Jesper Peterson(jep@mtiame.mtia.oz.au) and
                     44: Michel Schinz supplied the Amiga port.
                     45: Thomas Funke (thf@zelator.in-berlin.de(?)) and
                     46: Brian D.Carlstrom (bdc@clark.lcs.mit.edu) supplied the NeXT ports.
                     47: Douglas Steel (doug@wg.icl.co.uk) provided ICL DRS6000 code.
                     48: Bill Janssen (janssen@parc.xerox.com) supplied the SunOS dynamic loader
                     49: specific code. Manuel Serrano (serrano@cornas.inria.fr) supplied linux and
                     50: Sony News specific code.  Al Dosser provided Alpha/OSF/1 code.  He and
                     51: Dave Detlefs(detlefs@src.dec.com) also provided several generic bug fixes.
                     52: Alistair G. Crooks(agc@uts.amdahl.com) supplied the NetBSD and 386BSD ports.
                     53: Jeffrey Hsu (hsu@soda.berkeley.edu) provided the FreeBSD port.
                     54: Brent Benson (brent@jade.ssd.csd.harris.com) ported the collector to
                     55: a Motorola 88K processor running CX/UX (Harris NightHawk).
                     56: Ari Huttunen (Ari.Huttunen@hut.fi) generalized the OS/2 port to
                     57: nonIBM development environments (a nontrivial task).
                     58: Patrick Beard (beard@cs.ucdavis.edu) provided the initial MacOS port.
                     59: David Chase, then at Olivetti Research, suggested several improvements.
                     60: Scott Schwartz (schwartz@groucho.cse.psu.edu) supplied some of the
                     61: code to save and print call stacks for leak detection on a SPARC.
                     62: Jesse Hull and John Ellis supplied the C++ interface code.
                     63: Zhong Shao performed much of the experimentation that led to the
                     64: current typed allocation facility.  (His dynamic type inference code hasn't
                     65: made it into the released version of the collector, yet.)
                     66: (Blame for misinstallation of these modifications goes to the first author,
                     67: however.)
                     68:
                     69: OVERVIEW
                     70:
                     71:     This is intended to be a general purpose, garbage collecting storage
                     72: allocator.  The algorithms used are described in:
                     73:
                     74: Boehm, H., and M. Weiser, "Garbage Collection in an Uncooperative Environment",
                     75: Software Practice & Experience, September 1988, pp. 807-820.
                     76:
                     77: Boehm, H., A. Demers, and S. Shenker, "Mostly Parallel Garbage Collection",
                     78: Proceedings of the ACM SIGPLAN '91 Conference on Programming Language Design
                     79: and Implementation, SIGPLAN Notices 26, 6 (June 1991), pp. 157-164.
                     80:
                     81: Boehm, H., "Space Efficient Conservative Garbage Collection", Proceedings
                     82: of the ACM SIGPLAN '91 Conference on Programming Language Design and
                     83: Implementation, SIGPLAN Notices 28, 6 (June 1993), pp. 197-206.
                     84:
                     85:   Possible interactions between the collector and optimizing compilers are
                     86: discussed in
                     87:
                     88: Boehm, H., and D. Chase, "A Proposal for GC-safe C Compilation",
                     89: The Journal of C Language Translation 4, 2 (December 1992).
                     90:
                     91: and
                     92:
                     93: Boehm H., "Simple GC-safe Compilation", Proceedings
                     94: of the ACM SIGPLAN '96 Conference on Programming Language Design and
                     95: Implementation.
                     96:
                     97: (Both are also available from
                     98: http://reality.sgi.com/boehm/papers/, among other places.)
                     99:
                    100:   Unlike the collector described in the second reference, this collector
                    101: operates either with the mutator stopped during the entire collection
                    102: (default) or incrementally during allocations.  (The latter is supported
                    103: on only a few machines.)  It does not rely on threads, but is intended
                    104: to be thread-safe.
                    105:
                    106:   Some of the ideas underlying the collector have previously been explored
                    107: by others.  (Doug McIlroy wrote a vaguely similar collector that is part of
                    108: version 8 UNIX (tm).)  However none of this work appears to have been widely
                    109: disseminated.
                    110:
                    111:   Rudimentary tools for use of the collector as a leak detector are included, as
                    112: is a fairly sophisticated string package "cord" that makes use of the collector.
                    113: (See cord/README.)
                    114:
                    115:
                    116: GENERAL DESCRIPTION
                    117:
                    118:   This is a garbage collecting storage allocator that is intended to be
                    119: used as a plug-in replacement for C's malloc.
                    120:
                    121:   Since the collector does not require pointers to be tagged, it does not
                    122: attempt to ensure that all inaccessible storage is reclaimed.  However,
                    123: in our experience, it is typically more successful at reclaiming unused
                    124: memory than most C programs using explicit deallocation.  Unlike manually
                    125: introduced leaks, the amount of unreclaimed memory typically stays
                    126: bounded.
                    127:
                    128:   In the following, an "object" is defined to be a region of memory allocated
                    129: by the routines described below.
                    130:
                    131:   Any objects not intended to be collected must be pointed to either
                    132: from other such accessible objects, or from the registers,
                    133: stack, data, or statically allocated bss segments.  Pointers from
                    134: the stack or registers may point to anywhere inside an object.
                    135: The same is true for heap pointers if the collector is compiled with
                    136:  ALL_INTERIOR_POINTERS defined, as is now the default.
                    137:
                    138: Compiling without ALL_INTERIOR_POINTERS may reduce accidental retention
                    139: of garbage objects, by requiring pointers from the heap to to the beginning
                    140: of an object.  But this no longer appears to be a significant
                    141: issue for most programs.
                    142:
                    143: There are a number of routines which modify the pointer recognition
                    144: algorithm.  GC_register_displacement allows certain interior pointers
                    145: to be recognized even if ALL_INTERIOR_POINTERS is nor defined.
                    146: GC_malloc_ignore_off_page allows some pointers into the middle of large objects
                    147: to be disregarded, greatly reducing the probablility of accidental
                    148: retention of large objects.  For most purposes it seems best to compile
                    149: with ALL_INTERIOR_POINTERS and to use GC_malloc_ignore_off_page if
                    150: you get collector warnings from allocations of very large objects.
                    151: See README.debugging for details.
                    152:
                    153:   Note that pointers inside memory allocated by the standard "malloc" are not
                    154: seen by the garbage collector.  Thus objects pointed to only from such a
                    155: region may be prematurely deallocated.  It is thus suggested that the
                    156: standard "malloc" be used only for memory regions, such as I/O buffers, that
                    157: are guaranteed not to contain pointers to garbage collectable memory.
                    158: Pointers in C language automatic, static, or register variables,
                    159: are correctly recognized.  (Note that GC_malloc_uncollectable has semantics
                    160: similar to standard malloc, but allocates objects that are traced by the
                    161: collector.)
                    162:
                    163:   The collector does not always know how to find pointers in data
                    164: areas that are associated with dynamic libraries.  This is easy to
                    165: remedy IF you know how to find those data areas on your operating
                    166: system (see GC_add_roots).  Code for doing this under SunOS, IRIX 5.X and 6.X,
                    167: HP/UX, Alpha OSF/1, Linux, and win32 is included and used by default.  (See
                    168: README.win32 for win32 details.)  On other systems pointers from dynamic
                    169: library data areas may not be considered by the collector.
                    170:
                    171:   Note that the garbage collector does not need to be informed of shared
                    172: read-only data.  However if the shared library mechanism can introduce
                    173: discontiguous data areas that may contain pointers, then the collector does
                    174: need to be informed.
                    175:
                    176:   Signal processing for most signals may be deferred during collection,
                    177: and during uninterruptible parts of the allocation process.  Unlike
                    178: standard ANSI C mallocs, it can be safe to invoke malloc
                    179: from a signal handler while another malloc is in progress, provided
                    180: the original malloc is not restarted.  (Empirically, many UNIX
                    181: applications already assume this.)  To obtain this level  of signal
                    182: safety, remove the definition of -DNO_SIGNALS in Makefile.  This incurs
                    183: a minor performance penalty, and hence is no longer the default.
                    184:
                    185:   The allocator/collector can also be configured for thread-safe operation.
                    186: (Full signal safety can also be achieved, but only at the cost of two system
                    187: calls per malloc, which is usually unacceptable.)
                    188:
                    189: INSTALLATION AND PORTABILITY
                    190:
                    191:   As distributed, the macro SILENT is defined in Makefile.
                    192: In the event of problems, this can be removed to obtain a moderate
                    193: amount of descriptive output for each collection.
                    194: (The given statistics exhibit a few peculiarities.
                    195: Things don't appear to add up for a variety of reasons, most notably
                    196: fragmentation losses.  These are probably much more significant for the
                    197: contrived program "test.c" than for your application.)
                    198:
                    199:   Note that typing "make test" will automatically build the collector
                    200: and then run setjmp_test and gctest. Setjmp_test will give you information
                    201: about configuring the collector, which is useful primarily if you have
                    202: a machine that's not already supported.  Gctest is a somewhat superficial
                    203: test of collector functionality.  Failure is indicated by a core dump or
                    204: a message to the effect that the collector is broken.  Gctest takes about
                    205: 35 seconds to run on a SPARCstation 2. On a slower machine,
                    206: expect it to take a while.  It may use up to 8 MB of memory.  (The
                    207: multi-threaded version will use more.)  "Make test" will also, as
                    208: its last step, attempt to build and test the "cord" string library.
                    209: This will fail without an ANSI C compiler.
                    210:
                    211:   The Makefile will generate a library gc.a which you should link against.
                    212: Typing "make cords" will add the cord library to gc.a.
                    213: Note that this requires an ANSI C compiler.
                    214:
                    215:   It is suggested that if you need to replace a piece of the collector
                    216: (e.g. GC_mark_rts.c) you simply list your version ahead of gc.a on the
                    217:                work.)
                    218: ld command line, rather than replacing the one in gc.a.  (This will
                    219: generate numerous warnings under some versions of AIX, but it still
                    220: works.)
                    221:
                    222:   All include files that need to be used by clients will be put in the
                    223: include subdirectory.  (Normally this is just gc.h.  "Make cords" adds
                    224: "cord.h" and "ec.h".)
                    225:
                    226:   The collector currently is designed to run essentially unmodified on
                    227: machines that use a flat 32-bit or 64-bit address space.
                    228: That includes the vast majority of Workstations and X86 (X >= 3) PCs.
                    229: (The list here was deleted because it was getting too long and constantly
                    230: out of date.)
                    231:   It does NOT run under plain 16-bit DOS or Windows 3.X.  There are however
                    232: various packages (e.g. win32s, djgpp) that allow flat 32-bit address
                    233: applications to run under those systemsif the have at least an 80386 processor,
                    234: and several of those are compatible with the collector.
                    235:
                    236:   In a few cases (Amiga, OS/2, Win32, MacOS) a separate makefile
                    237: or equivalent is supplied.  Many of these have separate README.system
                    238: files.
                    239:
                    240:   Dynamic libraries are completely supported only under SunOS
                    241: (and even that support is not functional on the last Sun 3 release),
                    242: IRIX 5&6, HP-PA, Win32 (not Win32S) and OSF/1 on DEC AXP machines.
                    243: On other machines we recommend that you do one of the following:
                    244:
                    245:   1) Add dynamic library support (and send us the code).
                    246:   2) Use static versions of the libraries.
                    247:   3) Arrange for dynamic libraries to use the standard malloc.
                    248:      This is still dangerous if the library stores a pointer to a
                    249:      garbage collected object.  But nearly all standard interfaces
                    250:      prohibit this, because they deal correctly with pointers
                    251:      to stack allocated objects.  (Strtok is an exception.  Don't
                    252:      use it.)
                    253:
                    254:   In all cases we assume that pointer alignment is consistent with that
                    255: enforced by the standard C compilers.  If you use a nonstandard compiler
                    256: you may have to adjust the alignment parameters defined in gc_priv.h.
                    257:
                    258:   A port to a machine that is not byte addressed, or does not use 32 bit
                    259: or 64 bit addresses will require a major effort.  A port to plain MSDOS
                    260: or win16 is hard.
                    261:
                    262:   For machines not already mentioned, or for nonstandard compilers, the
                    263: following are likely to require change:
                    264:
                    265: 1.  The parameters in gcconfig.h.
                    266:       The parameters that will usually require adjustment are
                    267:    STACKBOTTOM,  ALIGNMENT and DATASTART.  Setjmp_test
                    268:    prints its guesses of the first two.
                    269:       DATASTART should be an expression for computing the
                    270:    address of the beginning of the data segment.  This can often be
                    271:    &etext.  But some memory management units require that there be
                    272:    some unmapped space between the text and the data segment.  Thus
                    273:    it may be more complicated.   On UNIX systems, this is rarely
                    274:    documented.  But the adb "$m" command may be helpful.  (Note
                    275:    that DATASTART will usually be a function of &etext.  Thus a
                    276:    single experiment is usually insufficient.)
                    277:      STACKBOTTOM is used to initialize GC_stackbottom, which
                    278:    should be a sufficient approximation to the coldest stack address.
                    279:    On some machines, it is difficult to obtain such a value that is
                    280:    valid across a variety of MMUs, OS releases, etc.  A number of
                    281:    alternatives exist for using the collector in spite of this.  See the
                    282:    discussion in gcconfig.h immediately preceding the various
                    283:    definitions of STACKBOTTOM.
                    284:
                    285: 2.  mach_dep.c.
                    286:       The most important routine here is one to mark from registers.
                    287:     The distributed file includes a generic hack (based on setjmp) that
                    288:     happens to work on many machines, and may work on yours.  Try
                    289:     compiling and running setjmp_t.c to see whether it has a chance of
                    290:     working.  (This is not correct C, so don't blame your compiler if it
                    291:     doesn't work.  Based on limited experience, register window machines
                    292:     are likely to cause trouble.  If your version of setjmp claims that
                    293:     all accessible variables, including registers, have the value they
                    294:     had at the time of the longjmp, it also will not work.  Vanilla 4.2 BSD
                    295:     on Vaxen makes such a claim.  SunOS does not.)
                    296:       If your compiler does not allow in-line assembly code, or if you prefer
                    297:     not to use such a facility, mach_dep.c may be replaced by a .s file
                    298:     (as we did for the MIPS machine and the PC/RT).
                    299:       At this point enough architectures are supported by mach_dep.c
                    300:     that you will rarely need to do more than adjust for assembler
                    301:     syntax.
                    302:
                    303: 3.  os_dep.c (and gc_priv.h).
                    304:          Several kinds of operating system dependent routines reside here.
                    305:        Many are optional.  Several are invoked only through corresponding
                    306:        macros in gc_priv.h, which may also be redefined as appropriate.
                    307:       The routine GC_register_data_segments is crucial.  It registers static
                    308:     data areas that must be traversed by the collector. (User calls to
                    309:     GC_add_roots may sometimes be used for similar effect.)
                    310:       Routines to obtain memory from the OS also reside here.
                    311:     Alternatively this can be done entirely by the macro GET_MEM
                    312:     defined in gc_priv.h.  Routines to disable and reenable signals
                    313:     also reside here if they are need by the macros DISABLE_SIGNALS
                    314:     and ENABLE_SIGNALS defined in gc_priv.h.
                    315:       In a multithreaded environment, the macros LOCK and UNLOCK
                    316:     in gc_priv.h will need to be suitably redefined.
                    317:       The incremental collector requires page dirty information, which
                    318:     is acquired through routines defined in os_dep.c.  Unless directed
                    319:     otherwise by gcconfig.h, these are implemented as stubs that simply
                    320:     treat all pages as dirty.  (This of course makes the incremental
                    321:     collector much less useful.)
                    322:
                    323: 4.  dyn_load.c
                    324:        This provides a routine that allows the collector to scan data
                    325:        segments associated with dynamic libraries.  Often it is not
                    326:        necessary to provide this routine unless user-written dynamic
                    327:        libraries are used.
                    328:
                    329:   For a different version of UN*X or different machines using the
                    330: Motorola 68000, Vax, SPARC, 80386, NS 32000, PC/RT, or MIPS architecture,
                    331: it should frequently suffice to change definitions in gcconfig.h.
                    332:
                    333:
                    334: THE C INTERFACE TO THE ALLOCATOR
                    335:
                    336:   The following routines are intended to be directly called by the user.
                    337: Note that usually only GC_malloc is necessary.  GC_clear_roots and GC_add_roots
                    338: calls may be required if the collector has to trace from nonstandard places
                    339: (e.g. from dynamic library data areas on a machine on which the
                    340: collector doesn't already understand them.)  On some machines, it may
                    341: be desirable to set GC_stacktop to a good approximation of the stack base.
                    342: (This enhances code portability on HP PA machines, since there is no
                    343: good way for the collector to compute this value.)  Client code may include
                    344: "gc.h", which defines all of the following, plus many others.
                    345:
                    346: 1)  GC_malloc(nbytes)
                    347:     - allocate an object of size nbytes.  Unlike malloc, the object is
                    348:       cleared before being returned to the user.  Gc_malloc will
                    349:       invoke the garbage collector when it determines this to be appropriate.
                    350:       GC_malloc may return 0 if it is unable to acquire sufficient
                    351:       space from the operating system.  This is the most probable
                    352:       consequence of running out of space.  Other possible consequences
                    353:       are that a function call will fail due to lack of stack space,
                    354:       or that the collector will fail in other ways because it cannot
                    355:       maintain its internal data structures, or that a crucial system
                    356:       process will fail and take down the machine.  Most of these
                    357:       possibilities are independent of the malloc implementation.
                    358:
                    359: 2)  GC_malloc_atomic(nbytes)
                    360:     - allocate an object of size nbytes that is guaranteed not to contain any
                    361:       pointers.  The returned object is not guaranteed to be cleared.
                    362:       (Can always be replaced by GC_malloc, but results in faster collection
                    363:       times.  The collector will probably run faster if large character
                    364:       arrays, etc. are allocated with GC_malloc_atomic than if they are
                    365:       statically allocated.)
                    366:
                    367: 3)  GC_realloc(object, new_size)
                    368:     - change the size of object to be new_size.  Returns a pointer to the
                    369:       new object, which may, or may not, be the same as the pointer to
                    370:       the old object.  The new object is taken to be atomic iff the old one
                    371:       was.  If the new object is composite and larger than the original object,
                    372:       then the newly added bytes are cleared (we hope).  This is very likely
                    373:       to allocate a new object, unless MERGE_SIZES is defined in gc_priv.h.
                    374:       Even then, it is likely to recycle the old object only if the object
                    375:       is grown in small additive increments (which, we claim, is generally bad
                    376:       coding practice.)
                    377:
                    378: 4)  GC_free(object)
                    379:     - explicitly deallocate an object returned by GC_malloc or
                    380:       GC_malloc_atomic.  Not necessary, but can be used to minimize
                    381:       collections if performance is critical.  Probably a performance
                    382:       loss for very small objects (<= 8 bytes).
                    383:
                    384: 5)  GC_expand_hp(bytes)
                    385:     - Explicitly increase the heap size.  (This is normally done automatically
                    386:       if a garbage collection failed to GC_reclaim enough memory.  Explicit
                    387:       calls to GC_expand_hp may prevent unnecessarily frequent collections at
                    388:       program startup.)
                    389:
                    390: 6)  GC_malloc_ignore_off_page(bytes)
                    391:        - identical to GC_malloc, but the client promises to keep a pointer to
                    392:          the somewhere within the first 256 bytes of the object while it is
                    393:          live.  (This pointer should nortmally be declared volatile to prevent
                    394:          interference from compiler optimizations.)  This is the recommended
                    395:          way to allocate anything that is likely to be larger than 100Kbytes
                    396:          or so.  (GC_malloc may result in failure to reclaim such objects.)
                    397:
                    398: 7)  GC_set_warn_proc(proc)
                    399:        - Can be used to redirect warnings from the collector.  Such warnings
                    400:          should be rare, and should not be ignored during code development.
                    401:
                    402: 8) GC_enable_incremental()
                    403:     - Enables generational and incremental collection.  Useful for large
                    404:       heaps on machines that provide access to page dirty information.
                    405:       Some dirty bit implementations may interfere with debugging
                    406:       (by catching address faults) and place restrictions on heap arguments
                    407:       to system calls (since write faults inside a system call may not be
                    408:       handled well).
                    409:
                    410: 9) Several routines to allow for registration of finalization code.
                    411:    User supplied finalization code may be invoked when an object becomes
                    412:    unreachable.  To call (*f)(obj, x) when obj becomes inaccessible, use
                    413:        GC_register_finalizer(obj, f, x, 0, 0);
                    414:    For more sophisticated uses, and for finalization ordering issues,
                    415:    see gc.h.
                    416:
                    417:   The global variable GC_free_space_divisor may be adjusted up from its
                    418: default value of 4 to use less space and more collection time, or down for
                    419: the opposite effect.  Setting it to 1 or 0 will effectively disable collections
                    420: and cause all allocations to simply grow the heap.
                    421:
                    422:   The variable GC_non_gc_bytes, which is normally 0, may be changed to reflect
                    423: the amount of memory allocated by the above routines that should not be
                    424: considered as a candidate for collection.  Careless use may, of course, result
                    425: in excessive memory consumption.
                    426:
                    427:   Some additional tuning is possible through the parameters defined
                    428: near the top of gc_priv.h.
                    429:
                    430:   If only GC_malloc is intended to be used, it might be appropriate to define:
                    431:
                    432: #define malloc(n) GC_malloc(n)
                    433: #define calloc(m,n) GC_malloc((m)*(n))
                    434:
                    435:   For small pieces of VERY allocation intensive code, gc_inl.h
                    436: includes some allocation macros that may be used in place of GC_malloc
                    437: and friends.
                    438:
                    439:   All externally visible names in the garbage collector start with "GC_".
                    440: To avoid name conflicts, client code should avoid this prefix, except when
                    441: accessing garbage collector routines or variables.
                    442:
                    443:   There are provisions for allocation with explicit type information.
                    444: This is rarely necessary.  Details can be found in gc_typed.h.
                    445:
                    446: THE C++ INTERFACE TO THE ALLOCATOR:
                    447:
                    448:   The Ellis-Hull C++ interface to the collector is included in
                    449: the collector distribution.  If you intend to use this, type
                    450: "make c++" after the initial build of the collector is complete.
                    451: See gc_cpp.h for the definition of the interface.  This interface
                    452: tries to approximate the Ellis-Detlefs C++ garbage collection
                    453: proposal without compiler changes.
                    454:
                    455: Cautions:
                    456: 1. Arrays allocated without new placement syntax are
                    457: allocated as uncollectable objects.  They are traced by the
                    458: collector, but will not be reclaimed.
                    459:
                    460: 2. Failure to use "make c++" in combination with (1) will
                    461: result in arrays allocated using the default new operator.
                    462: This is likely to result in disaster without linker warnings.
                    463:
                    464: 3. If your compiler supports an overloaded new[] operator,
                    465: then gc_cpp.cc and gc_cpp.h should be suitably modified.
                    466:
                    467: 4. Many current C++ compilers have deficiencies that
                    468: break some of the functionality.  See the comments in gc_cpp.h
                    469: for suggested workarounds.
                    470:
                    471: USE AS LEAK DETECTOR:
                    472:
                    473:   The collector may be used to track down leaks in C programs that are
                    474: intended to run with malloc/free (e.g. code with extreme real-time or
                    475: portability constraints).  To do so define FIND_LEAK in Makefile
                    476: This will cause the collector to invoke the report_leak
                    477: routine defined near the top of reclaim.c whenever an inaccessible
                    478: object is found that has not been explicitly freed.  The collector will
                    479: no longer reclaim inaccessible memory; in this form it is purely a
                    480: debugging tool.
                    481:   Productive use of this facility normally involves redefining report_leak
                    482: to do something more intelligent.  This typically requires annotating
                    483: objects with additional information (e.g. creation time stack trace) that
                    484: identifies their origin.  Such code is typically not very portable, and is
                    485: not included here, except on SPARC machines.
                    486:   If all objects are allocated with GC_DEBUG_MALLOC (see next section),
                    487: then the default version of report_leak will report the source file
                    488: and line number at which the leaked object was allocated.  This may
                    489: sometimes be sufficient.  (On SPARC/SUNOS4 machines, it will also report
                    490: a cryptic stack trace.  This can often be turned into a sympolic stack
                    491: trace by invoking program "foo" with "callprocs foo".  Callprocs is
                    492: a short shell script that invokes adb to expand program counter values
                    493: to symbolic addresses.  It was largely supplied by Scott Schwartz.)
                    494:   Note that the debugging facilities described in the next section can
                    495: sometimes be slightly LESS effective in leak finding mode, since in
                    496: leak finding mode, GC_debug_free actually results in reuse of the object.
                    497: (Otherwise the object is simply marked invalid.)  Also note that the test
                    498: program is not designed to run meaningfully in FIND_LEAK mode.
                    499: Use "make gc.a" to build the collector.
                    500:
                    501: DEBUGGING FACILITIES:
                    502:
                    503:   The routines GC_debug_malloc, GC_debug_malloc_atomic, GC_debug_realloc,
                    504: and GC_debug_free provide an alternate interface to the collector, which
                    505: provides some help with memory overwrite errors, and the like.
                    506: Objects allocated in this way are annotated with additional
                    507: information.  Some of this information is checked during garbage
                    508: collections, and detected inconsistencies are reported to stderr.
                    509:
                    510:   Simple cases of writing past the end of an allocated object should
                    511: be caught if the object is explicitly deallocated, or if the
                    512: collector is invoked while the object is live.  The first deallocation
                    513: of an object will clear the debugging info associated with an
                    514: object, so accidentally repeated calls to GC_debug_free will report the
                    515: deallocation of an object without debugging information.  Out of
                    516: memory errors will be reported to stderr, in addition to returning
                    517: NIL.
                    518:
                    519:   GC_debug_malloc checking  during garbage collection is enabled
                    520: with the first call to GC_debug_malloc.  This will result in some
                    521: slowdown during collections.  If frequent heap checks are desired,
                    522: this can be achieved by explicitly invoking GC_gcollect, e.g. from
                    523: the debugger.
                    524:
                    525:   GC_debug_malloc allocated objects should not be passed to GC_realloc
                    526: or GC_free, and conversely.  It is however acceptable to allocate only
                    527: some objects with GC_debug_malloc, and to use GC_malloc for other objects,
                    528: provided the two pools are kept distinct.  In this case, there is a very
                    529: low probablility that GC_malloc allocated objects may be misidentified as
                    530: having been overwritten.  This should happen with probability at most
                    531: one in 2**32.  This probability is zero if GC_debug_malloc is never called.
                    532:
                    533:   GC_debug_malloc, GC_malloc_atomic, and GC_debug_realloc take two
                    534: additional trailing arguments, a string and an integer.  These are not
                    535: interpreted by the allocator.  They are stored in the object (the string is
                    536: not copied).  If an error involving the object is detected, they are printed.
                    537:
                    538:   The macros GC_MALLOC, GC_MALLOC_ATOMIC, GC_REALLOC, GC_FREE, and
                    539: GC_REGISTER_FINALIZER are also provided.  These require the same arguments
                    540: as the corresponding (nondebugging) routines.  If gc.h is included
                    541: with GC_DEBUG defined, they call the debugging versions of these
                    542: functions, passing the current file name and line number as the two
                    543: extra arguments, where appropriate.  If gc.h is included without GC_DEBUG
                    544: defined, then all these macros will instead be defined to their nondebugging
                    545: equivalents.  (GC_REGISTER_FINALIZER is necessary, since pointers to
                    546: objects with debugging information are really pointers to a displacement
                    547: of 16 bytes form the object beginning, and some translation is necessary
                    548: when finalization routines are invoked.  For details, about what's stored
                    549: in the header, see the definition of the type oh in debug_malloc.c)
                    550:
                    551: INCREMENTAL/GENERATIONAL COLLECTION:
                    552:
                    553: The collector normally interrupts client code for the duration of
                    554: a garbage collection mark phase.  This may be unacceptable if interactive
                    555: response is needed for programs with large heaps.  The collector
                    556: can also run in a "generational" mode, in which it usually attempts to
                    557: collect only objects allocated since the last garbage collection.
                    558: Furthermore, in this mode, garbage collections run mostly incrementally,
                    559: with a small amount of work performed in response to each of a large number of
                    560: GC_malloc requests.
                    561:
                    562: This mode is enabled by a call to GC_enable_incremental().
                    563:
                    564: Incremental and generational collection is effective in reducing
                    565: pause times only if the collector has some way to tell which objects
                    566: or pages have been recently modified.  The collector uses two sources
                    567: of information:
                    568:
                    569: 1. Information provided by the VM system.  This may be provided in
                    570: one of several forms.  Under Solaris 2.X (and potentially under other
                    571: similar systems) information on dirty pages can be read from the
                    572: /proc file system.  Under other systems (currently SunOS4.X) it is
                    573: possible to write-protect the heap, and catch the resulting faults.
                    574: On these systems we require that system calls writing to the heap
                    575: (other than read) be handled specially by client code.
                    576: See os_dep.c for details.
                    577:
                    578: 2. Information supplied by the programmer.  We define "stubborn"
                    579: objects to be objects that are rarely changed.  Such an object
                    580: can be allocated (and enabled for writing) with GC_malloc_stubborn.
                    581: Once it has been initialized, the collector should be informed with
                    582: a call to GC_end_stubborn_change.  Subsequent writes that store
                    583: pointers into the object must be preceded by a call to
                    584: GC_change_stubborn.
                    585:
                    586: This mechanism performs best for objects that are written only for
                    587: initialization, and such that only one stubborn object is writable
                    588: at once.  It is typically not worth using for short-lived
                    589: objects.  Stubborn objects are treated less efficiently than pointerfree
                    590: (atomic) objects.
                    591:
                    592: A rough rule of thumb is that, in the absence of VM information, garbage
                    593: collection pauses are proportional to the amount of pointerful storage
                    594: plus the amount of modified "stubborn" storage that is reachable during
                    595: the collection.
                    596:
                    597: Initial allocation of stubborn objects takes longer than allocation
                    598: of other objects, since other data structures need to be maintained.
                    599:
                    600: We recommend against random use of stubborn objects in client
                    601: code, since bugs caused by inappropriate writes to stubborn objects
                    602: are likely to be very infrequently observed and hard to trace.
                    603: However, their use may be appropriate in a few carefully written
                    604: library routines that do not make the objects themselves available
                    605: for writing by client code.
                    606:
                    607:
                    608: BUGS:
                    609:
                    610:   Any memory that does not have a recognizable pointer to it will be
                    611: reclaimed.  Exclusive-or'ing forward and backward links in a list
                    612: doesn't cut it.
                    613:   Some C optimizers may lose the last undisguised pointer to a memory
                    614: object as a consequence of clever optimizations.  This has almost
                    615: never been observed in practice.  Send mail to boehm@sgi.com
                    616: for suggestions on how to fix your compiler.
                    617:   This is not a real-time collector.  In the standard configuration,
                    618: percentage of time required for collection should be constant across
                    619: heap sizes.  But collection pauses will increase for larger heaps.
                    620: (On SPARCstation 2s collection times will be on the order of 300 msecs
                    621: per MB of accessible memory that needs to be scanned.  Your mileage
                    622: may vary.)  The incremental/generational collection facility helps,
                    623: but is portable only if "stubborn" allocation is used.
                    624:   Please address bug reports to boehm@sgi.com.  If you are
                    625: contemplating a major addition, you might also send mail to ask whether
                    626: it's already been done (or whether we tried and discarded it).
                    627:
                    628: RECENT VERSIONS:
                    629:
                    630:   Version 1.3 and immediately preceding versions contained spurious
                    631: assembly language assignments to TMP_SP.  Only the assignment in the PC/RT
                    632: code is necessary.  On other machines, with certain compiler options,
                    633: the assignments can lead to an unsaved register being overwritten.
                    634: Known to cause problems under SunOS 3.5 WITHOUT the -O option.  (With
                    635: -O the compiler recognizes it as dead code.  It probably shouldn't,
                    636: but that's another story.)
                    637:
                    638:   Version 1.4 and earlier versions used compile time determined values
                    639: for the stack base.  This no longer works on Sun 3s, since Sun 3/80s use
                    640: a different stack base.  We now use a straightforward heuristic on all
                    641: machines on which it is known to work (incl. Sun 3s) and compile-time
                    642: determined values for the rest.  There should really be library calls
                    643: to determine such values.
                    644:
                    645:   Version 1.5 and earlier did not ensure 8 byte alignment for objects
                    646: allocated on a sparc based machine.
                    647:
                    648:   Version 1.8 added ULTRIX support in gc_private.h.
                    649:
                    650:   Version 1.9 fixed a major bug in gc_realloc.
                    651:
                    652:   Version 2.0 introduced a consistent naming convention for collector
                    653: routines and added support for registering dynamic library data segments
                    654: in the standard mark_roots.c.  Most of the data structures were revamped.
                    655: The treatment of interior pointers was completely changed.  Finalization
                    656: was added.  Support for locking was added.  Object kinds were added.
                    657: We added a black listing facility to avoid allocating at addresses known
                    658: to occur as integers somewhere in the address space.  Much of this
                    659: was accomplished by adapting ideas and code from the PCR collector.
                    660: The test program was changed and expanded.
                    661:
                    662:   Version 2.1 was the first stable version since 1.9, and added support
                    663: for PPCR.
                    664:
                    665:   Version 2.2 added debugging allocation, and fixed various bugs.  Among them:
                    666: - GC_realloc could fail to extend the size of the object for certain large object sizes.
                    667: - A blatant subscript range error in GC_printf, which unfortunately
                    668:   wasn't exercised on machines with sufficient stack alignment constraints.
                    669: - GC_register_displacement did the wrong thing if it was called after
                    670:   any allocation had taken place.
                    671: - The leak finding code would eventually break after 2048 byte
                    672:   byte objects leaked.
                    673: - interface.c didn't compile.
                    674: - The heap size remained much too small for large stacks.
                    675: - The stack clearing code behaved badly for large stacks, and perhaps
                    676:   on HP/PA machines.
                    677:
                    678:   Version 2.3 added ALL_INTERIOR_POINTERS and fixed the following bugs:
                    679: - Missing declaration of etext in the A/UX version.
                    680: - Some PCR root-finding problems.
                    681: - Blacklisting was not 100% effective, because the plausible future
                    682:   heap bounds were being miscalculated.
                    683: - GC_realloc didn't handle out-of-memory correctly.
                    684: - GC_base could return a nonzero value for addresses inside free blocks.
                    685: - test.c wasn't really thread safe, and could erroneously report failure
                    686:   in a multithreaded environment.  (The locking primitives need to be
                    687:   replaced for other threads packages.)
                    688: - GC_CONS was thoroughly broken.
                    689: - On a SPARC with dynamic linking, signals stayed diabled while the
                    690:   client code was running.
                    691:   (Thanks to Manuel Serrano at INRIA for reporting the last two.)
                    692:
                    693:   Version 2.4 added GC_free_space_divisor as a tuning knob, added
                    694:   support for OS/2 and linux, and fixed the following bugs:
                    695: - On machines with unaligned pointers (e.g. Sun 3), every 128th word could
                    696:   fail to be considered for marking.
                    697: - Dynamic_load.c erroneously added 4 bytes to the length of the data and
                    698:   bss sections of the dynamic library.  This could result in a bad memory
                    699:   reference if the actual length was a multiple of a page.  (Observed on
                    700:   Sun 3.  Can probably also happen on a Sun 4.)
                    701:   (Thanks to Robert Brazile for pointing out that the Sun 3 version
                    702:   was broken.  Dynamic library handling is still broken on Sun 3s
                    703:   under 4.1.1U1, but apparently not 4.1.1.  If you have such a machine,
                    704:   use -Bstatic.)
                    705:
                    706:   Version 2.5 fixed the following bugs:
                    707: - Removed an explicit call to exit(1)
                    708: - Fixed calls to GC_printf and GC_err_printf, so the correct number of
                    709:   arguments are always supplied.  The OS/2 C compiler gets confused if
                    710:   the number of actuals and the number of formals differ.  (ANSI C
                    711:   doesn't require this to work.  The ANSI sanctioned way of doing things
                    712:   causes too many compatibility problems.)
                    713:
                    714:   Version 3.0  added generational/incremental collection and stubborn
                    715:   objects.
                    716:
                    717:   Version 3.1 added the following features:
                    718: - A workaround for a SunOS 4.X SPARC C compiler
                    719:   misfeature that caused problems when the collector was turned into
                    720:   a dynamic library.
                    721: - A fix for a bug in GC_base that could result in a memory fault.
                    722: - A fix for a performance bug (and several other misfeatures) pointed
                    723:   out by Dave Detlefs and Al Dosser.
                    724: - Use of dirty bit information for static data under Solaris 2.X.
                    725: - DEC Alpha/OSF1 support (thanks to Al Dosser).
                    726: - Incremental collection on more platforms.
                    727: - A more refined heap expansion policy.  Less space usage by default.
                    728: - Various minor enhancements to reduce space usage, and to reduce
                    729:   the amount of memory scanned by the collector.
                    730: - Uncollectable allocation without per object overhead.
                    731: - More conscientious handling of out-of-memory conditions.
                    732: - Fixed a bug in debugging stubborn allocation.
                    733: - Fixed a bug that resulted in occasional erroneous reporting of smashed
                    734:   objects with debugging allocation.
                    735: - Fixed bogus leak reports of size 4096 blocks with FIND_LEAK.
                    736:
                    737:   Version 3.2 fixed a serious and not entirely repeatable bug in
                    738:   the incremental collector.  It appeared only when dirty bit info
                    739:   on the roots was available, which is normally only under Solaris.
                    740:   It also added GC_general_register_disappearing_link, and some
                    741:   testing code.  Interface.c disappeared.
                    742:
                    743:   Version 3.3 fixes several bugs and adds new ports:
                    744: - PCR-specific bugs.
                    745: - Missing locking in GC_free, redundant FASTUNLOCK
                    746:   in GC_malloc_stubborn, and 2 bugs in
                    747:   GC_unregister_disappearing_link.
                    748:   All of the above were pointed out by Neil Sharman
                    749:   (neil@cs.mu.oz.au).
                    750: - Common symbols allocated by the SunOS4.X dynamic loader
                    751:   were not included in the root set.
                    752: - Bug in GC_finalize (reported by Brian Beuning and Al Dosser)
                    753: - Merged Amiga port from Jesper Peterson (untested)
                    754: - Merged NeXT port from Thomas Funke (significantly
                    755:   modified and untested)
                    756:
                    757:   Version 3.4:
                    758: - Fixed a performance bug in GC_realloc.
                    759: - Updated the amiga port.
                    760: - Added NetBSD and 386BSD ports.
                    761: - Added cord library.
                    762: - Added trivial performance enhancement for
                    763:   ALL_INTERIOR_POINTERS.  (Don't scan last word.)
                    764:
                    765:   Version 3.5
                    766: - Minor collections now mark from roots only once, if that
                    767:   doesn't cause an excessive pause.
                    768: - The stack clearing heuristic was refined to prevent anomalies
                    769:   with very heavily recursive programs and sparse stacks.
                    770: - Fixed a bug that prevented mark stack growth in some cases.
                    771:   GC_objects_are_marked should be set to TRUE after a call
                    772:   to GC_push_roots and as part of GC_push_marked, since
                    773:   both can now set mark bits.  I think this is only a performance
                    774:   bug, but I wouldn't bet on it.  It's certainly very hard to argue
                    775:   that the old version was correct.
                    776: - Fixed an incremental collection bug that prevented it from
                    777:   working at all when HBLKSIZE != getpagesize()
                    778: - Changed dynamic_loading.c to include gc_priv.h before testing
                    779:   DYNAMIC_LOADING.  SunOS dynamic library scanning
                    780:   must have been broken in 3.4.
                    781: - Object size rounding now adapts to program behavior.
                    782: - Added a workaround (provided by Manuel Serrano and
                    783:   colleagues) to a long-standing SunOS 4.X (and 3.X?) ld bug
                    784:   that I had incorrectly assumed to have been squished.
                    785:   The collector was broken if the text segment size was within
                    786:   32 bytes of a multiple of 8K bytes, and if the beginning of
                    787:   the data segment contained interesting roots.  The workaround
                    788:   assumes a demand-loadable executable.  The original may have
                    789:   have "worked" in some other cases.
                    790: - Added dynamic library support under IRIX5.
                    791: - Added support for EMX under OS/2 (thanks to Ari Huttunen).
                    792:
                    793: Version 3.6:
                    794: - fixed a bug in the mark stack growth code that was introduced
                    795:   in 3.4.
                    796: - fixed Makefile to work around DEC AXP compiler tail recursion
                    797:   bug.
                    798:
                    799: Version 3.7:
                    800: - Added a workaround for an HP/UX compiler bug.
                    801: - Fixed another stack clearing performance bug.  Reworked
                    802:   that code once more.
                    803:
                    804: Version 4.0:
                    805: - Added support for Solaris threads (which was possible
                    806:   only by reimplementing some fraction of Solaris threads,
                    807:   since Sun doesn't currently make the thread debugging
                    808:   interface available).
                    809: - Added non-threads win32 and win32S support.
                    810: - (Grudgingly, with suitable muttering of obscenities) renamed
                    811:   files so that the collector distribution could live on a FAT
                    812:   file system.  Files that are guaranteed to be useless on
                    813:   a PC still have long names.  Gc_inline.h and gc_private.h
                    814:   still exist, but now just include  gc_inl.h and gc_priv.h.
                    815: - Fixed a really obscure bug in finalization that could cause
                    816:   undetected mark stack overflows.  (I would be surprised if
                    817:   any real code ever tickled this one.)
                    818: - Changed finalization code to dynamically resize the hash
                    819:   tables it maintains.  (This probably does not matter for well-
                    820:   -written code.  It no doubt does for C++ code that overuses
                    821:   destructors.)
                    822: - Added typed allocation primitives.  Rewrote the marker to
                    823:   accommodate them with more reasonable efficiency.  This
                    824:   change should also speed up marking for GC_malloc allocated
                    825:   objects a little.  See gc_typed.h for new primitives.
                    826: - Improved debugging facilities slightly.  Allocation time
                    827:   stack traces are now kept by default on SPARC/SUNOS4.
                    828:   (Thanks to Scott Schwartz.)
                    829: - Added better support for small heap applications.
                    830: - Significantly extended cord package.  Fixed a bug in the
                    831:   implementation of lazily read files.  Printf and friends now
                    832:   have cord variants.  Cord traversals are a bit faster.
                    833: - Made ALL_INTERIOR_POINTERS recognition the default.
                    834: - Fixed de so that it can run in constant space, independent
                    835:   of file size.  Added simple string searching to cords and de.
                    836: - Added the Hull-Ellis C++ interface.
                    837: - Added dynamic library support for OSF/1.
                    838:   (Thanks to Al Dosser and Tim Bingham at DEC.)
                    839: - Changed argument to GC_expand_hp to be expressed
                    840:   in units of bytes instead of heap blocks.  (Necessary
                    841:   since the heap block size now varies depending on
                    842:   configuration.  The old version was never very clean.)
                    843: - Added GC_get_heap_size().  The previous "equivalent"
                    844:   was broken.
                    845: - Restructured the Makefile a bit.
                    846:
                    847: Since version 4.0:
                    848: - Changed finalization implementation to guarantee that
                    849:   finalization procedures are called outside of the allocation
                    850:   lock, making direct use of the interface a little less dangerous.
                    851:   MAY BREAK EXISTING CLIENTS that assume finalizers
                    852:   are protected by a lock.  Since there seem to be few multithreaded
                    853:   clients that use finalization, this is hopefully not much of
                    854:   a problem.
                    855: - Fixed a gross bug in CORD_prev.
                    856: - Fixed a bug in blacklst.c that could result in unbounded
                    857:   heap growth during startup on machines that do not clear
                    858:   memory obtained from the OS (e.g. win32S).
                    859: - Ported de editor to win32/win32S.  (This is now the only
                    860:   version with a mouse-sensitive UI.)
                    861: - Added GC_malloc_ignore_off_page to allocate large arrays
                    862:   in the presence of ALL_INTERIOR_POINTERS.
                    863: - Changed GC_call_with_alloc_lock to not disable signals in
                    864:   the single-threaded case.
                    865: - Reduced retry count in GC_collect_or_expand for garbage
                    866:   collecting when out of memory.
                    867: - Made uncollectable allocations bypass black-listing, as they
                    868:   should.
                    869: - Fixed a bug in typed_test in test.c that could cause (legitimate)
                    870:   GC crashes.
                    871: - Fixed some potential synchronization problems in finalize.c
                    872: - Fixed a real locking problem in typd_mlc.c.
                    873: - Worked around an AIX 3.2 compiler feature that results in
                    874:   out of bounds memory references.
                    875: - Partially worked around an IRIX5.2 beta problem (which may
                    876:   or may not persist to the final release).
                    877: - Fixed a bug in the heap integrity checking code that could
                    878:   result in explicitly deallocated objects being identified as
                    879:   smashed.  Fixed a bug in the dbg_mlc stack saving code
                    880:   that caused old argument pointers to be considered live.
                    881: - Fixed a bug in CORD_ncmp (and hence CORD_str).
                    882: - Repaired the OS2 port, which had suffered from bit rot
                    883:   in 4.0.  Worked around what appears to be CSet/2 V1.0
                    884:   optimizer bug.
                    885: - Fixed a Makefile bug for target "c++".
                    886:
                    887: Since version 4.1:
                    888: - Multiple bug fixes/workarounds in the Solaris threads version.
                    889:   (It occasionally failed to locate some register contents for
                    890:   marking.  It also turns out that thr_suspend and friends are
                    891:   unreliable in Solaris 2.3.  Dirty bit reads appear
                    892:   to be unreliable under some weird
                    893:   circumstances.  My stack marking code
                    894:   contained a serious performance bug.  The new code is
                    895:   extremely defensive, and has not failed in several cpu
                    896:   hours of testing.  But  no guarantees ...)
                    897: - Added MacOS support (thanks to Patrick Beard.)
                    898: - Fixed several syntactic bugs in gc_c++.h and friends.  (These
                    899:   didn't bother g++, but did bother most other compilers.)
                    900:   Fixed gc_c++.h finalization interface.  (It didn't.)
                    901: - 64 bit alignment for allocated objects was not guaranteed in a
                    902:   few cases in which it should have been.
                    903: - Added GC_malloc_atomic_ignore_off_page.
                    904: - Added GC_collect_a_little.
                    905: - Added some prototypes to gc.h.
                    906: - Some other minor bug fixes (notably in Makefile).
                    907: - Fixed OS/2 / EMX port (thanks to Ari Huttunen).
                    908: - Fixed AmigaDOS port. (thanks to Michel Schinz).
                    909: - Fixed the DATASTART definition under Solaris.  There
                    910:   was a 1 in 16K chance of the collector missing the first
                    911:   64K of static data (and thus crashing).
                    912: - Fixed some blatant anachronisms in the README file.
                    913: - Fixed PCR-Makefile for upcoming PPCR release.
                    914:
                    915: Since version 4.2:
                    916: - Fixed SPARC alignment problem with GC_DEBUG.
                    917: - Fixed Solaris threads /proc workaround.  The real
                    918:   problem was an interaction with mprotect.
                    919: - Incorporated fix from Patrick Beard for gc_c++.h (now gc_cpp.h).
                    920: - Slightly improved allocator space utilization by
                    921:   fixing the GC_size_map mechanism.
                    922: - Integrated some Sony News and MIPS RISCos 4.51
                    923:   patches.  (Thanks to Nobuyuki Hikichi of
                    924:   Software Research Associates, Inc. Japan)
                    925: - Fixed HP_PA alignment problem.  (Thanks to
                    926:   xjam@cork.cs.berkeley.edu.)
                    927: - Added GC_same_obj and friends.  Changed GC_base
                    928:   to return 0 for pointers past the end of large objects.
                    929:   Improved GC_base performance with ALL_INTERIOR_POINTERS
                    930:   on machines with a slow integer mod operation.
                    931:   Added GC_PTR_ADD, GC_PTR_STORE, etc. to prepare
                    932:   for preprocessor.
                    933: - changed the default on most UNIX machines to be that
                    934:   signals are not disabled during critical GC operations.
                    935:   This is still ANSI-conforming, though somewhat dangerous
                    936:   in the presence of signal handlers. But the performance
                    937:   cost of the alternative is sometimes problematic.
                    938:   Can be changed back with a minor Makefile edit.
                    939: - renamed IS_STRING in gc.h, to CORD_IS_STRING, thus
                    940:   following my own naming convention.  Added the function
                    941:   CORD_to_const_char_star.
                    942: - Fixed a gross bug in GC_finalize.  Symptom: occasional
                    943:   address faults in that function.  (Thanks to Anselm
                    944:   Baird-Smith (Anselm.BairdSmith@inria.fr)
                    945: - Added port to ICL DRS6000 running DRS/NX.  Restructured
                    946:   things a bit to factor out common code, and remove obsolete
                    947:   code.  Collector should now run under SUNOS5 with either
                    948:   mprotect or /proc dirty bits.  (Thanks to Douglas Steel
                    949:   (doug@wg.icl.co.uk)).
                    950: - More bug fixes and workarounds for Solaris 2.X.  (These were
                    951:   mostly related to putting the collector in a dynamic library,
                    952:   which didn't really work before.  Also SOLARIS_THREADS
                    953:   didn't interact well with dl_open.)  Thanks to btlewis@eng.sun.com.
                    954: - Fixed a serious performance bug on the DEC Alpha.  The text
                    955:   segment was getting registered as part of the root set.
                    956:   (Amazingly, the result was still fast enough that the bug
                    957:   was not conspicuous.) The fix works on OSF/1, version 1.3.
                    958:   Hopefully it also works on other versions of OSF/1 ...
                    959: - Fixed a bug in GC_clear_roots.
                    960: - Fixed a bug in GC_generic_malloc_words_small that broke
                    961:   gc_inl.h.  (Reported by Antoine de Maricourt.  I broke it
                    962:   in trying to tweak the Mac port.)
                    963: - Fixed some problems with cord/de under Linux.
                    964: - Fixed some cord problems, notably with CORD_riter4.
                    965: - Added DG/UX port.
                    966:   Thanks to Ben A. Mesander (ben@piglet.cr.usgs.gov)
                    967: - Added finalization registration routines with weaker ordering
                    968:   constraints.  (This is necessary for C++ finalization with
                    969:   multiple inheritance, since the compiler often adds self-cycles.)
                    970: - Filled the holes in the SCO port. (Thanks to Michael Arnoldus
                    971:   <chime@proinf.dk>.)
                    972: - John Ellis' additions to the C++ support:  From John:
                    973:
                    974: * I completely rewrote the documentation in the interface gc_c++.h
                    975: (later renamed gc_cpp.h).  I've tried to make it both clearer and more
                    976: precise.
                    977:
                    978: * The definition of accessibility now ignores pointers from an
                    979: finalizable object (an object with a clean-up function) to itself.
                    980: This allows objects with virtual base classes to be finalizable by the
                    981: collector.  Compilers typically implement virtual base classes using
                    982: pointers from an object to itself, which under the old definition of
                    983: accessibility prevented objects with virtual base classes from ever
                    984: being collected or finalized.
                    985:
                    986: * gc_cleanup now includes gc as a virtual base.  This was enabled by
                    987: the change in the definition of accessibility.
                    988:
                    989: * I added support for operator new[].  Since most (all?) compilers
                    990: don't yet support operator new[], it is conditionalized on
                    991: -DOPERATOR_NEW_ARRAY.  The code is untested, but its trivial and looks
                    992: correct.
                    993:
                    994: * The test program test_gc_c++ (later renamed test_cpp.cc)
                    995: tries to test for the C++-specific functionality not tested by the
                    996: other programs.
                    997: - Added <unistd.h> include to misc.c.  (Needed for ppcr.)
                    998: - Added PowerMac port. (Thanks to Patrick Beard again.)
                    999: - Fixed "srcdir"-related Makefile problems.  Changed things so
                   1000:   that all externally visible include files always appear in the
                   1001:   include subdirectory of the source.  Made gc.h directly
                   1002:   includable from C++ code.  (These were at Per
                   1003:   Bothner's suggestion.)
                   1004: - Changed Intel code to also mark from ebp (Kevin Warne's
                   1005:   suggestion).
                   1006: - Renamed C++ related files so they could live in a FAT
                   1007:   file system. (Charles Fiterman's suggestion.)
                   1008: - Changed Windows NT Makefile to include C++ support in
                   1009:   gc.lib.  Added C++ test as Makefile target.
                   1010:
                   1011: Since version 4.3:
                   1012:  - ASM_CLEAR_CODE was erroneously defined for HP
                   1013:    PA machines, resulting in a compile error.
                   1014:  - Fixed OS/2 Makefile to create a library.  (Thanks to
                   1015:    Mark Boulter (mboulter@vnet.ibm.com)).
                   1016:  - Gc_cleanup objects didn't work if they were created on
                   1017:    the stack.  Fixed.
                   1018:  - One copy of Gc_cpp.h in the distribution was out of
                   1019:    synch, and failed to document some known compiler
                   1020:    problems with explicit destructor invocation.  Partially
                   1021:    fixed.  There are probably other compilers on which
                   1022:    gc_cleanup is miscompiled.
                   1023:  - Fixed Makefile to pass C compiler flags to C++ compiler.
                   1024:  - Added Mac fixes.
                   1025:  - Fixed os_dep.c to work around what appears to be
                   1026:    a new and different VirtualQuery bug under newer
                   1027:    versions of win32S.
                   1028:  - GC_non_gc_bytes was not correctly maintained by
                   1029:    GC_free.  Fixed.  Thanks to James Clark (jjc@jclark.com).
                   1030:  - Added GC_set_max_heap_size.
                   1031:  - Changed allocation code to ignore blacklisting if it is preventing
                   1032:    use of a very large block of memory.  This has the advantage
                   1033:    that naive code allocating very large objects is much more
                   1034:    likely to work.  The downside is you might no
                   1035:    longer find out that such code should really use
                   1036:    GC_malloc_ignore_off_page.
                   1037:  - Changed GC_printf under win32 to close and reopen the file
                   1038:    between calls.  FAT file systems otherwise make the log file
                   1039:    useless for debugging.
                   1040:  - Added GC_try_to_collect and GC_get_bytes_since_gc.  These
                   1041:    allow starting an abortable collection during idle times.
                   1042:    This facility does not require special OS support.  (Thanks to
                   1043:    Michael Spertus of Geodesic Systems for suggesting this.  It was
                   1044:    actually an easy addition.  Kumar Srikantan previously added a similar
                   1045:    facility to a now ancient version of the collector.  At the time
                   1046:    this was much harder, and the result was less convincing.)
                   1047:  - Added some support for the Borland development environment.  (Thanks
                   1048:    to John Ellis and Michael Spertus.)
                   1049:  - Removed a misfeature from checksums.c that caused unexpected
                   1050:    heap growth.  (Thanks to Scott Schwartz.)
                   1051:  - Changed finalize.c to call WARN if it encounters a finalization cycle.
                   1052:    WARN is defined in gc_priv.h to write a message, usually to stdout.
                   1053:    In many environments, this may be inappropriate.
                   1054:  - Renamed NO_PARAMS in gc.h to GC_NO_PARAMS, thus adhering to my own
                   1055:    naming convention.
                   1056:  - Added GC_set_warn_proc to intercept warnings.
                   1057:  - Fixed Amiga port. (Thanks to Michel Schinz (schinz@alphanet.ch).)
                   1058:  - Fixed a bug in mark.c that could result in an access to unmapped
                   1059:    memory from GC_mark_from_mark_stack on machines with unaligned
                   1060:    pointers.
                   1061:  - Fixed a win32 specific performance bug that could result in scanning of
                   1062:    objects allocated with the system malloc.
                   1063:  - Added REDIRECT_MALLOC.
                   1064:
                   1065: Since version 4.4:
                   1066:  - Fixed many minor and one major README bugs. (Thanks to Franklin Chen
                   1067:    (chen@adi.com) for pointing out many of them.)
                   1068:  - Fixed ALPHA/OSF/1 dynamic library support. (Thanks to Jonathan Bachrach
                   1069:    (jonathan@harlequin.com)).
                   1070:  - Added incremental GC support (MPROTECT_VDB) for Linux (with some
                   1071:    help from Bruno Haible).
                   1072:  - Altered SPARC recognition tests in gc.h and config.h (mostly as
                   1073:    suggested by Fergus Henderson).
                   1074:  - Added basic incremental GC support for win32, as implemented by
                   1075:    Windows NT and Windows 95.  GC_enable_incremental is a noop
                   1076:    under win32s, which doesn't implement enough of the VM interface.
                   1077:  - Added -DLARGE_CONFIG.
                   1078:  - Fixed GC_..._ignore_off_page to also function without
                   1079:    -DALL_INTERIOR_POINTERS.
                   1080:  - (Hopefully) fixed RS/6000 port.  (Only the test was broken.)
                   1081:  - Fixed a performance bug in the nonincremental collector running
                   1082:    on machines supporting incremental collection with MPROTECT_VDB
                   1083:    (e.g. SunOS 4, DEC AXP).  This turned into a correctness bug under
                   1084:    win32s with win32 incremental collection.  (Not all memory protection
                   1085:    was disabled.)
                   1086:  - Fixed some ppcr related bit rot.
                   1087:  - Caused dynamic libraries to be unregistered before reregistering.
                   1088:    The old way turned out to be a performance bug on some machines.
                   1089:  - GC_root_size was not properly maintained under MSWIN32.
                   1090:  - Added -DNO_DEBUGGING and GC_dump.
                   1091:  - Fixed a couple of bugs arising with SOLARIS_THREADS +
                   1092:    REDIRECT_MALLOC.
                   1093:  - Added NetBSD/M68K port.  (Thanks to Peter Seebach
                   1094:    <seebs@taniemarie.solon.com>.)
                   1095:  - Fixed a serious realloc bug.  For certain object sizes, the collector
                   1096:    wouldn't scan the expanded part of the object.  (Thanks to Clay Spence
                   1097:    (cds@peanut.sarnoff.com) for noticing the problem, and helping me to
                   1098:    track it down.)
                   1099:
                   1100: Since version 4.5:
                   1101:  - Added Linux ELF support.  (Thanks to Arrigo Triulzi <arrigo@ic.ac.uk>.)
                   1102:  - GC_base crashed if it was called before any other GC_ routines.
                   1103:    This could happen if a gc_cleanup object was allocated outside the heap
                   1104:    before any heap allocation.
                   1105:  - The heap expansion heuristic was not stable if all objects had finalization
                   1106:    enabled.  Fixed finalize.c to count memory in finalization queue and
                   1107:    avoid explicit deallocation.  Changed alloc.c to also consider this count.
                   1108:    (This is still not recommended.  It's expensive if nothing else.)  Thanks
                   1109:    to John Ellis for pointing this out.
                   1110:  - GC_malloc_uncollectable(0) was broken.  Thanks to Phong Vo for pointing
                   1111:    this out.
                   1112:  - The collector didn't compile under Linux 1.3.X.  (Thanks to Fred Gilham for
                   1113:    pointing this out.)  The current workaround is ugly, but expected to be
                   1114:    temporary.
                   1115:  - Fixed a formatting problem for SPARC stack traces.
                   1116:  - Fixed some '=='s in os_dep.c that should have been assignments.
                   1117:    Fortunately these were in code that should never be executed anyway.
                   1118:    (Thanks to Fergus Henderson.)
                   1119:  - Fixed the heap block allocator to only drop blacklisted blocks in small
                   1120:    chunks.  Made BL_LIMIT self adjusting.  (Both of these were in response
                   1121:    to heap growth observed by Paul Graham.)
                   1122:  - Fixed the Metrowerks/68K Mac code to also mark from a6.  (Thanks
                   1123:    to Patrick Beard.)
                   1124:  - Significantly updated README.debugging.
                   1125:  - Fixed some problems with longjmps out of signal handlers, especially under
                   1126:    Solaris.  Added a workaround for the fact that siglongjmp doesn't appear to
                   1127:    do the right thing with -lthread under Solaris.
                   1128:  - Added MSDOS/djgpp port.  (Thanks to Mitch Harris  (maharri@uiuc.edu).)
                   1129:  - Added "make reserved_namespace" and "make user_namespace".  The
                   1130:    first renames ALL "GC_xxx" identifiers as "_GC_xxx".  The second is the
                   1131:    inverse transformation.  Note that doing this is guaranteed to break all
                   1132:    clients written for the other names.
                   1133:  - descriptor field for kind NORMAL in GC_obj_kinds with ADD_BYTE_AT_END
                   1134:    defined should be -ALIGNMENT not WORDS_TO_BYTES(-1).  This is
                   1135:    a serious bug on machines with pointer alignment of less than a word.
                   1136:  - GC_ignore_self_finalize_mark_proc didn't handle pointers to very near the
                   1137:    end of the object correctly.  Caused failures of the C++ test on a DEC Alpha
                   1138:    with g++.
                   1139:  - gc_inl.h still had problems.  Partially fixed.  Added warnings at the
                   1140:    beginning to hopefully specify the remaining dangers.
                   1141:  - Added DATAEND definition to config.h.
                   1142:  - Fixed some of the .h file organization.  Fixed "make floppy".
                   1143:
                   1144: Since version 4.6:
                   1145:  - Fixed some compilation problems with -DCHECKSUMS (thanks to Ian Searle)
                   1146:  - Updated some Mac specific files to synchronize with Patrick Beard.
                   1147:  - Fixed a serious bug for machines with non-word-aligned pointers.
                   1148:    (Thanks to Patrick Beard for pointing out the problem.  The collector
                   1149:    should fail almost any conceivable test immediately on such machines.)
                   1150:
                   1151: Since version 4.7:
                   1152:  - Changed a "comment" in a MacOS specific part of mach-dep.c that caused
                   1153:    gcc to fail on other platforms.
                   1154:
                   1155: Since version 4.8
                   1156:  - More README.debugging fixes.
                   1157:  - Objects ready for finalization, but not finalized in the same GC
                   1158:    cycle, could be prematurely collected.  This occasionally happened
                   1159:    in test_cpp.
                   1160:  - Too little memory was obtained from the system for very large
                   1161:    objects.  That could cause a heap explosion if these objects were
                   1162:    not contiguous (e.g. under PCR), and too much of them was blacklisted.
                   1163:  - Due to an improper initialization, the collector was too hesitant to
                   1164:    allocate blacklisted objects immediately after system startup.
                   1165:  - Moved GC_arrays from the data into the bss segment by not explicitly
                   1166:    initializing it to zero.  This significantly
                   1167:    reduces the size of executables, and probably avoids some disk accesses
                   1168:    on program startup.  It's conceivable that it might break a port that I
                   1169:    didn't test.
                   1170:  - Fixed EMX_MAKEFILE to reflect the gc_c++.h to gc_cpp.h renaming which
                   1171:    occurred a while ago.
                   1172:
                   1173: Since 4.9:
                   1174:  - Fixed a typo around a call to GC_collect_or_expand in alloc.c.  It broke
                   1175:    handling of out of memory.  (Thanks to Patrick Beard for noticing.)
                   1176:
                   1177: Since 4.10:
                   1178:  - Rationalized (hopefully) GC_try_to_collect in an incremental collection
                   1179:    environment.  It appeared to not handle a call while a collection was in
                   1180:    progress, and was otherwise too conservative.
                   1181:  - Merged GC_reclaim_or_delete_all into GC_reclaim_all to get rid of some
                   1182:    code.
                   1183:  - Added Patrick Beard's Mac fixes, with substantial completely untested
                   1184:    modifications.
                   1185:  - Fixed the MPROTECT_VDB code to deal with large pages and imprecise
                   1186:    fault addresses (as on an UltraSPARC running Solaris 2.5).  Note that this
                   1187:    was not a problem in the default configuration, which uses PROC_VDB.
                   1188:  - The DEC Alpha assembly code needed to restore $gp between calls.
                   1189:    Thanks to Fergus Henderson for tracking this down and supplying a
                   1190:    patch.
                   1191:  - The write command for "de" was completely broken for large files.
                   1192:    I used the easiest portable fix, which involved changing the semantics
                   1193:    so that f.new is written instead of overwriting f.  That's safer anyway.
                   1194:  - Added README.solaris2 with a discussion of the possible problems of
                   1195:    mixing the collector's sbrk allocation with malloc/realloc.
                   1196:  - Changed the data segment starting address for SGI machines.  The
                   1197:    old code failed under IRIX6.
                   1198:  - Required double word alignment for MIPS.
                   1199:  - Various minor fixes to remove warnings.
                   1200:  - Attempted to fix some Solaris threads problems reported by Zhiying Chen.
                   1201:    In particular, the collector could try to fork a thread with the
                   1202:    world stopped as part of GC_thr_init.  It also failed to deal with
                   1203:    the case in which the original thread terminated before the whole
                   1204:    process did.
                   1205:  - Added -DNO_EXECUTE_PERMISSION.  This has a major performance impact
                   1206:    on the incremental collector under Irix, and perhaps under other
                   1207:    operating systems.
                   1208:  - Added some code to support allocating the heap with mmap.  This may
                   1209:    be preferable under some circumstances.
                   1210:  - Integrated dynamic library support for HP.
                   1211:    (Thanks to Knut Tvedten <knuttv@ifi.uio.no>.)
                   1212:  - Integrated James Clark's win32 threads support, and made a number
                   1213:    of changes to it, many of which were suggested by Pontus Rydin.
                   1214:    This is still not 100% solid.
                   1215:  - Integrated Alistair Crooks' support for UTS4 running on an Amdahl
                   1216:    370-class machine.
                   1217:  - Fixed a serious bug in explicitly typed allocation.  Objects requiring
                   1218:    large descriptors where handled in a way that usually resulted in
                   1219:    a segmentation fault in the marker.  (Thanks to Jeremy Fitzhardinge
                   1220:    for helping to track this down.)
                   1221:  - Added partial support for GNU win32 development.  (Thanks to Fergus
                   1222:    Henderson.)
                   1223:  - Added optional support for Java-style finalization semantics.  (Thanks
                   1224:    to Patrick Bridges.)  This is recommended only for Java implementations.
                   1225:  - GC_malloc_uncollectable faulted instead of returning 0 when out of
                   1226:    memory.  (Thanks to dan@math.uiuc.edu for noticing.)
                   1227:  - Calls to GC_base before the collector was initialized failed on a
                   1228:    DEC Alpha.  (Thanks to Matthew Flatt.)
                   1229:  - Added base pointer checking to GC_REGISTER_FINALIZER in debugging
                   1230:    mode, at the suggestion of Jeremy Fitzhardinge.
                   1231:  - GC_debug_realloc failed for uncollectable objects.  (Thanks to
                   1232:    Jeremy Fitzhardinge.)
                   1233:  - Explicitly typed allocation could crash if it ran out of memory.
                   1234:    (Thanks to Jeremy Fitzhardinge.)
                   1235:  - Added minimal support for a DEC Alpha running Linux.
                   1236:  - Fixed a problem with allocation of objects whose size overflowed
                   1237:    ptrdiff_t.  (This now fails unconditionally, as it should.)
                   1238:  - Added the beginning of Irix pthread support.
                   1239:  - Integrated Xiaokun Zhu's fixes for djgpp 2.01.
                   1240:  - Added SGI-style STL allocator support (gc_alloc.h).
                   1241:  - Fixed a serious bug in README.solaris2.  Multithreaded programs must include
                   1242:    gc.h with SOLARIS_THREADS defined.
                   1243:  - Changed GC_free so it actually deallocates uncollectable objects.
                   1244:    (Thanks to Peter Chubb for pointing out the problem.)
                   1245:  - Added Linux ELF support for dynamic libararies.  (Thanks again to
                   1246:    Patrick Bridges.)
                   1247:  - Changed the Borland cc configuration so that the assembler is not
                   1248:    required.
                   1249:  - Fixed a bug in the C++ test that caused it to fail in 64-bit
                   1250:    environments.
                   1251:
                   1252: Since 4.11:
                   1253:  - Fixed ElfW definition in dyn_load.c. (Thanks to Fergus Henderson.)
                   1254:    This prevented the dynamic library support from compiling on some
                   1255:    older ELF Linux systems.
                   1256:  - Fixed UTS4 port (which I apparently mangled during the integration)
                   1257:    (Thanks to again to Alistair Crooks.)
                   1258:  - "Make C++" failed on Suns with SC4.0, due to a problem with "bool".
                   1259:    Fixed in gc_priv.h.
                   1260:  - Added more pieces for GNU win32.  (Thanks to Timothy N. Newsham.)
                   1261:    The current state of things should suffice for at least some
                   1262:    applications.
                   1263:  - Changed the out of memory retry count handling as suggested by
                   1264:    Kenjiro Taura.  (This matters only if GC_max_retries > 0, which
                   1265:    is no longer the default.)
                   1266:  - If a /proc read failed repeatedly, GC_written_pages was not updated
                   1267:    correctly.  (Thanks to Peter Chubb for diagnosing this.)
                   1268:  - Under unlikely circumstances, the allocator could infinite loop in
                   1269:    an out of memory situation.  (Thanks again to Kenjiro Taura for
                   1270:    identifying the problem and supplying a fix.)
                   1271:  - Fixed a syntactic error in the DJGPP code.  (Thanks to Fergus
                   1272:    Henderson for finding this by inspection.)  Also fixed a test program
                   1273:    problem with DJGPP (Thanks to Peter Monks.)
                   1274:  - Atomic uncollectable objects were not treated correctly by the
                   1275:    incremental collector.  This resulted in weird log statistics and
                   1276:    occasional performance problems.  (Thanks to Peter Chubb for pointing
                   1277:    this out.)
                   1278:  - Fixed some problems resulting from compilers that dont define
                   1279:    __STDC__.  In this case void * and char * were used inconsistently
                   1280:    in some cases.  (Void * should not have been used at all.  If
                   1281:    you have an ANSI superset compiler that does not define __STDC__,
                   1282:    please compile with -D__STDC__=0. Thanks to Manuel Serrano and others
                   1283:    for pointing out the problem.)
                   1284:  - Fixed a compilation problem on Irix with -n32 and -DIRIX_THREADS.
                   1285:    Also fixed some other IRIX_THREADS problems which may or may not have
                   1286:    had observable symptoms.
                   1287:  - Fixed an HP PA compilation problem in dyn_load.c.  (Thanks to
                   1288:    Philippe Queinnec.)
                   1289:  - SEGV fault handlers sometimes did not get reset correctly.  (Thanks
                   1290:    to David Pickens.)
                   1291:  - Added a fix for SOLARIS_THREADS on Intel.  (Thanks again to David
                   1292:    Pickens.)  This probably needs more work to become functional.
                   1293:  - Fixed struct sigcontext_struct in os_dep.c for compilation under
                   1294:    Linux 2.1.X.        (Thanks to Fergus Henderson.)
                   1295:  - Changed the DJGPP STACKBOTTOM and DATASTART values to those suggested
                   1296:    by Kristian Kristensen.  These may still not be right, but it is
                   1297:    it is likely to work more often than what was there before.  They may
                   1298:    even be exactly right.
                   1299:  - Added a #include <string.h> to test_cpp.cc.  This appears to help
                   1300:    with HP/UX and gcc.  (Thanks to assar@sics.se.)
                   1301:  - Version 4.11 failed to run in incremental mode on recent 64-bit Irix
                   1302:    kernels.  This was a problem related to page unaligned heap segments.
                   1303:    Changed the code to page align heap sections on all platforms.
                   1304:    (I had mistakenly identified this as a kernel problem earlier.
                   1305:    It was not.)
                   1306:  - Version 4.11 did not make allocated storage executable, except on
                   1307:    one or two platforms, due to a bug in a #if test.  (Thanks to Dave
                   1308:    Grove for pointing this out.)
                   1309:  - Added sparc_sunos4_mach_dep.s to support Sun's compilers under SunOS4.
                   1310:  - Added GC_exclude_static_roots.
                   1311:  - Fixed the object size mapping algorithm.  This shouldn't matter,
                   1312:    but the old code was ugly.
                   1313:  - Heap checking code could die if one of the allocated objects was
                   1314:    larger than its base address.  (Unsigned underflow problem.  Thanks
                   1315:    to Clay Spence for isolating the problem.)
                   1316:  - Added RS6000 (AIX) dynamic library support and fixed STACK_BOTTOM.
                   1317:    (Thanks to Fred Stearns.)
                   1318:  - Added Fergus Henderson's patches for improved robustness with large
                   1319:    heaps and lots of blacklisting.
                   1320:  - Added Peter Chubb's changes to support Solaris Pthreads, to support
                   1321:    MMAP allocation in Solaris, to allow Solaris to find dynamic libraries
                   1322:    through /proc, to add malloc_typed_ignore_off_page, and a few other
                   1323:    minor features and bug fixes.
                   1324:  - The Solaris 2 port should not use sbrk.  I received confirmation from
                   1325:    Sun that the use of sbrk and malloc in the same program is not
                   1326:    supported.  The collector now defines USE_MMAP by default on Solaris.
                   1327:  - Replaced the djgpp makefile with Gary Leavens' version.
                   1328:  - Fixed MSWIN32 detection test.
                   1329:  - Added Fergus Henderson's patches to allow putting the collector into
                   1330:    a DLL under GNU win32.
                   1331:  - Added Ivan V. Demakov's port to Watcom C on X86.
                   1332:  - Added Ian Piumarta's Linux/PowerPC port.
                   1333:  - On Brian Burton's suggestion added PointerFreeGC to the placement
                   1334:    options in gc_cpp.h.  This is of course unsafe, and may be controversial.
                   1335:    On the other hand, it seems to be needed often enough that it's worth
                   1336:    adding as a standard facility.
                   1337:
                   1338: Since 4.12:
                   1339:  - Fixed a crucial bug in the Watcom port.  There was a redundant decl
                   1340:    of GC_push_one in gc_priv.h.
                   1341:  - Added FINALIZE_ON_DEMAND.
                   1342:  - Fixed some pre-ANSI cc problems in test.c.
                   1343:  - Removed getpagesize() use for Solaris.  It seems to be missing in one
                   1344:    or two versions.
                   1345:  - Fixed bool handling for SPARCCompiler version 4.2.
                   1346:  - Fixed some files in include that had gotten unlinked from the main
                   1347:    copy.
                   1348:  - Some RS/6000 fixes (missing casts).  Thanks to Toralf Foerster.
                   1349:  - Fixed several problems in GC_debug_realloc, affecting mostly the
                   1350:    FIND_LEAK case.
                   1351:  - GC_exclude_static_roots contained a buggy unsigned comparison to
                   1352:    terminate a loop.  (Thanks to Wilson Ho.)
                   1353:  - CORD_str failed if the substring occurred at the last possible position.
                   1354:    (Only affects cord users.)
                   1355:  - Fixed Linux code to deal with RedHat 5.0 and integrated Peter Bigot's
                   1356:    os_dep.c code for dealing with various Linux versions.
                   1357:  - Added workaround for Irix pthreads sigaction bug and possible signal
                   1358:    misdirection problems.
                   1359: Since alpha1:
                   1360:  - Changed RS6000 STACKBOTTOM.
                   1361:  - Integrated Patrick Beard's Mac changes.
                   1362:  - Alpha1 didn't compile on Irix m.n, m < 6.
                   1363:  - Replaced Makefile.dj with a new one from Gary Leavens.
                   1364:  - Added Andrew Stitcher's changes to support SCO OpenServer.
                   1365:  - Added PRINT_BLACK_LIST, to allow debugging of high densities of false
                   1366:    pointers.
                   1367:  - Added code to debug allocator to keep track of return address
                   1368:    in GC_malloc caller, thus giving a bit more context.
                   1369:  - Changed default behavior of large block allocator to more
                   1370:    aggressively avoid fragmentation.  This is likely to slow down the
                   1371:    collector when it succeeds at reducing space cost.
                   1372:  - Integrated Fergus Henderson's CYGWIN32 changes.  They are untested,
                   1373:    but needed for newer versions.
                   1374:  - USE_MMAP had some serious bugs.  This caused the collector to fail
                   1375:    consistently on Solaris with -DSMALL_CONFIG.
                   1376:  - Added Linux threads support, thanks largely to Fergus Henderson.
                   1377: Since alpha2:
                   1378:  - Fixed more Linux threads problems.
                   1379:  - Changed default GC_free_space_divisor to 3 with new large block allocation.
                   1380:    (Thanks to Matthew Flatt for some measurements that suggest the old
                   1381:    value sometimes favors space too much over time.)
                   1382:  - More CYGWIN32 fixes.
                   1383:  - Integrated Tyson-Dowd's Linux-M68K port.
                   1384:  - Minor HP PA and DEC UNIX fixes from Fergus Henderson.
                   1385:  - Integrated Christoffe Raffali's Linux-SPARC changes.
                   1386:  - Allowed for one more GC fixup iteration after a full GC in incremental
                   1387:    mode.  Some quick measurements suggested that this significantly
                   1388:    reduces pause times even with smaller GC_RATE values.
                   1389:  - Moved some more GC data structures into GC_arrays.  This decreases
                   1390:    pause times and GC overhead, but makes debugging slightly less convenient.
                   1391:  - Fixed namespace pollution problem ("excl_table").
                   1392:  - Made GC_incremental a constant for -DSMALL_CONFIG, hopefully shrinking
                   1393:    that slightly.
                   1394:  - Added some win32 threads fixes.
                   1395:  - Integrated Ivan Demakov and David Stes' Watcom fixes.
                   1396:  - Various other minor fixes contributed by many people.
                   1397:  - Renamed config.h to gcconfig.h, since config.h tends to be used for
                   1398:    many other things.
                   1399:  - Integrated Matthew Flatt's support for 68K MacOS "far globals".
                   1400:  - Fixed up some of the dynamic library Makefile targets for consistency
                   1401:    across platforms.
                   1402:  - Fixed a USE_MMAP typo that caused out-of-memory handling to fail
                   1403:    on Solaris.
                   1404:  - Added code to test.c to test thread creation a bit more.
                   1405:  - Integrated GC_win32_free_heap, as suggested by Ivan Demakov.
                   1406:  - Fixed Solaris 2.7 stack base finding problem.  (This may actually
                   1407:    have been done in an earlier alpha release.)
                   1408: Since alpha3:
                   1409:  - Fixed MSWIN32 recognition test, which interfered with cygwin.
                   1410:  - Removed unnecessary gc_watcom.asm from distribution.  Removed
                   1411:    some obsolete README.win32 text.
                   1412:  - Added Alpha Linux incremental GC support.  (Thanks to Philipp Tomsich
                   1413:    for code for retrieving the fault address in a signal handler.)
                   1414:    Changed Linux signal handler context argument to be a pointer.
                   1415:  - Took care of some new warnings generated by the 7.3 SGI compiler.
                   1416:  - Integrated Phillip Musumeci's FreeBSD/ELF fixes.
                   1417:  - -DIRIX_THREADS was broken with the -o32 ABI (typo in gc_priv.h>
                   1418:
                   1419: Since 4.13:
                   1420:  - Fixed GC_print_source_ptr to not use a prototype.
                   1421:  - generalized CYGWIN test.
                   1422:  - gc::new did the wrong thing with PointerFreeGC placement.
                   1423:    (Thanks to Rauli Ruohonen.)
                   1424:  - In the ALL_INTERIOR_POINTERS (default) case, some callee-save register
                   1425:    values could fail to be scanned if the register was saved and
                   1426:    reused in a GC frame.  This showed up in verbose mode with gctest
                   1427:    compiled with an unreleased SGI compiler.  I vaguely recall an old
                   1428:    bug report that may have been related.  The bug was probably quite old.
                   1429:    (The problem was that the stack scanning could be deferred until
                   1430:    after the relevant frame was overwritten, and the new save location
                   1431:    might be outside the scanned area.  Fixed by more eager stack scanning.)
                   1432:  - PRINT_BLACK_LIST had some problems.  A few source addresses were garbage.
                   1433:  - Replaced Makefile.dj and added -I flags to cord make targets.
                   1434:    (Thanks to Gary Leavens.)
                   1435:  - GC_try_to_collect was broken with the nonincremental collector.
                   1436:  - gc_cleanup destructors could pass the wrong address to
                   1437:    GC_register_finalizer_ignore_self in the presence of multiple
                   1438:    inheritance.  (Thanks to Darrell Schiebel.)
                   1439:  - Changed PowerPC Linux stack finding code.
                   1440:
                   1441: Since 4.14alpha1
                   1442:  - -DSMALL_CONFIG did not work reliably with large (> 4K) pages.
                   1443:    Recycling the mark stack during expansion could result in a size
                   1444:    zero heap segment, which confused things.  (This was probably also an
                   1445:    issue with the normal config and huge pages.)
                   1446:  - Did more work to make sure that callee-save registers were scanned
                   1447:    completely, even with the setjmp-based code.  Added USE_GENERIC_PUSH_REGS
                   1448:    macro to facilitate testing on machines I have access to.
                   1449:  - Added code to explicitly push register contents for win32 threads.
                   1450:    This seems to be necessary.  (Thanks to Pierre de Rop.)
                   1451:
                   1452: Since 4.14alpha2
                   1453:  - changed STACKBOTTOM for DJGPP (Thanks to Salvador Eduardo Tropea).
                   1454:
                   1455: To do:
                   1456:  - Very large root set sizes (> 16 MB or so) could cause the collector
                   1457:    to abort with an unexpected mark stack overflow.  (Thanks again to
                   1458:    Peter Chubb.)  NOT YET FIXED.  Workaround is to increase the initial
                   1459:    size.
                   1460:  - The SGI version of the collector marks from mmapped pages, even
                   1461:    if they are not part of dynamic library static data areas.  This
                   1462:    causes performance problems with some SGI libraries that use mmap
                   1463:    as a bitmap allocator.  NOT YET FIXED.  It may be possible to turn
                   1464:    off DYNAMIC_LOADING in the collector as a workaround.  It may also
                   1465:    be possible to conditionally intercept mmap and use GC_exclude_static_roots.
                   1466:    The real fix is to walk rld data structures, which looks possible.
                   1467:  - Integrate MIT and DEC pthreads ports.
                   1468:  - Deal with very uneven black-listing distributions.  If all the black listed
                   1469:    blocks reside in the newly allocated heap section, the heuristic for
                   1470:    temporarily ignoring black-listing fails, and the heap grows too much.
                   1471:    (This was observed in only one case, and could be worked around, but ...)
                   1472:  - I've started work on rewriting the large block allocator to use approximate
                   1473:    best fit.  There are rare cases in which the current allocator results in
                   1474:    excessive large block fragmentation, even with the 4.13 fixes.  This should
                   1475:    also reduce large block allocation time, whcih has become occasionally
                   1476:    noticable in 4.13.
                   1477:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>