diff -Nrc3pad gcc-3.0.4/boehm-gc/AmigaOS.c gcc-3.1/boehm-gc/AmigaOS.c *** gcc-3.0.4/boehm-gc/AmigaOS.c Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/AmigaOS.c Fri Aug 17 18:30:44 2001 *************** *** 0 **** --- 1,623 ---- + + + /****************************************************************** + + AmigaOS-spesific routines for GC. + This file is normally included from os_dep.c + + ******************************************************************/ + + + #if !defined(GC_AMIGA_DEF) && !defined(GC_AMIGA_SB) && !defined(GC_AMIGA_DS) && !defined(GC_AMIGA_AM) + # include "gc_priv.h" + # include + # include + # define GC_AMIGA_DEF + # define GC_AMIGA_SB + # define GC_AMIGA_DS + # define GC_AMIGA_AM + #endif + + + #ifdef GC_AMIGA_DEF + + # ifndef __GNUC__ + # include + # endif + # include + # include + # include + # include + + #endif + + + + + #ifdef GC_AMIGA_SB + + /****************************************************************** + Find the base of the stack. + ******************************************************************/ + + ptr_t GC_get_stack_base() + { + struct Process *proc = (struct Process*)SysBase->ThisTask; + + /* Reference: Amiga Guru Book Pages: 42,567,574 */ + if (proc->pr_Task.tc_Node.ln_Type==NT_PROCESS + && proc->pr_CLI != NULL) { + /* first ULONG is StackSize */ + /*longPtr = proc->pr_ReturnAddr; + size = longPtr[0];*/ + + return (char *)proc->pr_ReturnAddr + sizeof(ULONG); + } else { + return (char *)proc->pr_Task.tc_SPUpper; + } + } + + #if 0 /* old version */ + ptr_t GC_get_stack_base() + { + extern struct WBStartup *_WBenchMsg; + extern long __base; + extern long __stack; + struct Task *task; + struct Process *proc; + struct CommandLineInterface *cli; + long size; + + if ((task = FindTask(0)) == 0) { + GC_err_puts("Cannot find own task structure\n"); + ABORT("task missing"); + } + proc = (struct Process *)task; + cli = BADDR(proc->pr_CLI); + + if (_WBenchMsg != 0 || cli == 0) { + size = (char *)task->tc_SPUpper - (char *)task->tc_SPLower; + } else { + size = cli->cli_DefaultStack * 4; + } + return (ptr_t)(__base + GC_max(size, __stack)); + } + #endif + + + #endif + + + #ifdef GC_AMIGA_DS + /****************************************************************** + Register data segments. + ******************************************************************/ + + void GC_register_data_segments() + { + struct Process *proc; + struct CommandLineInterface *cli; + BPTR myseglist; + ULONG *data; + + int num; + + + # ifdef __GNUC__ + ULONG dataSegSize; + GC_bool found_segment = FALSE; + extern char __data_size[]; + + dataSegSize=__data_size+8; + /* Can`t find the Location of __data_size, because + it`s possible that is it, inside the segment. */ + + # endif + + proc= (struct Process*)SysBase->ThisTask; + + /* Reference: Amiga Guru Book Pages: 538ff,565,573 + and XOper.asm */ + if (proc->pr_Task.tc_Node.ln_Type==NT_PROCESS) { + if (proc->pr_CLI == NULL) { + myseglist = proc->pr_SegList; + } else { + /* ProcLoaded 'Loaded as a command: '*/ + cli = BADDR(proc->pr_CLI); + myseglist = cli->cli_Module; + } + } else { + ABORT("Not a Process."); + } + + if (myseglist == NULL) { + ABORT("Arrrgh.. can't find segments, aborting"); + } + + /* xoper hunks Shell Process */ + + num=0; + for (data = (ULONG *)BADDR(myseglist); data != NULL; + data = (ULONG *)BADDR(data[0])) { + if (((ULONG) GC_register_data_segments < (ULONG) &data[1]) || + ((ULONG) GC_register_data_segments > (ULONG) &data[1] + data[-1])) { + # ifdef __GNUC__ + if (dataSegSize == data[-1]) { + found_segment = TRUE; + } + # endif + GC_add_roots_inner((char *)&data[1], + ((char *)&data[1]) + data[-1], FALSE); + } + ++num; + } /* for */ + # ifdef __GNUC__ + if (!found_segment) { + ABORT("Can`t find correct Segments.\nSolution: Use an newer version of ixemul.library"); + } + # endif + } + + #if 0 /* old version */ + void GC_register_data_segments() + { + extern struct WBStartup *_WBenchMsg; + struct Process *proc; + struct CommandLineInterface *cli; + BPTR myseglist; + ULONG *data; + + if ( _WBenchMsg != 0 ) { + if ((myseglist = _WBenchMsg->sm_Segment) == 0) { + GC_err_puts("No seglist from workbench\n"); + return; + } + } else { + if ((proc = (struct Process *)FindTask(0)) == 0) { + GC_err_puts("Cannot find process structure\n"); + return; + } + if ((cli = BADDR(proc->pr_CLI)) == 0) { + GC_err_puts("No CLI\n"); + return; + } + if ((myseglist = cli->cli_Module) == 0) { + GC_err_puts("No seglist from CLI\n"); + return; + } + } + + for (data = (ULONG *)BADDR(myseglist); data != 0; + data = (ULONG *)BADDR(data[0])) { + # ifdef AMIGA_SKIP_SEG + if (((ULONG) GC_register_data_segments < (ULONG) &data[1]) || + ((ULONG) GC_register_data_segments > (ULONG) &data[1] + data[-1])) { + # else + { + # endif /* AMIGA_SKIP_SEG */ + GC_add_roots_inner((char *)&data[1], + ((char *)&data[1]) + data[-1], FALSE); + } + } + } + #endif /* old version */ + + + #endif + + + + #ifdef GC_AMIGA_AM + + #ifndef GC_AMIGA_FASTALLOC + + void *GC_amiga_allocwrapper(size_t size,void *(*AllocFunction)(size_t size2)){ + return (*AllocFunction)(size); + } + + void *(*GC_amiga_allocwrapper_do)(size_t size,void *(*AllocFunction)(size_t size2)) + =GC_amiga_allocwrapper; + + #else + + + + + void *GC_amiga_allocwrapper_firsttime(size_t size,void *(*AllocFunction)(size_t size2)); + + void *(*GC_amiga_allocwrapper_do)(size_t size,void *(*AllocFunction)(size_t size2)) + =GC_amiga_allocwrapper_firsttime; + + + /****************************************************************** + Amiga-spesific routines to obtain memory, and force GC to give + back fast-mem whenever possible. + These hacks makes gc-programs go many times faster when + the amiga is low on memory, and are therefore strictly necesarry. + + -Kjetil S. Matheussen, 2000. + ******************************************************************/ + + + + /* List-header for all allocated memory. */ + + struct GC_Amiga_AllocedMemoryHeader{ + ULONG size; + struct GC_Amiga_AllocedMemoryHeader *next; + }; + struct GC_Amiga_AllocedMemoryHeader *GC_AMIGAMEM=(struct GC_Amiga_AllocedMemoryHeader *)(int)~(NULL); + + + + /* Type of memory. Once in the execution of a program, this might change to MEMF_ANY|MEMF_CLEAR */ + + ULONG GC_AMIGA_MEMF = MEMF_FAST | MEMF_CLEAR; + + + /* Prevents GC_amiga_get_mem from allocating memory if this one is TRUE. */ + #ifndef GC_AMIGA_ONLYFAST + BOOL GC_amiga_dontalloc=FALSE; + #endif + + #ifdef GC_AMIGA_PRINTSTATS + int succ=0,succ2=0; + int nsucc=0,nsucc2=0; + int nullretries=0; + int numcollects=0; + int chipa=0; + int allochip=0; + int allocfast=0; + int cur0=0; + int cur1=0; + int cur10=0; + int cur50=0; + int cur150=0; + int cur151=0; + int ncur0=0; + int ncur1=0; + int ncur10=0; + int ncur50=0; + int ncur150=0; + int ncur151=0; + #endif + + /* Free everything at program-end. */ + + void GC_amiga_free_all_mem(void){ + struct GC_Amiga_AllocedMemoryHeader *gc_am=(struct GC_Amiga_AllocedMemoryHeader *)(~(int)(GC_AMIGAMEM)); + struct GC_Amiga_AllocedMemoryHeader *temp; + + #ifdef GC_AMIGA_PRINTSTATS + printf("\n\n" + "%d bytes of chip-mem, and %d bytes of fast-mem where allocated from the OS.\n", + allochip,allocfast + ); + printf( + "%d bytes of chip-mem were returned from the GC_AMIGA_FASTALLOC supported allocating functions.\n", + chipa + ); + printf("\n"); + printf("GC_gcollect was called %d times to avoid returning NULL or start allocating with the MEMF_ANY flag.\n",numcollects); + printf("%d of them was a success. (the others had to use allocation from the OS.)\n",nullretries); + printf("\n"); + printf("Succeded forcing %d gc-allocations (%d bytes) of chip-mem to be fast-mem.\n",succ,succ2); + printf("Failed forcing %d gc-allocations (%d bytes) of chip-mem to be fast-mem.\n",nsucc,nsucc2); + printf("\n"); + printf( + "Number of retries before succeding a chip->fast force:\n" + "0: %d, 1: %d, 2-9: %d, 10-49: %d, 50-149: %d, >150: %d\n", + cur0,cur1,cur10,cur50,cur150,cur151 + ); + printf( + "Number of retries before giving up a chip->fast force:\n" + "0: %d, 1: %d, 2-9: %d, 10-49: %d, 50-149: %d, >150: %d\n", + ncur0,ncur1,ncur10,ncur50,ncur150,ncur151 + ); + #endif + + while(gc_am!=NULL){ + temp=gc_am->next; + FreeMem(gc_am,gc_am->size); + gc_am=(struct GC_Amiga_AllocedMemoryHeader *)(~(int)(temp)); + } + } + + #ifndef GC_AMIGA_ONLYFAST + + /* All memory with address lower than this one is chip-mem. */ + + char *chipmax; + + + /* + * Allways set to the last size of memory tried to be allocated. + * Needed to ensure allocation when the size is bigger than 100000. + * + */ + size_t latestsize; + + #endif + + + /* + * The actual function that is called with the GET_MEM macro. + * + */ + + void *GC_amiga_get_mem(size_t size){ + struct GC_Amiga_AllocedMemoryHeader *gc_am; + + #ifndef GC_AMIGA_ONLYFAST + if(GC_amiga_dontalloc==TRUE){ + // printf("rejected, size: %d, latestsize: %d\n",size,latestsize); + return NULL; + } + + // We really don't want to use chip-mem, but if we must, then as little as possible. + if(GC_AMIGA_MEMF==(MEMF_ANY|MEMF_CLEAR) && size>100000 && latestsize<50000) return NULL; + #endif + + gc_am=AllocMem((ULONG)(size + sizeof(struct GC_Amiga_AllocedMemoryHeader)),GC_AMIGA_MEMF); + if(gc_am==NULL) return NULL; + + gc_am->next=GC_AMIGAMEM; + gc_am->size=size + sizeof(struct GC_Amiga_AllocedMemoryHeader); + GC_AMIGAMEM=(struct GC_Amiga_AllocedMemoryHeader *)(~(int)(gc_am)); + + // printf("Allocated %d (%d) bytes at address: %x. Latest: %d\n",size,tot,gc_am,latestsize); + + #ifdef GC_AMIGA_PRINTSTATS + if((char *)gc_amchipmax || ret==NULL){ + if(ret==NULL){ + nsucc++; + nsucc2+=size; + if(rec==0) ncur0++; + if(rec==1) ncur1++; + if(rec>1 && rec<10) ncur10++; + if(rec>=10 && rec<50) ncur50++; + if(rec>=50 && rec<150) ncur150++; + if(rec>=150) ncur151++; + }else{ + succ++; + succ2+=size; + if(rec==0) cur0++; + if(rec==1) cur1++; + if(rec>1 && rec<10) cur10++; + if(rec>=10 && rec<50) cur50++; + if(rec>=50 && rec<150) cur150++; + if(rec>=150) cur151++; + } + } + #endif + + if (((char *)ret)<=chipmax && ret!=NULL && (rec<(size>500000?9:size/5000))){ + ret=GC_amiga_rec_alloc(size,AllocFunction,rec+1); + // GC_free(ret2); + } + + return ret; + } + #endif + + + /* The allocating-functions defined inside the amiga-blocks in gc.h is called + * via these functions. + */ + + + void *GC_amiga_allocwrapper_any(size_t size,void *(*AllocFunction)(size_t size2)){ + void *ret,*ret2; + + GC_amiga_dontalloc=TRUE; // Pretty tough thing to do, but its indeed necesarry. + latestsize=size; + + ret=(*AllocFunction)(size); + + if(((char *)ret) <= chipmax){ + if(ret==NULL){ + //Give GC access to allocate memory. + #ifdef GC_AMIGA_GC + if(!GC_dont_gc){ + GC_gcollect(); + #ifdef GC_AMIGA_PRINTSTATS + numcollects++; + #endif + ret=(*AllocFunction)(size); + } + #endif + if(ret==NULL){ + GC_amiga_dontalloc=FALSE; + ret=(*AllocFunction)(size); + if(ret==NULL){ + WARN("Out of Memory! Returning NIL!\n", 0); + } + } + #ifdef GC_AMIGA_PRINTSTATS + else{ + nullretries++; + } + if(ret!=NULL && (char *)ret<=chipmax) chipa+=size; + #endif + } + #ifdef GC_AMIGA_RETRY + else{ + /* We got chip-mem. Better try again and again and again etc., we might get fast-mem sooner or later... */ + /* Using gctest to check the effectiviness of doing this, does seldom give a very good result. */ + /* However, real programs doesn't normally rapidly allocate and deallocate. */ + // printf("trying to force... %d bytes... ",size); + if( + AllocFunction!=GC_malloc_uncollectable + #ifdef ATOMIC_UNCOLLECTABLE + && AllocFunction!=GC_malloc_atomic_uncollectable + #endif + ){ + ret2=GC_amiga_rec_alloc(size,AllocFunction,0); + }else{ + ret2=(*AllocFunction)(size); + #ifdef GC_AMIGA_PRINTSTATS + if((char *)ret2chipmax){ + // printf("Succeeded.\n"); + GC_free(ret); + ret=ret2; + }else{ + GC_free(ret2); + // printf("But did not succeed.\n"); + } + } + #endif + } + + GC_amiga_dontalloc=FALSE; + + return ret; + } + + + + void (*GC_amiga_toany)(void)=NULL; + + void GC_amiga_set_toany(void (*func)(void)){ + GC_amiga_toany=func; + } + + #endif // !GC_AMIGA_ONLYFAST + + + void *GC_amiga_allocwrapper_fast(size_t size,void *(*AllocFunction)(size_t size2)){ + void *ret; + + ret=(*AllocFunction)(size); + + if(ret==NULL){ + // Enable chip-mem allocation. + // printf("ret==NULL\n"); + #ifdef GC_AMIGA_GC + if(!GC_dont_gc){ + GC_gcollect(); + #ifdef GC_AMIGA_PRINTSTATS + numcollects++; + #endif + ret=(*AllocFunction)(size); + } + #endif + if(ret==NULL){ + #ifndef GC_AMIGA_ONLYFAST + GC_AMIGA_MEMF=MEMF_ANY | MEMF_CLEAR; + if(GC_amiga_toany!=NULL) (*GC_amiga_toany)(); + GC_amiga_allocwrapper_do=GC_amiga_allocwrapper_any; + return GC_amiga_allocwrapper_any(size,AllocFunction); + #endif + } + #ifdef GC_AMIGA_PRINTSTATS + else{ + nullretries++; + } + #endif + } + + return ret; + } + + void *GC_amiga_allocwrapper_firsttime(size_t size,void *(*AllocFunction)(size_t size2)){ + atexit(&GC_amiga_free_all_mem); + chipmax=(char *)SysBase->MaxLocMem; // For people still having SysBase in chip-mem, this might speed up a bit. + GC_amiga_allocwrapper_do=GC_amiga_allocwrapper_fast; + return GC_amiga_allocwrapper_fast(size,AllocFunction); + } + + + #endif //GC_AMIGA_FASTALLOC + + + + /* + * The wrapped realloc function. + * + */ + void *GC_amiga_realloc(void *old_object,size_t new_size_in_bytes){ + #ifndef GC_AMIGA_FASTALLOC + return GC_realloc(old_object,new_size_in_bytes); + #else + void *ret; + latestsize=new_size_in_bytes; + ret=GC_realloc(old_object,new_size_in_bytes); + if(ret==NULL && GC_AMIGA_MEMF==(MEMF_FAST | MEMF_CLEAR)){ + /* Out of fast-mem. */ + #ifdef GC_AMIGA_GC + if(!GC_dont_gc){ + GC_gcollect(); + #ifdef GC_AMIGA_PRINTSTATS + numcollects++; + #endif + ret=GC_realloc(old_object,new_size_in_bytes); + } + #endif + if(ret==NULL){ + #ifndef GC_AMIGA_ONLYFAST + GC_AMIGA_MEMF=MEMF_ANY | MEMF_CLEAR; + if(GC_amiga_toany!=NULL) (*GC_amiga_toany)(); + GC_amiga_allocwrapper_do=GC_amiga_allocwrapper_any; + ret=GC_realloc(old_object,new_size_in_bytes); + #endif + } + #ifdef GC_AMIGA_PRINTSTATS + else{ + nullretries++; + } + #endif + } + if(ret==NULL){ + WARN("Out of Memory! Returning NIL!\n", 0); + } + #ifdef GC_AMIGA_PRINTSTATS + if(((char *)ret) ! * mach_dep.c (GC_push_regs) [I386 && (SVR4 || SCO || SCO_ELF) ! && __GNUC__ ]: Call GC_push_one in C to allow for PIC code. ! Fixes PR bootstrap/4162. 2001-09-26 Rainer Orth * solaris_threads.c (MAX_ORIG_STACK_SIZE) [I386]: Provide special Solaris 2/Intel definition. - (GC_get_orig_stack_size): NL-terminate warning message. * configure.in (i?86-*-solaris2.[89]*): Define SOLARIS25_PROC_VDB_BUG_FIXED. ! * gcconfig.h [I386 && SUNOS5]: Use it. * configure: Regenerate. ! * gcconfig.h [I386 && SUNOS5] (DATASTART): Use _etext. (DATAEND): Define using _end. - (STACKBOTTOM): Define. ! 2001-08-19 Release Manager ! * GCC 3.0.1 Released. ! 2001-08-19 Release Manager ! * GCC 3.0.1 Released. ! 2001-08-19 Release Manager ! * GCC 3.0.1 Released. 2001-07-03 Tom Tromey --- 1,287 ---- ! 2002-05-14 Release Manager ! * GCC 3.1 Released. ! 2002-05-14 Release Manager ! * GCC 3.1 Released. ! 2002-05-08 Alexandre Oliva ! * configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at ! script entry, and set LD to it when configuring multilibs. ! * configure: Rebuilt. ! 2002-04-22 Jeff Sturm ! * Makefile.am (toolexeclib_LTLIBRARIES): Remove. ! (noinst_LTLIBRARIES): Add libgcjgc.la. ! * Makefile.in: Rebuild. ! 2002-04-22 David S. Miller ! ! * include/private/gcconfig.h: Hard-code STACKBOTTOM on ! 64-bit SPARC Linux, the __libc_stack_end technique does ! not work in this case. ! ! 2002-04-22 Jeff Sturm ! ! * gcconfig.h: Enable DYNAMIC_LOADING for all sparc-solaris ABIs. ! ! 2002-04-17 Hans Boehm ! ! * include/private/gcconfig.h: Use LINUX_STACKBOTTOM for ! SPARC Linux. ! ! 2002-04-09 Loren J. Rittle ! Richard Henderson ! ! * include/private/gcconfig.h (DATAEND): Update comment example ! to match reality. Clarify comment. ! Change all likely references to linker script synthesized ! symbols to use this idiom: extern int etext[]; etext ! * os_dep.c (GC_init_linux_data_start): Fix references to ! __data_start and _end. ! ! 2002-04-08 Hans Boehm ! ! * include/private/gc_priv.h (WARN macro): Add "GC warning:" prefix. ! (GC_large_alloc_warn_interval, GC_large_alloc_warn_suppressed): ! declare. ! * allchblk.c (GC_allchblk_nth): Change text and support reduced ! frequency for blacklist warning message. ! * misc.c (GC_large_alloc_warn_interval, ! GC_large_alloc_warn_suppressed): define. ! (GC_init_inner): Check GC_NO_BLACKLIST_WARNING and ! GC_LARGE_ALLOC_WARN_INTERVAL environment variables. ! * doc/README.environment (GC_NO_BLACKLIST_WARNING): Deprecate. ! (GC_LARGE_ALLOC_WARN_INTERVAL): Add documentation. ! ! * dyn_load.c (_DYNAMIC): Move declaration to file scope. ! ! 2002-04-04 Loren J. Rittle ! ! * include/private/gcconfig.h: Add support for an unmapped ! memory hole between the end of the initialized data segment ! and the start of the BSS on FreeBSD/i386. ! ! 2002-04-01 Loren J. Rittle ! ! * include/private/gcconfig.h: Add unified test for FreeBSD. ! Support FreeBSD/alpha. ! * os_dep.c: Do not include unless available. ! (GC_freebsd_stack_base): Fix types. ! ! 2002-03-30 Krister Walfridsson ! ! * include/private/gcconfig.h: define DYNAMIC_LOADING for ELF ! NetBSD/i386. ! ! 2002-03-29 Hans Boehm ! ! * linux_threads.c (return_free_lists): Clear fl[i] unconditionally. ! (GC_local_gcj_malloc): Add assertion. ! (start_mark_threads): Fix abort message. ! * mark.c (GC_mark_from): Generalize assertion. ! * reclaim.c (GC_clear_fl_links): New function. ! (GC_start_reclaim): Must clear some freelist links. ! * include/private/specific.h, specific.c: Add assertions. ! Safer definition for INVALID_QTID, quick_thread_id. Fix/add comments. ! Rearrange tse fields. ! ! 2002-03-24 Jeff Sturm ! ! * linux_threads.c (GC_get_nprocs): Close file descriptor. ! ! 2002-03-15 Anthony Green ! ! * misc.c (GC_init_inner): Initialize GC_write_cs before use. ! * configure.in: Disable use of getenv for win32 targets (some of ! which have broken implementations). ! * configure: Rebuilt. ! ! 2002-03-12 Adam Megacz ! ! * dyn_load.c: Renamed GC_win32s to GC_no_win32_dlls. ! * misc.c: Renamed GC_is_win32s() to GC_no_win32_dlls ! * os_dep.c: Renamed GC_win32s to GC_no_win32_dlls and ! statically initialized it to TRUE if compiling with GCC. ! * win32_threads.c (thread_start): We no longer use SEH if ! compiling with GCC. ! * mark.c (GC_mark_some): We no longer use SEH if ! compiling with GCC. ! ! 2002-03-09 Bryce McKinlay ! ! * include/gc_priv.h: Define ALIGN_DOUBLE on 32 bit targets if GCJ ! support is enabled, for hash synchronization. ! ! 2002-03-17 Bryce McKinlay ! ! * Makefile.am: Make a convenience library. ! * Makefile.in: Rebuilt. ! ! 2002-02-24 Adam Megacz ! ! * Makefile.am: Added win32_threads.c to sources list. ! * win32_threads.c: Added two */'s which I had neglected. ! ! 2002-02-20 Bryce McKinlay ! ! * Makefile.am: Re-add SUBDIRS parameter which was lost in merge. ! * Makefile.in: Rebuilt. ! ! 2002-02-13 Bryce McKinlay ! ! * dbg_mlc.c (GC_debug_generic_malloc): Removed. ! ! * sparc_mach_dep.S: Rename from sparc_mach_dep.s as it is a ! preprocessor file. ! * mips_sgi_mach_dep.S: Likewise. ! * Makefile.am: Update for above changes. ! * Makefile.in: Rebuilt. ! ! 2002-02-12 Richard Henderson ! ! * configure.in: Re-apply 2001-06-26 configure change. ! * configure: Rebuild. ! ! 2002-02-12 Bryce McKinlay ! ! Imported GC 6.1 Alpha 3. ! ! * sparc_mach_dep.S: Delete incorrectly named file. ! ! 2001-02-11 Adam Megacz ! ! * include/private/gcconfig.h: Add XSCALE NOSYS support for bare ! board embedded targets. ! * os_dep.c: Avoid signal handling code for NOSYS/ECOS targets. ! Use GC_get_stack_base for NOSYS/ECOS targets. Clean up some ! redundant uses of ECOS. ! * misc.c: Use NOSYS where ECOS is being used. ! Don't define GC_write twice for ECOS systems. ! (GC_write): New function for NOSYS targets. ! ! 2002-02-06 Adam Megacz ! ! * boehm-gc/include/gc.h: (GC_CreateThread) This function is ! now exposed on all Win32 platforms. ! * boehm-gc/win32_threads.c: (GC_CreateThread) This now ! compiles on Win32; it invokes CreateThread() if GC is built ! as a DLL; otherwise it registers the thread. ! * boehm-gc/misc.c (GC_init): Initialize GC_allocate_ml in case ! libgcjgc was not built as a DLL. ! ! 2002-02-01 Adam Megacz ! ! * boehm-gc on win32 now automatically detects if it is being built ! as a DLL; see http://gcc.gnu.org/ml/java/2001-12/msg00240.html ! ! 2002-01-25 David Edelsohn ! ! * include/gc.h (GC_INIT): Add DATASTART and DATAEND roots on AIX. ! * include/private/gcconfig.h (RS6000): Add 64-bit AIX support. ! Define USE_GENERIC_PUSH_REGS. Use AIX _data and _end symbols for ! DATASTART and DATAEND roots. ! * rs6000_mach_dep.s: Add function descriptor and traceback table. ! ! 2001-12-16 Jeff Sturm ! ! * dyn_load.c: Define ElfW (if needed) for all targets, ! not just GNU/Linux. ! (GC_FirstDLOpenedLinkMap): Use it. ! (GC_register_dynamic_libraries_dl): Use it. ! * include/private/gcconfig.h: Define CPP_WORDSZ, ELF_CLASS ! for sparcv9. ! ! 2001-12-16 Craig Rodrigues ! ! PR other/3725 ! * configure.in: Add AC_SUBST(target_alias). ! * configure: Regenerated. ! ! 2001-11-26 Loren J. Rittle ! ! * linux_threads.c (WRAP_FUNC(pthread_join)): Remove special ! case for GC_FREEBSD_THREADS. ! * configure.in (*-*-freebsd*): Clarify warning. ! * configure: Rebuilt. ! ! 2001-10-23 Loren J. Rittle ! Andreas Tobler ! ! * include/private/solaris_threads.h: Update to use GC_SOLARIS_THREADS. ! ! 2001-10-22 Bryce McKinlay ! ! * linux_threads.c (GC_init_parallel): Do not declare as a static ! constructor. ! * include/gc.h (GC_init): Declare here. Add description. ! * include/private/gc_priv.h (GC_init): Remove declaration. ! ! 2001-10-16 Loren J. Rittle ! ! * include/gc_pthread_redirects.h: Generalize test to use GC_PTHREADS. ! * linux_threads.c (WRAP_FUNC(pthread_join)): Conditionalized on ! GC_FREEBSD_THREADS, handle strange interaction between system ! pthread implementation and boehm-gc signal-handler architecture. ! * tests/test.c (main): Conditionalized on GC_FREEBSD_THREADS, ! set stack. ! * include/private/gcconfig.h (configuration keyed off FREEBSD): ! Define SIG_SUSPEND, SIG_THR_RESTART. Do not define ! MPROTECT_VDB when GC_FREEBSD_THREADS is defined. ! ! 2001-10-16 Loren J. Rittle ! ! * Makefile.am (test.o): Find tests/test.c in $(srcdir). ! * Makefile.in: Rebuilt. ! ! 2001-10-16 Bryce McKinlay ! ! * Makefile.am, acinclude.m4, configure.in: Imported GC 6.1 Alpha 1 and ! merged local changes. 2001-09-26 Rainer Orth * solaris_threads.c (MAX_ORIG_STACK_SIZE) [I386]: Provide special Solaris 2/Intel definition. * configure.in (i?86-*-solaris2.[89]*): Define SOLARIS25_PROC_VDB_BUG_FIXED. ! * include/private/gcconfig.h [I386 && SUNOS5]: Use it. * configure: Regenerate. ! * include/private/gcconfig.h [I386 && SUNOS5] (DATASTART): Use _etext. (DATAEND): Define using _end. ! 2001-09-11 Per Bothner ! * include/Makefile.am: New file. It defines include_HEADERS. ! * Makefile.am (SUBDIRS): New macro, set to include. ! * configure.in (AC_OUTPUT): Add include/Makefile. ! 2001-08-20 Tom Tromey ! * configure: Rebuilt. ! * configure.in: Always ask gcc for threads package. ! 2001-08-17 Tom Tromey ! * Makefile.am, acinclude.m4, configure.in: Imported GC 6.0 and ! merged local changes. ! ! 2001-08-02 David Billinghurst ! ! * configure: Rebuilt. ! * configure.in: POSIX threads on cygwin does not link with ! -lpthreads. 2001-07-03 Tom Tromey *************** *** 53,67 **** * aclocal.m4, configure, Makefile.in: Rebuilt. * acinclude.m4: Set mkinstalldirs for in-tree build. ! 20010617 Release Manager ! * GCC 3.0 Released. 2001-06-12 Tom Tromey * aclocal.m4, configure: Rebuilt. * acinclude.m4: Find configure.host in srcdir. 2001-06-07 Tom Tromey For PR bootstrap/3075: --- 289,313 ---- * aclocal.m4, configure, Makefile.in: Rebuilt. * acinclude.m4: Set mkinstalldirs for in-tree build. ! 2001-06-26 Richard Henderson ! * alpha_mach_dep.s: Mark call-saved FP registers. ! * include/private/gcconfig.h (ALPHA): Remove USE_GENERIC_PUSH_REGS. ! * configure.in (alpha*): Re-enable alpha_mach_dep.s ! * configure: Rebuild. 2001-06-12 Tom Tromey * aclocal.m4, configure: Rebuilt. * acinclude.m4: Find configure.host in srcdir. + 2001-06-09 Alexandre Oliva , Stephen L Moshier + + * configure.in (AC_EXEEXT): Work around in case it expands to + nothing, as in autoconf 2.50. + * acinclude.m4: Likewise. + * aclocal.m4, configure: Rebuilt. + 2001-06-07 Tom Tromey For PR bootstrap/3075: *************** *** 73,78 **** --- 319,359 ---- * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Use srcdir, not boehm_gc_basedir. + 2001-05-24 Bryce McKinlay + + * Makefile.am: Override gctest_OBJECTS so tests/test.c can be built. + (libgcjgc_la_SOURCES): Remove typo. + * tests/test.c: Fix struct names and includes for GC_GCJ_SUPPORT case. + * Makefile.in: Rebuilt. + + 2001-05-21 Bryce McKinlay + + Imported version version 6.0alpha7. + + * README, README.Mac, README.OS2, README.QUICK, README.alpha, + README.amiga, README.debugging, README.dj, README.hp, README.linux, + README.rs6000, README.sgi, README.solaris2, README.uts, + README.win32, SCoptions.amiga, backptr.h, barrett_diagram, + dbg_mlc.h, gc.h, gc.man, gc_alloc.h, gc_cpp.h, gc_hdrs.h, gc_mark.h, + gc_priv.h, gc_private.h, gc_typed.h, gcconfig.h, + hpux_irix_threads.c, makefile.depend, nursery.c, + solaris_threads.h, test.c, test_cpp.cc, weakpointer.h, cord/README, + cord/SCOPTIONS.amiga, cord/SMakefile.amiga, cord/cord.h, + cord/ec.h, cord/gc.h, cord/private/cord_pos.h, include/backptr.h, + include/gc_copy_descr.h, include/gc_nursery.h: Remove obsolete/moved + files. + + 2001-05-19 Hans Boehm + + * configure.host: Build with -fexceptions. + * linux_threads.c: Remember which thread stopped world for + + 2001-05-04 Loren J. Rittle + with final tuning by Bryce McKinlay + + * configure.in: Add support for --enable-threads=posix on FreeBSD. + * configure: Rebuilt. + 2001-05-01 Jeffrey Oldham * gc_priv.h (UNLOCK): Change type of GC_noop1 argument. diff -Nrc3pad gcc-3.0.4/boehm-gc/EMX_MAKEFILE gcc-3.1/boehm-gc/EMX_MAKEFILE *** gcc-3.0.4/boehm-gc/EMX_MAKEFILE Mon Nov 1 23:15:51 1999 --- gcc-3.1/boehm-gc/EMX_MAKEFILE Fri Aug 17 18:30:44 2001 *************** $(OBJS) test.o: $(srcdir)/gc_priv.h $(sr *** 77,83 **** # options such as -DSILENT affects the size of GC_arrays, # invalidating all .o files that rely on gc_priv.h ! mark.o typd_mlc.o finalize.o: $(srcdir)/gc_mark.h gc.a: $(OBJS) $(AR) ru gc.a $(OBJS) --- 77,83 ---- # options such as -DSILENT affects the size of GC_arrays, # invalidating all .o files that rely on gc_priv.h ! mark.o typd_mlc.o finalize.o: $(srcdir)/include/gc_mark.h $(srcdir)/include/private/gc_pmark.h gc.a: $(OBJS) $(AR) ru gc.a $(OBJS) *************** cord/de.exe: $(srcdir)/cord/de.c $(srcdi *** 120,132 **** $(CC) $(CFLAGS) -o cord/de.exe $(srcdir)/cord/de.c $(srcdir)/cord/cordbscs.o $(srcdir)/cord/cordxtra.o gc.a $(CURSES) clean: ! rm -f gc.a test.o gctest.exe output-local output-diff $(OBJS) \ setjmp_test mon.out gmon.out a.out core \ $(CORD_OBJS) cord/cordtest.exe cord/de.exe -rm -f *~ ! gctest.exe: test.o gc.a ! $(CC) $(CFLAGS) -o gctest.exe test.o gc.a # If an optimized setjmp_test generates a segmentation fault, # odds are your compiler is broken. Gctest may still work. --- 120,132 ---- $(CC) $(CFLAGS) -o cord/de.exe $(srcdir)/cord/de.c $(srcdir)/cord/cordbscs.o $(srcdir)/cord/cordxtra.o gc.a $(CURSES) clean: ! rm -f gc.a tests/test.o gctest.exe output-local output-diff $(OBJS) \ setjmp_test mon.out gmon.out a.out core \ $(CORD_OBJS) cord/cordtest.exe cord/de.exe -rm -f *~ ! gctest.exe: tests/test.o gc.a ! $(CC) $(CFLAGS) -o gctest.exe tests/test.o gc.a # If an optimized setjmp_test generates a segmentation fault, # odds are your compiler is broken. Gctest may still work. diff -Nrc3pad gcc-3.0.4/boehm-gc/Makefile.am gcc-3.1/boehm-gc/Makefile.am *** gcc-3.0.4/boehm-gc/Makefile.am Fri Jun 8 17:59:15 2001 --- gcc-3.1/boehm-gc/Makefile.am Tue Apr 23 03:20:04 2002 *************** *** 6,11 **** --- 6,13 ---- AUTOMAKE_OPTIONS = cygnus + SUBDIRS = include + # Multilib support variables. MULTISRCTOP = MULTIBUILDTOP = *************** toolexecdir = $(exec_prefix)/$(target_al *** 23,37 **** toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR) endif ! toolexeclib_LTLIBRARIES = $(target_all) ! EXTRA_LTLIBRARIES = libgcjgc.la ! libgcjgc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c \ ! gcconfig.h dbg_mlc.c dyn_load.c finalize.c gc.h gc_alloc.h gc_cpp.h \ ! gc_hdrs.h gc_mark.h gc_priv.h gc_private.h gc_typed.h gcj_mlc.c headers.c \ ! hpux_irix_threads.c linux_threads.c malloc.c mallocx.c mark.c mark_rts.c \ ! misc.c new_hblk.c obj_map.c os_dep.c pcr_interface.c ptr_chck.c \ ! real_malloc.c reclaim.c solaris_pthreads.c solaris_threads.c \ ! solaris_threads.h stubborn.c typd_mlc.c version.h weakpointer.h # Include THREADLIBS here to ensure that the correct versions of # linuxthread semaphore functions get linked: --- 25,48 ---- toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR) endif ! noinst_LTLIBRARIES = libgcjgc.la libgcjgc_convenience.la ! ! GC_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \ ! dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c irix_threads.c \ ! linux_threads.c malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \ ! obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \ ! solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c \ ! backgraph.c win32_threads.c ! ! EXTRA_GC_SOURCES = alpha_mach_dep.s \ ! mips_sgi_mach_dep.S mips_ultrix_mach_dep.s powerpc_macosx_mach_dep.s \ ! rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \ ! sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s ! ! libgcjgc_la_SOURCES = $(GC_SOURCES) ! libgcjgc_convenience_la_SOURCES = $(GC_SOURCES) ! EXTRA_libgcjgc_la_SOURCES = $(EXTRA_GC_SOURCES) ! EXTRA_libgcjgc_convenience_la_SOURCES = $(EXTRA_GC_SOURCES) # Include THREADLIBS here to ensure that the correct versions of # linuxthread semaphore functions get linked: *************** libgcjgc_la_LIBADD = @addobjs@ $(THREADL *** 39,53 **** libgcjgc_la_DEPENDENCIES = @addobjs@ libgcjgc_la_LDFLAGS = -version-info 1:1:0 -rpath $(toolexeclibdir) ! EXTRA_libgcjgc_la_SOURCES = alpha_mach_dep.s mips_sgi_mach_dep.s \ ! mips_ultrix_mach_dep.s rs6000_mach_dep.s sparc_mach_dep.s \ ! sparc_sunos4_mach_dep.s mach_dep.c ecos.cc ! AM_CXXFLAGS = @BOEHM_GC_CFLAGS@ ! AM_CFLAGS = @BOEHM_GC_CFLAGS@ check_PROGRAMS = gctest ! gctest_SOURCES = test.c gctest_LDADD = ./libgcjgc.la $(THREADLIBS) $(EXTRA_TEST_LIBS) gctest_LDFLAGS = -shared-libgcc TESTS_ENVIRONMENT = LD_LIBRARY_PATH=../../$(MULTIBUILDTOP)gcc --- 50,69 ---- libgcjgc_la_DEPENDENCIES = @addobjs@ libgcjgc_la_LDFLAGS = -version-info 1:1:0 -rpath $(toolexeclibdir) ! libgcjgc_convenience_la_LIBADD = @addobjs@ ! libgcjgc_convenience_la_DEPENDENCIES = @addobjs@ ! AM_CXXFLAGS = @GC_CFLAGS@ ! AM_CFLAGS = @GC_CFLAGS@ check_PROGRAMS = gctest ! # The following hack produces a warning from automake, but we need it in order ! # to build a file from a subdirectory. FIXME. ! test.o: tests/test.c ! $(COMPILE) -c $(srcdir)/tests/test.c ! # Using $< in the above seems to fail with the HP/UX on Itanium make. ! ! gctest_OBJECTS = test.o gctest_LDADD = ./libgcjgc.la $(THREADLIBS) $(EXTRA_TEST_LIBS) gctest_LDFLAGS = -shared-libgcc TESTS_ENVIRONMENT = LD_LIBRARY_PATH=../../$(MULTIBUILDTOP)gcc *************** TESTS = gctest *** 55,61 **** ## FIXME: relies on internal code generated by automake. all_objs = @addobjs@ $(libgcjgc_la_OBJECTS) ! $(all_objs) : gcconfig.h gc_priv.h gc_hdrs.h gc.h gc_mark.h ## FIXME: we shouldn't have to do this, but automake forces us to. .s.lo: --- 71,78 ---- ## FIXME: relies on internal code generated by automake. all_objs = @addobjs@ $(libgcjgc_la_OBJECTS) ! $(all_objs) : include/private/gcconfig.h include/private/gc_priv.h \ ! include/private/gc_hdrs.h include/gc.h include/gc_gcj.h include/gc_mark.h ## FIXME: we shouldn't have to do this, but automake forces us to. .s.lo: *************** $(all_objs) : gcconfig.h gc_priv.h gc_hd *** 67,76 **** ## CFLAGS, not those passed in from the top level make. LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) \ ! $(AM_CFLAGS) $(MY_CFLAGS) $(BOEHM_GC_CFLAGS) LINK = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(MY_CFLAGS) $(LDFLAGS) -o $@ ! AM_CFLAGS = @BOEHM_GC_CFLAGS@ # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and --- 84,93 ---- ## CFLAGS, not those passed in from the top level make. LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) \ ! $(AM_CFLAGS) $(MY_CFLAGS) $(GC_CFLAGS) LINK = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(MY_CFLAGS) $(LDFLAGS) -o $@ ! AM_CFLAGS = @GC_CFLAGS@ # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and diff -Nrc3pad gcc-3.0.4/boehm-gc/Makefile.direct gcc-3.1/boehm-gc/Makefile.direct *** gcc-3.0.4/boehm-gc/Makefile.direct Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/Makefile.direct Tue Feb 12 04:37:53 2002 *************** *** 0 **** --- 1,614 ---- + # This is the original manually generated Makefile. It may still be used + # to build the collector. + # + # Primary targets: + # gc.a - builds basic library + # c++ - adds C++ interface to library + # cords - adds cords (heavyweight strings) to library + # test - prints porting information, then builds basic version of gc.a, + # and runs some tests of collector and cords. Does not add cords or + # c++ interface to gc.a + # cord/de - builds dumb editor based on cords. + ABI_FLAG= + CC=cc $(ABI_FLAG) + CXX=g++ $(ABI_FLAG) + AS=as $(ABI_FLAG) + # The above doesn't work with gas, which doesn't run cpp. + # Define AS as `gcc -c -x assembler-with-cpp' instead. + # Under Irix 6, you will have to specify the ABI (-o32, -n32, or -64) + # if you use something other than the default ABI on your machine. + + # Redefining srcdir allows object code for the nonPCR version of the collector + # to be generated in different directories. + srcdir= . + VPATH= $(srcdir) + + CFLAGS= -O -I$(srcdir)/include -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DNO_EXECUTE_PERMISSION -DSILENT -DALL_INTERIOR_POINTERS + + # To build the parallel collector on Linux, add to the above: + # -DGC_LINUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC + # To build the parallel collector n a static library on HP/UX, add to the above: + # -DGC_HPUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC -DUSE_HPUX_TLS -D_POSIX_C_SOURCE=199506L + + # HOSTCC and HOSTCFLAGS are used to build executables that will be run as + # part of the build process, i.e. on the build machine. These will usually + # be the same as CC and CFLAGS, except in a cross-compilation environment. + # Note that HOSTCFLAGS should include any -D flags that affect thread support. + HOSTCC=$(CC) + HOSTCFLAGS=$(CFLAGS) + + # For dynamic library builds, it may be necessary to add flags to generate + # PIC code, e.g. -fPIC on Linux. + + # Setjmp_test may yield overly optimistic results when compiled + # without optimization. + + # These define arguments influence the collector configuration: + # -DSILENT disables statistics printing, and improves performance. + # -DFIND_LEAK causes GC_find_leak to be initially set. + # This causes the collector to assume that all inaccessible + # objects should have been explicitly deallocated, and reports exceptions. + # Finalization and the test program are not usable in this mode. + # -DGC_SOLARIS_THREADS enables support for Solaris (thr_) threads. + # (Clients should also define GC_SOLARIS_THREADS and then include + # gc.h before performing thr_ or dl* or GC_ operations.) + # Must also define -D_REENTRANT. + # -DGC_SOLARIS_PTHREADS enables support for Solaris pthreads. + # Define SOLARIS_THREADS as well. + # -DGC_IRIX_THREADS enables support for Irix pthreads. See README.irix. + # -DGC_HPUX_THREADS enables support for HP/UX 11 pthreads. + # Also requires -D_REENTRANT or -D_POSIX_C_SOURCE=199506L. See README.hp. + # -DGC_LINUX_THREADS enables support for Xavier Leroy's Linux threads. + # see README.linux. -D_REENTRANT may also be required. + # -DALL_INTERIOR_POINTERS allows all pointers to the interior + # of objects to be recognized. (See gc_priv.h for consequences.) + # Alternatively, GC_all_interior_pointers can be set at process + # initialization time. + # -DSMALL_CONFIG tries to tune the collector for small heap sizes, + # usually causing it to use less space in such situations. + # Incremental collection no longer works in this case. + # -DLARGE_CONFIG tunes the collector for unusually large heaps. + # Necessary for heaps larger than about 500 MB on most machines. + # Recommended for heaps larger than about 64 MB. + # -DDONT_ADD_BYTE_AT_END is meaningful only with -DALL_INTERIOR_POINTERS or + # GC_all_interior_pointers = 1. Normally -DALL_INTERIOR_POINTERS + # causes all objects to be padded so that pointers just past the end of + # an object can be recognized. This can be expensive. (The padding + # is normally more than one byte due to alignment constraints.) + # -DDONT_ADD_BYTE_AT_END disables the padding. + # -DNO_SIGNALS does not disable signals during critical parts of + # the GC process. This is no less correct than many malloc + # implementations, and it sometimes has a significant performance + # impact. However, it is dangerous for many not-quite-ANSI C + # programs that call things like printf in asynchronous signal handlers. + # This is on by default. Turning it off has not been extensively tested with + # compilers that reorder stores. It should have been. + # -DNO_EXECUTE_PERMISSION may cause some or all of the heap to not + # have execute permission, i.e. it may be impossible to execute + # code from the heap. Currently this only affects the incremental + # collector on UNIX machines. It may greatly improve its performance, + # since this may avoid some expensive cache synchronization. + # -DGC_NO_OPERATOR_NEW_ARRAY declares that the C++ compiler does not support + # the new syntax "operator new[]" for allocating and deleting arrays. + # See gc_cpp.h for details. No effect on the C part of the collector. + # This is defined implicitly in a few environments. Must also be defined + # by clients that use gc_cpp.h. + # -DREDIRECT_MALLOC=X causes malloc, realloc, and free to be + # defined as aliases for X, GC_realloc, and GC_free, respectively. + # Calloc and strdup are redefined in terms of the new malloc. X should + # be either GC_malloc or GC_malloc_uncollectable, or + # GC_debug_malloc_replacement. (The latter invokes GC_debug_malloc + # with dummy source location information, but still results in + # properly remembered call stacks on Linux/X86 and Solaris/SPARC.) + # The former is occasionally useful for working around leaks in code + # you don't want to (or can't) look at. It may not work for + # existing code, but it often does. Neither works on all platforms, + # since some ports use malloc or calloc to obtain system memory. + # (Probably works for UNIX, and win32.) If you build with DBG_HDRS_ALL, + # you should only use GC_debug_malloc_replacement as a malloc + # replacement. + # -DREDIRECT_REALLOC=X causes GC_realloc to be redirected to X. + # The canonical use is -DREDIRECT_REALLOC=GC_debug_realloc_replacement, + # together with -DREDIRECT_MALLOC=GC_debug_malloc_replacement to + # generate leak reports with call stacks for both malloc and realloc. + # -DIGNORE_FREE turns calls to free into a noop. Only useful with + # -DREDIRECT_MALLOC. + # -DNO_DEBUGGING removes GC_dump and the debugging routines it calls. + # Reduces code size slightly at the expense of debuggability. + # -DJAVA_FINALIZATION makes it somewhat safer to finalize objects out of + # order by specifying a nonstandard finalization mark procedure (see + # finalize.c). Objects reachable from finalizable objects will be marked + # in a sepearte postpass, and hence their memory won't be reclaimed. + # Not recommended unless you are implementing a language that specifies + # these semantics. Since 5.0, determines only only the initial value + # of GC_java_finalization variable. + # -DFINALIZE_ON_DEMAND causes finalizers to be run only in response + # to explicit GC_invoke_finalizers() calls. + # In 5.0 this became runtime adjustable, and this only determines the + # initial value of GC_finalize_on_demand. + # -DATOMIC_UNCOLLECTABLE includes code for GC_malloc_atomic_uncollectable. + # This is useful if either the vendor malloc implementation is poor, + # or if REDIRECT_MALLOC is used. + # -DHBLKSIZE=ddd, where ddd is a power of 2 between 512 and 16384, explicitly + # sets the heap block size. Each heap block is devoted to a single size and + # kind of object. For the incremental collector it makes sense to match + # the most likely page size. Otherwise large values result in more + # fragmentation, but generally better performance for large heaps. + # -DUSE_MMAP use MMAP instead of sbrk to get new memory. + # Works for Solaris and Irix. + # -DUSE_MUNMAP causes memory to be returned to the OS under the right + # circumstances. This currently disables VM-based incremental collection. + # This is currently experimental, and works only under some Unix, + # Linux and Windows versions. + # -DMMAP_STACKS (for Solaris threads) Use mmap from /dev/zero rather than + # GC_scratch_alloc() to get stack memory. + # -DPRINT_BLACK_LIST Whenever a black list entry is added, i.e. whenever + # the garbage collector detects a value that looks almost, but not quite, + # like a pointer, print both the address containing the value, and the + # value of the near-bogus-pointer. Can be used to identifiy regions of + # memory that are likely to contribute misidentified pointers. + # -DKEEP_BACK_PTRS Add code to save back pointers in debugging headers + # for objects allocated with the debugging allocator. If all objects + # through GC_MALLOC with GC_DEBUG defined, this allows the client + # to determine how particular or randomly chosen objects are reachable + # for debugging/profiling purposes. The gc_backptr.h interface is + # implemented only if this is defined. + # -DGC_ASSERTIONS Enable some internal GC assertion checking. Currently + # this facility is only used in a few places. It is intended primarily + # for debugging of the garbage collector itself, but could also + # -DDBG_HDRS_ALL Make sure that all objects have debug headers. Increases + # the reliability (from 99.9999% to 100%) of some of the debugging + # code (especially KEEP_BACK_PTRS). Makes -DSHORT_DBG_HDRS possible. + # Assumes that all client allocation is done through debugging + # allocators. + # -DSHORT_DBG_HDRS Assume that all objects have debug headers. Shorten + # the headers to minimize object size, at the expense of checking for + # writes past the end of an object. This is intended for environments + # in which most client code is written in a "safe" language, such as + # Scheme or Java. Assumes that all client allocation is done using + # the GC_debug_ functions, or through the macros that expand to these, + # or by redirecting malloc to GC_debug_malloc_replacement. + # (Also eliminates the field for the requested object size.) + # occasionally be useful for debugging of client code. Slows down the + # collector somewhat, but not drastically. + # -DSAVE_CALL_COUNT= Set the number of call frames saved with objects + # allocated through the debugging interface. Affects the amount of + # information generated in leak reports. Only matters on platforms + # on which we can quickly generate call stacks, currently Linux/(X86 & SPARC) + # and Solaris/SPARC and platforms that provide execinfo.h. + # Default is zero. On X86, client + # code should NOT be compiled with -fomit-frame-pointer. + # -DSAVE_CALL_NARGS= Set the number of functions arguments to be + # saved with each call frame. Default is zero. Ignored if we + # don't know how to retrieve arguments on the platform. + # -DCHECKSUMS reports on erroneously clear dirty bits, and unexpectedly + # altered stubborn objects, at substantial performance cost. + # Use only for debugging of the incremental collector. + # -DGC_GCJ_SUPPORT includes support for gcj (and possibly other systems + # that include a pointer to a type descriptor in each allocated object). + # Building this way requires an ANSI C compiler. + # -DUSE_I686_PREFETCH causes the collector to issue Pentium III style + # prefetch instructions. No effect except on X86 Linux platforms. + # Assumes a very recent gcc-compatible compiler and assembler. + # (Gas prefetcht0 support was added around May 1999.) + # Empirically the code appears to still run correctly on Pentium II + # processors, though with no performance benefit. May not run on other + # X86 processors? In some cases this improves performance by + # 15% or so. + # -DUSE_3DNOW_PREFETCH causes the collector to issue AMD 3DNow style + # prefetch instructions. Same restrictions as USE_I686_PREFETCH. + # UNTESTED!! + # -DGC_USE_LD_WRAP in combination with the gld flags listed in README.linux + # causes the collector some system and pthread calls in a more transparent + # fashion than the usual macro-based approach. Requires GNU ld, and + # currently probably works only with Linux. + # -DTHREAD_LOCAL_ALLOC defines GC_local_malloc(), GC_local_malloc_atomic() + # and GC_local_gcj_malloc(). Needed for gc_gcj.h interface. These allocate + # in a way that usually does not involve acquisition of a global lock. + # Currently requires -DGC_LINUX_THREADS, but should be easy to port to + # other pthreads environments. Recommended for multiprocessors. + # -DPARALLEL_MARK allows the marker to run in multiple threads. Recommended + # for multiprocessors. Currently requires Linux on X86 or IA64, though + # support for other Posix platforms should be fairly easy to add, + # if the thread implementation is otherwise supported. + # -DNO_GETENV prevents the collector from looking at environment variables. + # These may otherwise alter its configuration, or turn off GC altogether. + # I don't know of a reason to disable this, except possibly if the + # resulting process runs as a privileged user? + # -DUSE_GLOBAL_ALLOC. Win32 only. Use GlobalAlloc instead of + # VirtualAlloc to allocate the heap. May be needed to work around + # a Windows NT/2000 issue. Incompatible with USE_MUNMAP. + # See README.win32 for details. + # -DMAKE_BACK_GRAPH. Enable GC_PRINT_BACK_HEIGHT environment variable. + # See README.environment for details. Experimental. Limited platform + # support. Implies DBG_HDRS_ALL. All allocation should be done using + # the debug interface. + # -DSTUBBORN_ALLOC allows allocation of "hard to change" objects, and thus + # makes incremental collection easier. Was enabled by default until 6.0. + # Rarely used, to my knowledge. + # + + CXXFLAGS= $(CFLAGS) + AR= ar + RANLIB= ranlib + + + OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o headers.o mark.o obj_map.o blacklst.o finalize.o new_hblk.o dbg_mlc.o malloc.o stubborn.o checksums.o solaris_threads.o irix_threads.o linux_threads.o typd_mlc.o ptr_chck.o mallocx.o solaris_pthreads.o gcj_mlc.o specific.o gc_dlopen.o backgraph.o + + CSRCS= reclaim.c allchblk.c misc.c alloc.c mach_dep.c os_dep.c mark_rts.c headers.c mark.c obj_map.c pcr_interface.c blacklst.c finalize.c new_hblk.c real_malloc.c dyn_load.c dbg_mlc.c malloc.c stubborn.c checksums.c solaris_threads.c irix_threads.c linux_threads.c typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c gcj_mlc.c specific.c gc_dlopen.c backgraph.c + + CORD_SRCS= cord/cordbscs.c cord/cordxtra.c cord/cordprnt.c cord/de.c cord/cordtest.c include/cord.h include/ec.h include/private/cord_pos.h cord/de_win.c cord/de_win.h cord/de_cmds.h cord/de_win.ICO cord/de_win.RC + + CORD_OBJS= cord/cordbscs.o cord/cordxtra.o cord/cordprnt.o + + SRCS= $(CSRCS) mips_sgi_mach_dep.s rs6000_mach_dep.s alpha_mach_dep.s \ + sparc_mach_dep.S include/gc.h include/gc_typed.h \ + include/private/gc_hdrs.h include/private/gc_priv.h \ + include/private/gcconfig.h include/private/gc_pmark.h \ + include/gc_inl.h include/gc_inline.h include/gc_mark.h \ + threadlibs.c if_mach.c if_not_there.c gc_cpp.cc include/gc_cpp.h \ + gcname.c include/weakpointer.h include/private/gc_locks.h \ + gcc_support.c mips_ultrix_mach_dep.s include/gc_alloc.h \ + include/new_gc_alloc.h include/javaxfc.h sparc_sunos4_mach_dep.s \ + sparc_netbsd_mach_dep.s \ + include/private/solaris_threads.h include/gc_backptr.h \ + hpux_test_and_clear.s include/gc_gcj.h \ + include/gc_local_alloc.h include/private/dbg_mlc.h \ + include/private/specific.h powerpc_macosx_mach_dep.s \ + include/leak_detector.h include/gc_amiga_redirects.h \ + include/gc_pthread_redirects.h $(CORD_SRCS) + + DOC_FILES= README.QUICK doc/README.Mac doc/README.MacOSX doc/README.OS2 \ + doc/README.amiga doc/README.cords doc/debugging.html \ + doc/README.dj doc/README.hp doc/README.linux doc/README.rs6000 \ + doc/README.sgi doc/README.solaris2 doc/README.uts \ + doc/README.win32 doc/barrett_diagram doc/README \ + doc/README.contributors doc/README.changes doc/gc.man \ + doc/README.environment doc/tree.html doc/gcdescr.html \ + doc/README.autoconf doc/README.macros doc/README.ews4800 + + TESTS= tests/test.c tests/test_cpp.cc tests/trace_test.c \ + tests/leak_test.c tests/thread_leak_test.c + + GNU_BUILD_FILES= configure.in Makefile.am configure acinclude.m4 \ + libtool.m4 install-sh configure.host Makefile.in \ + aclocal.m4 config.sub config.guess ltconfig \ + ltmain.sh mkinstalldirs + + OTHER_MAKEFILES= OS2_MAKEFILE NT_MAKEFILE NT_THREADS_MAKEFILE gc.mak \ + BCC_MAKEFILE EMX_MAKEFILE WCC_MAKEFILE Makefile.dj \ + PCR-Makefile SMakefile.amiga Makefile.DLLs \ + digimars.mak Makefile.direct + # Makefile and Makefile.direct are copies of each other. + + OTHER_FILES= Makefile setjmp_t.c callprocs pc_excludes \ + MacProjects.sit.hqx MacOS.c \ + Mac_files/datastart.c Mac_files/dataend.c \ + Mac_files/MacOS_config.h Mac_files/MacOS_Test_config.h \ + add_gc_prefix.c gc_cpp.cpp win32_threads.c \ + version.h AmigaOS.c \ + $(TESTS) $(GNU_BUILD_FILES) $(OTHER_MAKEFILES) + + CORD_INCLUDE_FILES= $(srcdir)/include/gc.h $(srcdir)/include/cord.h \ + $(srcdir)/include/ec.h $(srcdir)/include/private/cord_pos.h + + UTILS= if_mach if_not_there threadlibs + + # Libraries needed for curses applications. Only needed for de. + CURSES= -lcurses -ltermlib + + # The following is irrelevant on most systems. But a few + # versions of make otherwise fork the shell specified in + # the SHELL environment variable. + SHELL= /bin/sh + + SPECIALCFLAGS = -I$(srcdir)/include + # Alternative flags to the C compiler for mach_dep.c. + # Mach_dep.c often doesn't like optimization, and it's + # not time-critical anyway. + # Set SPECIALCFLAGS to -q nodirect_code on Encore. + + all: gc.a gctest + + BSD-pkg-all: bsd-libgc.a + + bsd-libgc.a: + $(MAKE) CFLAGS="$(CFLAGS)" clean c++-t + mv gc.a bsd-libgc.a + + BSD-pkg-install: BSD-pkg-all + ${CP} bsd-libgc.a libgc.a + ${INSTALL_DATA} libgc.a ${PREFIX}/lib + ${INSTALL_DATA} gc.h gc_cpp.h ${PREFIX}/include + + pcr: PCR-Makefile include/private/gc_private.h include/private/gc_hdrs.h \ + include/private/gc_locks.h include/gc.h include/private/gcconfig.h \ + mach_dep.o $(SRCS) + $(MAKE) -f PCR-Makefile depend + $(MAKE) -f PCR-Makefile + + $(OBJS) tests/test.o dyn_load.o dyn_load_sunos53.o: \ + $(srcdir)/include/private/gc_priv.h \ + $(srcdir)/include/private/gc_hdrs.h $(srcdir)/include/private/gc_locks.h \ + $(srcdir)/include/gc.h \ + $(srcdir)/include/private/gcconfig.h $(srcdir)/include/gc_typed.h \ + Makefile + # The dependency on Makefile is needed. Changing + # options such as -DSILENT affects the size of GC_arrays, + # invalidating all .o files that rely on gc_priv.h + + mark.o typd_mlc.o finalize.o ptr_chck.o: $(srcdir)/include/gc_mark.h $(srcdir)/include/private/gc_pmark.h + + specific.o linux_threads.o: $(srcdir)/include/private/specific.h + + solaris_threads.o solaris_pthreads.o: $(srcdir)/include/private/solaris_threads.h + + dbg_mlc.o gcj_mlc.o: $(srcdir)/include/private/dbg_mlc.h + + tests/test.o: tests $(srcdir)/tests/test.c + $(CC) $(CFLAGS) -c $(srcdir)/tests/test.c + mv test.o tests/test.o + + tests: + mkdir tests + + base_lib gc.a: $(OBJS) dyn_load.o $(UTILS) + echo > base_lib + rm -f dont_ar_1 + ./if_mach SPARC SUNOS5 touch dont_ar_1 + ./if_mach SPARC SUNOS5 $(AR) rus gc.a $(OBJS) dyn_load.o + ./if_mach M68K AMIGA touch dont_ar_1 + ./if_mach M68K AMIGA $(AR) -vrus gc.a $(OBJS) dyn_load.o + ./if_not_there dont_ar_1 $(AR) ru gc.a $(OBJS) dyn_load.o + ./if_not_there dont_ar_1 $(RANLIB) gc.a || cat /dev/null + # ignore ranlib failure; that usually means it doesn't exist, and isn't needed + + cords: $(CORD_OBJS) cord/cordtest $(UTILS) + rm -f dont_ar_3 + ./if_mach SPARC SUNOS5 touch dont_ar_3 + ./if_mach SPARC SUNOS5 $(AR) rus gc.a $(CORD_OBJS) + ./if_mach M68K AMIGA touch dont_ar_3 + ./if_mach M68K AMIGA $(AR) -vrus gc.a $(CORD_OBJS) + ./if_not_there dont_ar_3 $(AR) ru gc.a $(CORD_OBJS) + ./if_not_there dont_ar_3 $(RANLIB) gc.a || cat /dev/null + + gc_cpp.o: $(srcdir)/gc_cpp.cc $(srcdir)/include/gc_cpp.h $(srcdir)/include/gc.h Makefile + $(CXX) -c $(CXXFLAGS) $(srcdir)/gc_cpp.cc + + test_cpp: $(srcdir)/tests/test_cpp.cc $(srcdir)/include/gc_cpp.h gc_cpp.o $(srcdir)/include/gc.h \ + base_lib $(UTILS) + rm -f test_cpp + ./if_mach HP_PA HPUX $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/tests/test_cpp.cc gc_cpp.o gc.a -ldld `./threadlibs` + ./if_not_there test_cpp $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/tests/test_cpp.cc gc_cpp.o gc.a `./threadlibs` + + c++-t: c++ + ./test_cpp 1 + + c++-nt: c++ + @echo "Use ./test_cpp 1 to test the leak library" + + c++: gc_cpp.o $(srcdir)/include/gc_cpp.h test_cpp + rm -f dont_ar_4 + ./if_mach SPARC SUNOS5 touch dont_ar_4 + ./if_mach SPARC SUNOS5 $(AR) rus gc.a gc_cpp.o + ./if_mach M68K AMIGA touch dont_ar_4 + ./if_mach M68K AMIGA $(AR) -vrus gc.a gc_cpp.o + ./if_not_there dont_ar_4 $(AR) ru gc.a gc_cpp.o + ./if_not_there dont_ar_4 $(RANLIB) gc.a || cat /dev/null + ./test_cpp 1 + echo > c++ + + dyn_load_sunos53.o: dyn_load.c + $(CC) $(CFLAGS) -DSUNOS53_SHARED_LIB -c $(srcdir)/dyn_load.c -o $@ + + # SunOS5 shared library version of the collector + sunos5gc.so: $(OBJS) dyn_load_sunos53.o + $(CC) -G -o sunos5gc.so $(OBJS) dyn_load_sunos53.o -ldl + ln sunos5gc.so libgc.so + + # Alpha/OSF shared library version of the collector + libalphagc.so: $(OBJS) + ld -shared -o libalphagc.so $(OBJS) dyn_load.o -lc + ln libalphagc.so libgc.so + + # IRIX shared library version of the collector + libirixgc.so: $(OBJS) dyn_load.o + ld -shared $(ABI_FLAG) -o libirixgc.so $(OBJS) dyn_load.o -lc + ln libirixgc.so libgc.so + + # Linux shared library version of the collector + liblinuxgc.so: $(OBJS) dyn_load.o + gcc -shared -o liblinuxgc.so $(OBJS) dyn_load.o + ln liblinuxgc.so libgc.so + + # Alternative Linux rule. This is preferable, but is likely to break the + # Makefile for some non-linux platforms. + # LIBOBJS= $(patsubst %.o, %.lo, $(OBJS)) + # + #.SUFFIXES: .lo $(SUFFIXES) + # + #.c.lo: + # $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c $< -o $@ + # + # liblinuxgc.so: $(LIBOBJS) dyn_load.lo + # gcc -shared -Wl,-soname=libgc.so.0 -o libgc.so.0 $(LIBOBJS) dyn_load.lo + # touch liblinuxgc.so + + mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/mips_sgi_mach_dep.s $(srcdir)/mips_ultrix_mach_dep.s \ + $(srcdir)/rs6000_mach_dep.s $(srcdir)/powerpc_macosx_mach_dep.s $(UTILS) + rm -f mach_dep.o + ./if_mach MIPS IRIX5 $(AS) -o mach_dep.o $(srcdir)/mips_sgi_mach_dep.s + ./if_mach MIPS RISCOS $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s + ./if_mach MIPS ULTRIX $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s + ./if_mach RS6000 "" $(AS) -o mach_dep.o $(srcdir)/rs6000_mach_dep.s + ./if_mach POWERPC MACOSX $(AS) -o mach_dep.o $(srcdir)/powerpc_macosx_mach_dep.s + # ./if_mach ALPHA "" $(AS) -o mach_dep.o $(srcdir)/alpha_mach_dep.s + # alpha_mach_dep.s assumes that pointers are not saved in fp registers. + # Gcc on a 21264 can spill pointers to fp registers. Oops. + ./if_mach SPARC SUNOS5 $(CC) -c -o mach_dep.o $(srcdir)/sparc_mach_dep.S + ./if_mach SPARC SUNOS4 $(AS) -o mach_dep.o $(srcdir)/sparc_sunos4_mach_dep.s + ./if_mach SPARC OPENBSD $(AS) -o mach_dep.o $(srcdir)/sparc_sunos4_mach_dep.s + ./if_mach SPARC NETBSD $(AS) -o mach_dep.o $(srcdir)/sparc_netbsd_mach_dep.s + ./if_mach IA64 "" as $(AS_ABI_FLAG) -o ia64_save_regs_in_stack.o $(srcdir)/ia64_save_regs_in_stack.s + ./if_mach IA64 "" $(CC) -c -o mach_dep1.o $(SPECIALCFLAGS) $(srcdir)/mach_dep.c + ./if_mach IA64 "" ld -r -o mach_dep.o mach_dep1.o ia64_save_regs_in_stack.o + ./if_not_there mach_dep.o $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c + + mark_rts.o: $(srcdir)/mark_rts.c $(UTILS) + rm -f mark_rts.o + -./if_mach ALPHA OSF1 $(CC) -c $(CFLAGS) -Wo,-notail $(srcdir)/mark_rts.c + ./if_not_there mark_rts.o $(CC) -c $(CFLAGS) $(srcdir)/mark_rts.c + # Work-around for DEC optimizer tail recursion elimination bug. + # The ALPHA-specific line should be removed if gcc is used. + + alloc.o: version.h + + cord: + mkdir cord + + cord/cordbscs.o: cord $(srcdir)/cord/cordbscs.c $(CORD_INCLUDE_FILES) + $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordbscs.c + mv cordbscs.o cord/cordbscs.o + # not all compilers understand -o filename + + cord/cordxtra.o: cord $(srcdir)/cord/cordxtra.c $(CORD_INCLUDE_FILES) + $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordxtra.c + mv cordxtra.o cord/cordxtra.o + + cord/cordprnt.o: cord $(srcdir)/cord/cordprnt.c $(CORD_INCLUDE_FILES) + $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordprnt.c + mv cordprnt.o cord/cordprnt.o + + cord/cordtest: $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a $(UTILS) + rm -f cord/cordtest + ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a -lucb + ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a -ldld `./threadlibs` + ./if_mach M68K AMIGA $(CC) $(CFLAGS) -UGC_AMIGA_MAKINGLIB -o cord/cordtest $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a `./threadlibs` + ./if_not_there cord/cordtest $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a `./threadlibs` + + cord/de: $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(UTILS) + rm -f cord/de + ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) -lucb `./threadlibs` + ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) -ldld `./threadlibs` + ./if_mach RS6000 "" $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses + ./if_mach POWERPC MACOSX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a + ./if_mach I386 LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs` + ./if_mach ALPHA LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs` + ./if_mach IA64 LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs` + ./if_mach M68K AMIGA $(CC) $(CFLAGS) -UGC_AMIGA_MAKINGLIB -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses + ./if_not_there cord/de $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) `./threadlibs` + + if_mach: $(srcdir)/if_mach.c $(srcdir)/include/private/gcconfig.h + $(HOSTCC) $(HOSTCFLAGS) -o if_mach $(srcdir)/if_mach.c + + threadlibs: $(srcdir)/threadlibs.c $(srcdir)/include/private/gcconfig.h Makefile + $(HOSTCC) $(HOSTCFLAGS) -o threadlibs $(srcdir)/threadlibs.c + + if_not_there: $(srcdir)/if_not_there.c + $(HOSTCC) $(HOSTCFLAGS) -o if_not_there $(srcdir)/if_not_there.c + + clean: + rm -f gc.a *.o *.exe tests/*.o gctest gctest_dyn_link test_cpp \ + setjmp_test mon.out gmon.out a.out core if_not_there if_mach \ + threadlibs $(CORD_OBJS) cord/cordtest cord/de + -rm -f *~ + + gctest: tests/test.o gc.a $(UTILS) + rm -f gctest + ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o gctest tests/test.o gc.a -lucb + ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o gctest tests/test.o gc.a -ldld `./threadlibs` + ./if_mach M68K AMIGA $(CC) $(CFLAGS) -UGC_AMIGA_MAKINGLIB -o gctest tests/test.o gc.a `./threadlibs` + ./if_not_there gctest $(CC) $(CFLAGS) -o gctest tests/test.o gc.a `./threadlibs` + + # If an optimized setjmp_test generates a segmentation fault, + # odds are your compiler is broken. Gctest may still work. + # Try compiling setjmp_t.c unoptimized. + setjmp_test: $(srcdir)/setjmp_t.c $(srcdir)/include/gc.h $(UTILS) + $(CC) $(CFLAGS) -o setjmp_test $(srcdir)/setjmp_t.c + + test: KandRtest cord/cordtest + cord/cordtest + + # Those tests that work even with a K&R C compiler: + KandRtest: setjmp_test gctest + ./setjmp_test + ./gctest + + add_gc_prefix: $(srcdir)/add_gc_prefix.c $(srcdir)/version.h + $(CC) -o add_gc_prefix $(srcdir)/add_gc_prefix.c + + gcname: $(srcdir)/gcname.c $(srcdir)/version.h + $(CC) -o gcname $(srcdir)/gcname.c + + gc.tar: $(SRCS) $(DOC_FILES) $(OTHER_FILES) add_gc_prefix gcname + cp Makefile Makefile.old + cp Makefile.direct Makefile + rm -f `./gcname` + ln -s . `./gcname` + ./add_gc_prefix $(SRCS) $(DOC_FILES) $(OTHER_FILES) > /tmp/gc.tar-files + tar cvfh gc.tar `cat /tmp/gc.tar-files` + cp gc.tar `./gcname`.tar + gzip `./gcname`.tar + rm `./gcname` + + pc_gc.tar: $(SRCS) $(OTHER_FILES) + tar cvfX pc_gc.tar pc_excludes $(SRCS) $(OTHER_FILES) + + floppy: pc_gc.tar + -mmd a:/cord + -mmd a:/cord/private + -mmd a:/include + -mmd a:/include/private + mkdir /tmp/pc_gc + cat pc_gc.tar | (cd /tmp/pc_gc; tar xvf -) + -mcopy -tmn /tmp/pc_gc/* a: + -mcopy -tmn /tmp/pc_gc/cord/* a:/cord + -mcopy -mn /tmp/pc_gc/cord/de_win.ICO a:/cord + -mcopy -tmn /tmp/pc_gc/cord/private/* a:/cord/private + -mcopy -tmn /tmp/pc_gc/include/* a:/include + -mcopy -tmn /tmp/pc_gc/include/private/* a:/include/private + rm -r /tmp/pc_gc + + gc.tar.Z: gc.tar + compress gc.tar + + gc.tar.gz: gc.tar + gzip gc.tar + + lint: $(CSRCS) tests/test.c + lint -DLINT $(CSRCS) tests/test.c | egrep -v "possible pointer alignment problem|abort|exit|sbrk|mprotect|syscall|change in ANSI|improper alignment" + + # BTL: added to test shared library version of collector. + # Currently works only under SunOS5. Requires GC_INIT call from statically + # loaded client code. + ABSDIR = `pwd` + gctest_dyn_link: tests/test.o libgc.so + $(CC) -L$(ABSDIR) -R$(ABSDIR) -o gctest_dyn_link tests/test.o -lgc -ldl -lthread + + gctest_irix_dyn_link: tests/test.o libirixgc.so + $(CC) -L$(ABSDIR) -o gctest_irix_dyn_link tests/test.o -lirixgc + + # The following appear to be dead, especially since libgc_globals.h + # is apparently lost. + test_dll.o: tests/test.c libgc_globals.h + $(CC) $(CFLAGS) -DGC_USE_DLL -c tests/test.c -o test_dll.o + + test_dll: test_dll.o libgc_dll.a libgc.dll + $(CC) test_dll.o -L$(ABSDIR) -lgc_dll -o test_dll + + SYM_PREFIX-libgc=GC + + # Uncomment the following line to build a GNU win32 DLL + # include Makefile.DLLs + + reserved_namespace: $(SRCS) + for file in $(SRCS) tests/test.c tests/test_cpp.cc; do \ + sed s/GC_/_GC_/g < $$file > tmp; \ + cp tmp $$file; \ + done + + user_namespace: $(SRCS) + for file in $(SRCS) tests/test.c tests/test_cpp.cc; do \ + sed s/_GC_/GC_/g < $$file > tmp; \ + cp tmp $$file; \ + done diff -Nrc3pad gcc-3.0.4/boehm-gc/Makefile.dist gcc-3.1/boehm-gc/Makefile.dist *** gcc-3.0.4/boehm-gc/Makefile.dist Fri Dec 15 08:13:12 2000 --- gcc-3.1/boehm-gc/Makefile.dist Fri Aug 17 18:30:44 2001 *************** *** 1,6 **** # Primary targets: # gc.a - builds basic library - # libgc.a - builds library for use with g++ "-fgc-keyword" extension # c++ - adds C++ interface to library # cords - adds cords (heavyweight strings) to library # test - prints porting information, then builds basic version of gc.a, --- 1,8 ---- + # This is the original manually generated Makefile. It may stil be used + # to build the collector. + # # Primary targets: # gc.a - builds basic library # c++ - adds C++ interface to library # cords - adds cords (heavyweight strings) to library # test - prints porting information, then builds basic version of gc.a, *************** *** 9,15 **** # cord/de - builds dumb editor based on cords. ABI_FLAG= CC=cc $(ABI_FLAG) - HOSTCC=$(CC) CXX=g++ $(ABI_FLAG) AS=as $(ABI_FLAG) # The above doesn't work with gas, which doesn't run cpp. --- 11,16 ---- *************** AS=as $(ABI_FLAG) *** 17,55 **** # Under Irix 6, you will have to specify the ABI (-o32, -n32, or -64) # if you use something other than the default ABI on your machine. ! CFLAGS= -O -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DNO_EXECUTE_PERMISSION -DALL_INTERIOR_POINTERS -DSILENT # For dynamic library builds, it may be necessary to add flags to generate # PIC code, e.g. -fPIC on Linux. # Setjmp_test may yield overly optimistic results when compiled # without optimization. # -DSILENT disables statistics printing, and improves performance. # -DFIND_LEAK causes GC_find_leak to be initially set. # This causes the collector to assume that all inaccessible # objects should have been explicitly deallocated, and reports exceptions. # Finalization and the test program are not usable in this mode. ! # -DSOLARIS_THREADS enables support for Solaris (thr_) threads. ! # (Clients should also define SOLARIS_THREADS and then include # gc.h before performing thr_ or dl* or GC_ operations.) # Must also define -D_REENTRANT. ! # -D_SOLARIS_PTHREADS enables support for Solaris pthreads. # Define SOLARIS_THREADS as well. ! # -DIRIX_THREADS enables support for Irix pthreads. See README.irix. ! # -DHPUX_THREADS enables support for HP/UX 11 pthreads. ! # Also requires -D_REENTRANT. See README.hp. ! # -DLINUX_THREADS enables support for Xavier Leroy's Linux threads. # see README.linux. -D_REENTRANT may also be required. # -DALL_INTERIOR_POINTERS allows all pointers to the interior # of objects to be recognized. (See gc_priv.h for consequences.) # -DSMALL_CONFIG tries to tune the collector for small heap sizes, # usually causing it to use less space in such situations. # Incremental collection no longer works in this case. # -DLARGE_CONFIG tunes the collector for unusually large heaps. # Necessary for heaps larger than about 500 MB on most machines. # Recommended for heaps larger than about 64 MB. ! # -DDONT_ADD_BYTE_AT_END is meaningful only with ! # -DALL_INTERIOR_POINTERS. Normally -DALL_INTERIOR_POINTERS # causes all objects to be padded so that pointers just past the end of # an object can be recognized. This can be expensive. (The padding # is normally more than one byte due to alignment constraints.) --- 18,77 ---- # Under Irix 6, you will have to specify the ABI (-o32, -n32, or -64) # if you use something other than the default ABI on your machine. ! # Redefining srcdir allows object code for the nonPCR version of the collector ! # to be generated in different directories. ! srcdir= . ! VPATH= $(srcdir) ! ! CFLAGS= -O -I$(srcdir)/include -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DNO_EXECUTE_PERMISSION -DSILENT -DALL_INTERIOR_POINTERS ! ! # To build the parallel collector on Linux, add to the above: ! # -DGC_LINUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC ! # To build the parallel collector n a static library on HP/UX, add to the above: ! # -DGC_HPUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC -DUSE_HPUX_TLS -D_POSIX_C_SOURCE=199506L ! ! # HOSTCC and HOSTCFLAGS are used to build executables that will be run as ! # part of the build process, i.e. on the build machine. These will usually ! # be the same as CC and CFLAGS, except in a cross-compilation environment. ! # Note that HOSTCFLAGS should include any -D flags that affect thread support. ! HOSTCC=$(CC) ! HOSTCFLAGS=$(CFLAGS) # For dynamic library builds, it may be necessary to add flags to generate # PIC code, e.g. -fPIC on Linux. # Setjmp_test may yield overly optimistic results when compiled # without optimization. + + # These define arguments influence the collector configuration: # -DSILENT disables statistics printing, and improves performance. # -DFIND_LEAK causes GC_find_leak to be initially set. # This causes the collector to assume that all inaccessible # objects should have been explicitly deallocated, and reports exceptions. # Finalization and the test program are not usable in this mode. ! # -DGC_SOLARIS_THREADS enables support for Solaris (thr_) threads. ! # (Clients should also define GC_SOLARIS_THREADS and then include # gc.h before performing thr_ or dl* or GC_ operations.) # Must also define -D_REENTRANT. ! # -DGC_SOLARIS_PTHREADS enables support for Solaris pthreads. # Define SOLARIS_THREADS as well. ! # -DGC_IRIX_THREADS enables support for Irix pthreads. See README.irix. ! # -DGC_HPUX_THREADS enables support for HP/UX 11 pthreads. ! # Also requires -D_REENTRANT or -D_POSIX_C_SOURCE=199506L. See README.hp. ! # -DGC_LINUX_THREADS enables support for Xavier Leroy's Linux threads. # see README.linux. -D_REENTRANT may also be required. # -DALL_INTERIOR_POINTERS allows all pointers to the interior # of objects to be recognized. (See gc_priv.h for consequences.) + # Alternatively, GC_all_interior_pointers can be set at process + # initialization time. # -DSMALL_CONFIG tries to tune the collector for small heap sizes, # usually causing it to use less space in such situations. # Incremental collection no longer works in this case. # -DLARGE_CONFIG tunes the collector for unusually large heaps. # Necessary for heaps larger than about 500 MB on most machines. # Recommended for heaps larger than about 64 MB. ! # -DDONT_ADD_BYTE_AT_END is meaningful only with -DALL_INTERIOR_POINTERS or ! # GC_all_interior_pointers = 1. Normally -DALL_INTERIOR_POINTERS # causes all objects to be padded so that pointers just past the end of # an object can be recognized. This can be expensive. (The padding # is normally more than one byte due to alignment constraints.) *************** CFLAGS= -O -DATOMIC_UNCOLLECTABLE -DNO_S *** 73,84 **** # -DREDIRECT_MALLOC=X causes malloc, realloc, and free to be defined # as aliases for X, GC_realloc, and GC_free, respectively. # Calloc is redefined in terms of the new malloc. X should ! # be either GC_malloc or GC_malloc_uncollectable. # The former is occasionally useful for working around leaks in code # you don't want to (or can't) look at. It may not work for # existing code, but it often does. Neither works on all platforms, # since some ports use malloc or calloc to obtain system memory. # (Probably works for UNIX, and win32.) # -DIGNORE_FREE turns calls to free into a noop. Only useful with # -DREDIRECT_MALLOC. # -DNO_DEBUGGING removes GC_dump and the debugging routines it calls. --- 95,113 ---- # -DREDIRECT_MALLOC=X causes malloc, realloc, and free to be defined # as aliases for X, GC_realloc, and GC_free, respectively. # Calloc is redefined in terms of the new malloc. X should ! # be either GC_malloc or GC_malloc_uncollectable, or ! # GC_debug_malloc_replacement. (The latter invokes GC_debug_malloc ! # with dummy source location information, but still results in ! # properly remembered call stacks on Linux/X86 and Solaris/SPARC.) # The former is occasionally useful for working around leaks in code # you don't want to (or can't) look at. It may not work for # existing code, but it often does. Neither works on all platforms, # since some ports use malloc or calloc to obtain system memory. # (Probably works for UNIX, and win32.) + # -DREDIRECT_REALLOC=X causes GC_realloc to be redirected to X. + # The canonical use is -DREDIRECT_REALLOC=GC_debug_realloc_replacement, + # together with -DREDIRECT_MALLOC=GC_debug_malloc_replacement to + # generate leak reports with call stacks for both malloc and realloc. # -DIGNORE_FREE turns calls to free into a noop. Only useful with # -DREDIRECT_MALLOC. # -DNO_DEBUGGING removes GC_dump and the debugging routines it calls. *************** CFLAGS= -O -DATOMIC_UNCOLLECTABLE -DNO_S *** 119,131 **** # for objects allocated with the debugging allocator. If all objects # through GC_MALLOC with GC_DEBUG defined, this allows the client # to determine how particular or randomly chosen objects are reachable ! # for debugging/profiling purposes. The backptr.h interface is # implemented only if this is defined. # -DGC_ASSERTIONS Enable some internal GC assertion checking. Currently # this facility is only used in a few places. It is intended primarily # for debugging of the garbage collector itself, but could also # occasionally be useful for debugging of client code. Slows down the # collector somewhat, but not drastically. # -DCHECKSUMS reports on erroneously clear dirty bits, and unexpectedly # altered stubborn objects, at substantial performance cost. # Use only for debugging of the incremental collector. --- 148,179 ---- # for objects allocated with the debugging allocator. If all objects # through GC_MALLOC with GC_DEBUG defined, this allows the client # to determine how particular or randomly chosen objects are reachable ! # for debugging/profiling purposes. The gc_backptr.h interface is # implemented only if this is defined. # -DGC_ASSERTIONS Enable some internal GC assertion checking. Currently # this facility is only used in a few places. It is intended primarily # for debugging of the garbage collector itself, but could also + # -DDBG_HDRS_ALL Make sure that all objects have debug headers. Increases + # the reliability (from 99.9999% to 100%) of some of the debugging + # code (especially KEEP_BACK_PTRS). Makes -DSHORT_DBG_HDRS possible. + # Assumes that all client allocation is done through debugging + # allocators. + # -DSHORT_DBG_HDRS Assume that all objects have debug headers. Shorten + # the headers to minimize object size, at the expense of checking for + # writes past the end of an object. This is intended for environments + # in which most client code is written in a "safe" language, such as + # Scheme or Java. Assumes that all client allocation is done using + # the GC_debug_ functions, or through the macros that expand to these, + # or by redirecting malloc to GC_debug_malloc_replacement. + # (Also eliminates the field for the requested object size.) # occasionally be useful for debugging of client code. Slows down the # collector somewhat, but not drastically. + # -DSAVE_CALL_COUNT= Set the number of call frames saved with objects + # allocated through the debugging interface. Affects the amount of + # information generated in leak reports. Only matters on platforms + # on which we can quickly generate call stacks, currently Linux/(X86 & SPARC) + # and Solaris/SPARC. Turns on call chain saving on X86. On X86, client + # code should NOT be compiled with -fomit-frame-pointer. # -DCHECKSUMS reports on erroneously clear dirty bits, and unexpectedly # altered stubborn objects, at substantial performance cost. # Use only for debugging of the incremental collector. *************** CFLAGS= -O -DATOMIC_UNCOLLECTABLE -DNO_S *** 143,208 **** # -DUSE_3DNOW_PREFETCH causes the collector to issue AMD 3DNow style # prefetch instructions. Same restrictions as USE_I686_PREFETCH. # UNTESTED!! ! # -DUSE_LD_WRAP in combination with the gld flags listed in README.linux # causes the collector some system and pthread calls in a more transparent # fashion than the usual macro-based approach. Requires GNU ld, and # currently probably works only with Linux. # - - LIBGC_CFLAGS= -O -DNO_SIGNALS -DSILENT \ - -DREDIRECT_MALLOC=GC_malloc_uncollectable \ - -DDONT_ADD_BYTE_AT_END -DALL_INTERIOR_POINTERS - # Flags for building libgc.a -- the last two are required. - CXXFLAGS= $(CFLAGS) AR= ar RANLIB= ranlib ! # Redefining srcdir allows object code for the nonPCR version of the collector ! # to be generated in different directories. In this case, the destination directory ! # should contain a copy of the original include directory. ! srcdir = . ! VPATH = $(srcdir) ! ! OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o headers.o mark.o obj_map.o blacklst.o finalize.o new_hblk.o dbg_mlc.o malloc.o stubborn.o checksums.o solaris_threads.o hpux_irix_threads.o linux_threads.o typd_mlc.o ptr_chck.o mallocx.o solaris_pthreads.o gcj_mlc.o ! CSRCS= reclaim.c allchblk.c misc.c alloc.c mach_dep.c os_dep.c mark_rts.c headers.c mark.c obj_map.c pcr_interface.c blacklst.c finalize.c new_hblk.c real_malloc.c dyn_load.c dbg_mlc.c malloc.c stubborn.c checksums.c solaris_threads.c hpux_irix_threads.c linux_threads.c typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c gcj_mlc.c ! CORD_SRCS= cord/cordbscs.c cord/cordxtra.c cord/cordprnt.c cord/de.c cord/cordtest.c cord/cord.h cord/ec.h cord/private/cord_pos.h cord/de_win.c cord/de_win.h cord/de_cmds.h cord/de_win.ICO cord/de_win.RC cord/SCOPTIONS.amiga cord/SMakefile.amiga CORD_OBJS= cord/cordbscs.o cord/cordxtra.o cord/cordprnt.o SRCS= $(CSRCS) mips_sgi_mach_dep.s rs6000_mach_dep.s alpha_mach_dep.s \ ! sparc_mach_dep.s gc.h gc_typed.h gc_hdrs.h gc_priv.h gc_private.h \ ! gcconfig.h gc_mark.h include/gc_inl.h include/gc_inline.h gc.man \ ! threadlibs.c if_mach.c if_not_there.c gc_cpp.cc gc_cpp.h weakpointer.h \ ! gcc_support.c mips_ultrix_mach_dep.s include/gc_alloc.h gc_alloc.h \ include/new_gc_alloc.h include/javaxfc.h sparc_sunos4_mach_dep.s \ ! solaris_threads.h backptr.h hpux_test_and_clear.s include/gc_gcj.h \ ! dbg_mlc.h $(CORD_SRCS) OTHER_FILES= Makefile PCR-Makefile OS2_MAKEFILE NT_MAKEFILE BCC_MAKEFILE \ ! README test.c test_cpp.cc setjmp_t.c SMakefile.amiga \ ! SCoptions.amiga README.amiga README.win32 cord/README \ ! cord/gc.h include/gc.h include/gc_typed.h include/cord.h \ ! include/ec.h include/private/cord_pos.h include/private/gcconfig.h \ ! include/private/gc_hdrs.h include/private/gc_priv.h \ ! include/gc_cpp.h README.rs6000 include/backptr.h \ ! include/weakpointer.h README.QUICK callprocs pc_excludes \ ! barrett_diagram README.OS2 README.Mac MacProjects.sit.hqx \ ! MacOS.c EMX_MAKEFILE makefile.depend README.debugging \ ! include/gc_cpp.h Mac_files/datastart.c Mac_files/dataend.c \ Mac_files/MacOS_config.h Mac_files/MacOS_Test_config.h \ ! add_gc_prefix.c README.solaris2 README.sgi README.hp README.uts \ ! win32_threads.c NT_THREADS_MAKEFILE gc.mak README.dj Makefile.dj \ ! README.alpha README.linux version.h Makefile.DLLs \ ! WCC_MAKEFILE nursery.c include/gc_nursery.h include/gc_copy_descr.h \ ! include/leak_detector.h ! CORD_INCLUDE_FILES= $(srcdir)/gc.h $(srcdir)/cord/cord.h $(srcdir)/cord/ec.h \ ! $(srcdir)/cord/private/cord_pos.h UTILS= if_mach if_not_there threadlibs --- 191,270 ---- # -DUSE_3DNOW_PREFETCH causes the collector to issue AMD 3DNow style # prefetch instructions. Same restrictions as USE_I686_PREFETCH. # UNTESTED!! ! # -DGC_USE_LD_WRAP in combination with the gld flags listed in README.linux # causes the collector some system and pthread calls in a more transparent # fashion than the usual macro-based approach. Requires GNU ld, and # currently probably works only with Linux. + # -DTHREAD_LOCAL_ALLOC defines GC_local_malloc(), GC_local_malloc_atomic() + # and GC_local_gcj_malloc(). Needed for gc_gcj.h interface. These allocate + # in a way that usually does not involve acquisition of a global lock. + # Currently requires -DGC_LINUX_THREADS, but should be easy to port to + # other pthreads environments. Recommended for multiprocessors. + # -DPARALLEL_MARK allows the marker to run in multiple threads. Recommended + # for multiprocessors. Currently requires Linux on X86 or IA64, though + # support for other Posix platforms should be fairly easy to add, + # if the thread implementation is otherwise supported. + # -DNO_GETENV prevents the collector from looking at environment variables. + # These may otherwise alter its configuration, or turn off GC altogether. + # I don't know of a reason to disable this, except possibly if the + # resulting process runs as a privileged user? + # -DSTUBBORN_ALLOC allows allocation of "hard to change" objects, and thus + # makes incremental collection easier. Was enabled by default until 6.0. + # Rarely used, to my knowledge. # CXXFLAGS= $(CFLAGS) AR= ar RANLIB= ranlib ! OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o headers.o mark.o obj_map.o blacklst.o finalize.o new_hblk.o dbg_mlc.o malloc.o stubborn.o checksums.o solaris_threads.o irix_threads.o linux_threads.o typd_mlc.o ptr_chck.o mallocx.o solaris_pthreads.o gcj_mlc.o specific.o gc_dlopen.o ! CSRCS= reclaim.c allchblk.c misc.c alloc.c mach_dep.c os_dep.c mark_rts.c headers.c mark.c obj_map.c pcr_interface.c blacklst.c finalize.c new_hblk.c real_malloc.c dyn_load.c dbg_mlc.c malloc.c stubborn.c checksums.c solaris_threads.c irix_threads.c linux_threads.c typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c gcj_mlc.c specific.c gc_dlopen.c ! CORD_SRCS= cord/cordbscs.c cord/cordxtra.c cord/cordprnt.c cord/de.c cord/cordtest.c include/cord.h include/ec.h include/private/cord_pos.h cord/de_win.c cord/de_win.h cord/de_cmds.h cord/de_win.ICO cord/de_win.RC CORD_OBJS= cord/cordbscs.o cord/cordxtra.o cord/cordprnt.o SRCS= $(CSRCS) mips_sgi_mach_dep.s rs6000_mach_dep.s alpha_mach_dep.s \ ! sparc_mach_dep.s include/gc.h include/gc_typed.h \ ! include/private/gc_hdrs.h include/private/gc_priv.h \ ! include/private/gcconfig.h include/private/gc_pmark.h \ ! include/gc_inl.h include/gc_inline.h include/gc_mark.h \ ! threadlibs.c if_mach.c if_not_there.c gc_cpp.cc include/gc_cpp.h \ ! include/weakpointer.h include/private/gc_locks.h \ ! gcc_support.c mips_ultrix_mach_dep.s include/gc_alloc.h \ include/new_gc_alloc.h include/javaxfc.h sparc_sunos4_mach_dep.s \ ! sparc_netbsd_mach_dep.s \ ! include/private/solaris_threads.h include/gc_backptr.h \ ! hpux_test_and_clear.s include/gc_gcj.h \ ! include/gc_local_alloc.h include/private/dbg_mlc.h \ ! include/private/specific.h powerpc_macosx_mach_dep.s \ ! include/leak_detector.h include/gc_amiga_redirects.h \ ! include/gc_pthread_redirects.h $(CORD_SRCS) + DOC_FILES= README.QUICK doc/README.Mac doc/README.MacOSX doc/README.OS2 \ + doc/README.amiga doc/README.cords doc/README.debugging \ + doc/README.dj doc/README.hp doc/README.linux doc/README.rs6000 \ + doc/README.sgi doc/README.solaris2 doc/README.uts \ + doc/README.win32 doc/barrett_diagram doc/README \ + doc/README.contributors doc/README.changes doc/gc.man \ + doc/README.environment + + TESTS= tests/test.c tests/test_cpp.cc tests/trace_test.c \ + tests/leak_test.c tests/thread_leak_test.c OTHER_FILES= Makefile PCR-Makefile OS2_MAKEFILE NT_MAKEFILE BCC_MAKEFILE \ ! setjmp_t.c SMakefile.amiga configure.in Makefile.am \ ! callprocs pc_excludes \ ! MacProjects.sit.hqx MacOS.c EMX_MAKEFILE \ ! Mac_files/datastart.c Mac_files/dataend.c \ Mac_files/MacOS_config.h Mac_files/MacOS_Test_config.h \ ! add_gc_prefix.c gc_cpp.cpp \ ! win32_threads.c NT_THREADS_MAKEFILE gc.mak Makefile.dj \ ! version.h Makefile.DLLs WCC_MAKEFILE AmigaOS.c $(TESTS) ! CORD_INCLUDE_FILES= $(srcdir)/include/gc.h $(srcdir)/include/cord.h \ ! $(srcdir)/include/ec.h $(srcdir)/include/private/cord_pos.h UTILS= if_mach if_not_there threadlibs *************** CURSES= -lcurses -ltermlib *** 214,220 **** # the SHELL environment variable. SHELL= /bin/sh ! SPECIALCFLAGS = # Alternative flags to the C compiler for mach_dep.c. # Mach_dep.c often doesn't like optimization, and it's # not time-critical anyway. --- 276,282 ---- # the SHELL environment variable. SHELL= /bin/sh ! SPECIALCFLAGS = -I$(srcdir)/include # Alternative flags to the C compiler for mach_dep.c. # Mach_dep.c often doesn't like optimization, and it's # not time-critical anyway. *************** SPECIALCFLAGS = *** 222,238 **** all: gc.a gctest ! pcr: PCR-Makefile gc_private.h gc_hdrs.h gc.h gcconfig.h mach_dep.o $(SRCS) ! make -f PCR-Makefile depend ! make -f PCR-Makefile ! $(OBJS) test.o dyn_load.o dyn_load_sunos53.o: $(srcdir)/gc_priv.h $(srcdir)/gc_hdrs.h $(srcdir)/gc.h \ ! $(srcdir)/gcconfig.h $(srcdir)/gc_typed.h Makefile # The dependency on Makefile is needed. Changing # options such as -DSILENT affects the size of GC_arrays, # invalidating all .o files that rely on gc_priv.h ! mark.o typd_mlc.o finalize.o: $(srcdir)/gc_mark.h base_lib gc.a: $(OBJS) dyn_load.o $(UTILS) echo > base_lib --- 284,330 ---- all: gc.a gctest ! BSD-pkg-all: bsd-libgc.a ! bsd-libgc.a: ! $(MAKE) CFLAGS="$(CFLAGS)" clean c++-t ! mv gc.a bsd-libgc.a ! ! BSD-pkg-install: BSD-pkg-all ! ${CP} bsd-libgc.a libgc.a ! ${INSTALL_DATA} libgc.a ${PREFIX}/lib ! ${INSTALL_DATA} gc.h gc_cpp.h ${PREFIX}/include ! ! pcr: PCR-Makefile include/private/gc_private.h include/private/gc_hdrs.h \ ! include/private/gc_locks.h include/gc.h include/private/gcconfig.h \ ! mach_dep.o $(SRCS) ! $(MAKE) -f PCR-Makefile depend ! $(MAKE) -f PCR-Makefile ! ! $(OBJS) tests/test.o dyn_load.o dyn_load_sunos53.o: \ ! $(srcdir)/include/private/gc_priv.h \ ! $(srcdir)/include/private/gc_hdrs.h $(srcdir)/include/private/gc_locks.h \ ! $(srcdir)/include/gc.h \ ! $(srcdir)/include/private/gcconfig.h $(srcdir)/include/gc_typed.h \ ! Makefile # The dependency on Makefile is needed. Changing # options such as -DSILENT affects the size of GC_arrays, # invalidating all .o files that rely on gc_priv.h ! mark.o typd_mlc.o finalize.o ptr_chck.o: $(srcdir)/include/gc_mark.h $(srcdir)/include/private/gc_pmark.h ! ! specific.o linux_threads.o: $(srcdir)/include/private/specific.h ! ! solaris_threads.o solaris_pthreads.o: $(srcdir)/include/private/solaris_threads.h ! ! dbg_mlc.o gcj_mlc.o: $(srcdir)/include/private/dbg_mlc.h ! ! tests/test.o: tests $(srcdir)/tests/test.c ! $(CC) $(CFLAGS) -c $(srcdir)/tests/test.c ! mv test.o tests/test.o ! ! tests: ! mkdir tests base_lib gc.a: $(OBJS) dyn_load.o $(UTILS) echo > base_lib *************** cords: $(CORD_OBJS) cord/cordtest $(UTIL *** 254,269 **** ./if_not_there dont_ar_3 $(AR) ru gc.a $(CORD_OBJS) ./if_not_there dont_ar_3 $(RANLIB) gc.a || cat /dev/null ! gc_cpp.o: $(srcdir)/gc_cpp.cc $(srcdir)/gc_cpp.h $(srcdir)/gc.h Makefile $(CXX) -c $(CXXFLAGS) $(srcdir)/gc_cpp.cc ! test_cpp: $(srcdir)/test_cpp.cc $(srcdir)/gc_cpp.h gc_cpp.o $(srcdir)/gc.h \ base_lib $(UTILS) rm -f test_cpp ! ./if_mach HP_PA HPUX $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/test_cpp.cc gc_cpp.o gc.a -ldld `./threadlibs` ! ./if_not_there test_cpp $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/test_cpp.cc gc_cpp.o gc.a `./threadlibs` ! c++: gc_cpp.o $(srcdir)/gc_cpp.h test_cpp rm -f dont_ar_4 ./if_mach SPARC SUNOS5 touch dont_ar_4 ./if_mach SPARC SUNOS5 $(AR) rus gc.a gc_cpp.o --- 346,367 ---- ./if_not_there dont_ar_3 $(AR) ru gc.a $(CORD_OBJS) ./if_not_there dont_ar_3 $(RANLIB) gc.a || cat /dev/null ! gc_cpp.o: $(srcdir)/gc_cpp.cc $(srcdir)/include/gc_cpp.h $(srcdir)/include/gc.h Makefile $(CXX) -c $(CXXFLAGS) $(srcdir)/gc_cpp.cc ! test_cpp: $(srcdir)/tests/test_cpp.cc $(srcdir)/include/gc_cpp.h gc_cpp.o $(srcdir)/include/gc.h \ base_lib $(UTILS) rm -f test_cpp ! ./if_mach HP_PA HPUX $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/tests/test_cpp.cc gc_cpp.o gc.a -ldld `./threadlibs` ! ./if_not_there test_cpp $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/tests/test_cpp.cc gc_cpp.o gc.a `./threadlibs` ! c++-t: c++ ! ./test_cpp 1 ! ! c++-nt: c++ ! @echo "Use ./test_cpp 1 to test the leak library" ! ! c++: gc_cpp.o $(srcdir)/include/gc_cpp.h test_cpp rm -f dont_ar_4 ./if_mach SPARC SUNOS5 touch dont_ar_4 ./if_mach SPARC SUNOS5 $(AR) rus gc.a gc_cpp.o *************** libirixgc.so: $(OBJS) dyn_load.o *** 294,300 **** # Linux shared library version of the collector liblinuxgc.so: $(OBJS) dyn_load.o ! gcc -shared -o liblinuxgc.so $(OBJS) dyn_load.o -lo ln liblinuxgc.so libgc.so # Alternative Linux rule. This is preferable, but is likely to break the --- 392,398 ---- # Linux shared library version of the collector liblinuxgc.so: $(OBJS) dyn_load.o ! gcc -shared -o liblinuxgc.so $(OBJS) dyn_load.o ln liblinuxgc.so libgc.so # Alternative Linux rule. This is preferable, but is likely to break the *************** liblinuxgc.so: $(OBJS) dyn_load.o *** 310,330 **** # gcc -shared -Wl,-soname=libgc.so.0 -o libgc.so.0 $(LIBOBJS) dyn_load.lo # touch liblinuxgc.so ! mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/mips_sgi_mach_dep.s $(srcdir)/mips_ultrix_mach_dep.s $(srcdir)/rs6000_mach_dep.s $(UTILS) rm -f mach_dep.o ./if_mach MIPS IRIX5 $(AS) -o mach_dep.o $(srcdir)/mips_sgi_mach_dep.s ./if_mach MIPS RISCOS $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s ./if_mach MIPS ULTRIX $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s ./if_mach RS6000 "" $(AS) -o mach_dep.o $(srcdir)/rs6000_mach_dep.s # ./if_mach ALPHA "" $(AS) -o mach_dep.o $(srcdir)/alpha_mach_dep.s # alpha_mach_dep.s assumes that pointers are not saved in fp registers. # Gcc on a 21264 can spill pointers to fp registers. Oops. ./if_mach SPARC SUNOS5 $(AS) -o mach_dep.o $(srcdir)/sparc_mach_dep.s ./if_mach SPARC SUNOS4 $(AS) -o mach_dep.o $(srcdir)/sparc_sunos4_mach_dep.s ./if_mach SPARC OPENBSD $(AS) -o mach_dep.o $(srcdir)/sparc_sunos4_mach_dep.s ! ./if_mach HP_PA HPUX $(AS) -o hpux_test_and_clear.o $(srcdir)/hpux_test_and_clear.s ! ./if_mach HP_PA HPUX $(CC) -c -o md_tmp.o $(SPECIALCFLAGS) $(srcdir)/mach_dep.c ! ./if_mach HP_PA HPUX ld -r -o mach_dep.o md_tmp.o hpux_test_and_clear.o ./if_not_there mach_dep.o $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c mark_rts.o: $(srcdir)/mark_rts.c $(UTILS) --- 408,428 ---- # gcc -shared -Wl,-soname=libgc.so.0 -o libgc.so.0 $(LIBOBJS) dyn_load.lo # touch liblinuxgc.so ! mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/mips_sgi_mach_dep.s $(srcdir)/mips_ultrix_mach_dep.s \ ! $(srcdir)/rs6000_mach_dep.s $(srcdir)/powerpc_macosx_mach_dep.s $(UTILS) rm -f mach_dep.o ./if_mach MIPS IRIX5 $(AS) -o mach_dep.o $(srcdir)/mips_sgi_mach_dep.s ./if_mach MIPS RISCOS $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s ./if_mach MIPS ULTRIX $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s ./if_mach RS6000 "" $(AS) -o mach_dep.o $(srcdir)/rs6000_mach_dep.s + ./if_mach POWERPC MACOSX $(AS) -o mach_dep.o $(srcdir)/powerpc_macosx_mach_dep.s # ./if_mach ALPHA "" $(AS) -o mach_dep.o $(srcdir)/alpha_mach_dep.s # alpha_mach_dep.s assumes that pointers are not saved in fp registers. # Gcc on a 21264 can spill pointers to fp registers. Oops. ./if_mach SPARC SUNOS5 $(AS) -o mach_dep.o $(srcdir)/sparc_mach_dep.s ./if_mach SPARC SUNOS4 $(AS) -o mach_dep.o $(srcdir)/sparc_sunos4_mach_dep.s ./if_mach SPARC OPENBSD $(AS) -o mach_dep.o $(srcdir)/sparc_sunos4_mach_dep.s ! ./if_mach SPARC NETBSD $(AS) -o mach_dep.o $(srcdir)/sparc_netbsd_mach_dep.s ./if_not_there mach_dep.o $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c mark_rts.o: $(srcdir)/mark_rts.c $(UTILS) *************** mark_rts.o: $(srcdir)/mark_rts.c $(UTILS *** 336,351 **** alloc.o: version.h ! cord/cordbscs.o: $(srcdir)/cord/cordbscs.c $(CORD_INCLUDE_FILES) $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordbscs.c mv cordbscs.o cord/cordbscs.o # not all compilers understand -o filename ! cord/cordxtra.o: $(srcdir)/cord/cordxtra.c $(CORD_INCLUDE_FILES) $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordxtra.c mv cordxtra.o cord/cordxtra.o ! cord/cordprnt.o: $(srcdir)/cord/cordprnt.c $(CORD_INCLUDE_FILES) $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordprnt.c mv cordprnt.o cord/cordprnt.o --- 434,452 ---- alloc.o: version.h ! cord: ! mkdir cord ! ! cord/cordbscs.o: cord $(srcdir)/cord/cordbscs.c $(CORD_INCLUDE_FILES) $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordbscs.c mv cordbscs.o cord/cordbscs.o # not all compilers understand -o filename ! cord/cordxtra.o: cord $(srcdir)/cord/cordxtra.c $(CORD_INCLUDE_FILES) $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordxtra.c mv cordxtra.o cord/cordxtra.o ! cord/cordprnt.o: cord $(srcdir)/cord/cordprnt.c $(CORD_INCLUDE_FILES) $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordprnt.c mv cordprnt.o cord/cordprnt.o *************** cord/cordtest: $(srcdir)/cord/cordtest.c *** 353,358 **** --- 454,460 ---- rm -f cord/cordtest ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a -lucb ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a -ldld `./threadlibs` + ./if_mach M68K AMIGA $(CC) $(CFLAGS) -UGC_AMIGA_MAKINGLIB -o cord/cordtest $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a `./threadlibs` ./if_not_there cord/cordtest $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a `./threadlibs` cord/de: $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(UTILS) *************** cord/de: $(srcdir)/cord/de.c cord/cordbs *** 360,396 **** ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) -lucb `./threadlibs` ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) -ldld `./threadlibs` ./if_mach RS6000 "" $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses ./if_mach I386 LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs` ./if_mach ALPHA LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs` ./if_mach IA64 LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs` ! ./if_mach M68K AMIGA $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses ./if_not_there cord/de $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) `./threadlibs` ! if_mach: $(srcdir)/if_mach.c $(srcdir)/gcconfig.h ! $(HOSTCC) $(CFLAGS) -o if_mach $(srcdir)/if_mach.c ! threadlibs: $(srcdir)/threadlibs.c $(srcdir)/gcconfig.h Makefile ! $(HOSTCC) $(CFLAGS) -o threadlibs $(srcdir)/threadlibs.c if_not_there: $(srcdir)/if_not_there.c ! $(HOSTCC) $(CFLAGS) -o if_not_there $(srcdir)/if_not_there.c clean: ! rm -f gc.a *.o gctest gctest_dyn_link test_cpp \ setjmp_test mon.out gmon.out a.out core if_not_there if_mach \ threadlibs $(CORD_OBJS) cord/cordtest cord/de -rm -f *~ ! gctest: test.o gc.a $(UTILS) rm -f gctest ! ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o gctest test.o gc.a -lucb ! ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o gctest test.o gc.a -ldld `./threadlibs` ! ./if_not_there gctest $(CC) $(CFLAGS) -o gctest test.o gc.a `./threadlibs` # If an optimized setjmp_test generates a segmentation fault, # odds are your compiler is broken. Gctest may still work. # Try compiling setjmp_t.c unoptimized. ! setjmp_test: $(srcdir)/setjmp_t.c $(srcdir)/gc.h $(UTILS) $(CC) $(CFLAGS) -o setjmp_test $(srcdir)/setjmp_t.c test: KandRtest cord/cordtest --- 462,500 ---- ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) -lucb `./threadlibs` ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) -ldld `./threadlibs` ./if_mach RS6000 "" $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses + ./if_mach POWERPC MACOSX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a ./if_mach I386 LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs` ./if_mach ALPHA LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs` ./if_mach IA64 LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs` ! ./if_mach M68K AMIGA $(CC) $(CFLAGS) -UGC_AMIGA_MAKINGLIB -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses ./if_not_there cord/de $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) `./threadlibs` ! if_mach: $(srcdir)/if_mach.c $(srcdir)/include/private/gcconfig.h ! $(HOSTCC) $(HOSTCFLAGS) -o if_mach $(srcdir)/if_mach.c ! threadlibs: $(srcdir)/threadlibs.c $(srcdir)/include/private/gcconfig.h Makefile ! $(HOSTCC) $(HOSTCFLAGS) -o threadlibs $(srcdir)/threadlibs.c if_not_there: $(srcdir)/if_not_there.c ! $(HOSTCC) $(HOSTCFLAGS) -o if_not_there $(srcdir)/if_not_there.c clean: ! rm -f gc.a *.o *.exe tests/*.o gctest gctest_dyn_link test_cpp \ setjmp_test mon.out gmon.out a.out core if_not_there if_mach \ threadlibs $(CORD_OBJS) cord/cordtest cord/de -rm -f *~ ! gctest: tests/test.o gc.a $(UTILS) rm -f gctest ! ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o gctest tests/test.o gc.a -lucb ! ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o gctest tests/test.o gc.a -ldld `./threadlibs` ! ./if_mach M68K AMIGA $(CC) $(CFLAGS) -UGC_AMIGA_MAKINGLIB -o gctest tests/test.o gc.a `./threadlibs` ! ./if_not_there gctest $(CC) $(CFLAGS) -o gctest tests/test.o gc.a `./threadlibs` # If an optimized setjmp_test generates a segmentation fault, # odds are your compiler is broken. Gctest may still work. # Try compiling setjmp_t.c unoptimized. ! setjmp_test: $(srcdir)/setjmp_t.c $(srcdir)/include/gc.h $(UTILS) $(CC) $(CFLAGS) -o setjmp_test $(srcdir)/setjmp_t.c test: KandRtest cord/cordtest *************** KandRtest: setjmp_test gctest *** 404,411 **** add_gc_prefix: add_gc_prefix.c $(CC) -o add_gc_prefix $(srcdir)/add_gc_prefix.c ! gc.tar: $(SRCS) $(OTHER_FILES) add_gc_prefix ! ./add_gc_prefix $(SRCS) $(OTHER_FILES) > /tmp/gc.tar-files tar cvfh gc.tar `cat /tmp/gc.tar-files` pc_gc.tar: $(SRCS) $(OTHER_FILES) --- 508,515 ---- add_gc_prefix: add_gc_prefix.c $(CC) -o add_gc_prefix $(srcdir)/add_gc_prefix.c ! gc.tar: $(SRCS) $(DOC_FILES) $(OTHER_FILES) add_gc_prefix ! ./add_gc_prefix $(SRCS) $(DOC_FILES) $(OTHER_FILES) > /tmp/gc.tar-files tar cvfh gc.tar `cat /tmp/gc.tar-files` pc_gc.tar: $(SRCS) $(OTHER_FILES) *************** gc.tar.Z: gc.tar *** 432,452 **** gc.tar.gz: gc.tar gzip gc.tar ! lint: $(CSRCS) test.c ! lint -DLINT $(CSRCS) test.c | egrep -v "possible pointer alignment problem|abort|exit|sbrk|mprotect|syscall|change in ANSI|improper alignment" # BTL: added to test shared library version of collector. # Currently works only under SunOS5. Requires GC_INIT call from statically # loaded client code. ABSDIR = `pwd` ! gctest_dyn_link: test.o libgc.so ! $(CC) -L$(ABSDIR) -R$(ABSDIR) -o gctest_dyn_link test.o -lgc -ldl -lthread ! gctest_irix_dyn_link: test.o libirixgc.so ! $(CC) -L$(ABSDIR) -o gctest_irix_dyn_link test.o -lirixgc ! test_dll.o: test.c libgc_globals.h ! $(CC) $(CFLAGS) -DGC_USE_DLL -c test.c -o test_dll.o test_dll: test_dll.o libgc_dll.a libgc.dll $(CC) test_dll.o -L$(ABSDIR) -lgc_dll -o test_dll --- 536,558 ---- gc.tar.gz: gc.tar gzip gc.tar ! lint: $(CSRCS) tests/test.c ! lint -DLINT $(CSRCS) tests/test.c | egrep -v "possible pointer alignment problem|abort|exit|sbrk|mprotect|syscall|change in ANSI|improper alignment" # BTL: added to test shared library version of collector. # Currently works only under SunOS5. Requires GC_INIT call from statically # loaded client code. ABSDIR = `pwd` ! gctest_dyn_link: tests/test.o libgc.so ! $(CC) -L$(ABSDIR) -R$(ABSDIR) -o gctest_dyn_link tests/test.o -lgc -ldl -lthread ! gctest_irix_dyn_link: tests/test.o libirixgc.so ! $(CC) -L$(ABSDIR) -o gctest_irix_dyn_link tests/test.o -lirixgc ! # The following appear to be dead, especially since libgc_globals.h ! # is apparently lost. ! test_dll.o: tests/test.c libgc_globals.h ! $(CC) $(CFLAGS) -DGC_USE_DLL -c tests/test.c -o test_dll.o test_dll: test_dll.o libgc_dll.a libgc.dll $(CC) test_dll.o -L$(ABSDIR) -lgc_dll -o test_dll *************** SYM_PREFIX-libgc=GC *** 457,469 **** # include Makefile.DLLs reserved_namespace: $(SRCS) ! for file in $(SRCS) test.c test_cpp.cc; do \ sed s/GC_/_GC_/g < $$file > tmp; \ cp tmp $$file; \ done user_namespace: $(SRCS) ! for file in $(SRCS) test.c test_cpp.cc; do \ sed s/_GC_/GC_/g < $$file > tmp; \ cp tmp $$file; \ done --- 563,575 ---- # include Makefile.DLLs reserved_namespace: $(SRCS) ! for file in $(SRCS) tests/test.c tests/test_cpp.cc; do \ sed s/GC_/_GC_/g < $$file > tmp; \ cp tmp $$file; \ done user_namespace: $(SRCS) ! for file in $(SRCS) tests/test.c tests/test_cpp.cc; do \ sed s/_GC_/GC_/g < $$file > tmp; \ cp tmp $$file; \ done diff -Nrc3pad gcc-3.0.4/boehm-gc/Makefile.dj gcc-3.1/boehm-gc/Makefile.dj *** gcc-3.0.4/boehm-gc/Makefile.dj Mon Nov 1 23:15:51 1999 --- gcc-3.1/boehm-gc/Makefile.dj Tue Oct 16 09:01:34 2001 *************** *** 1,6 **** --- 1,12 ---- + # This Makefile is intended only for DJGPP use. + # It is mainly a copy of the main Makefile, but tends to get out of sync + # with it. A merge would probably be appropriate. + # Primary targets: # gc.a - builds basic library # libgc.a - builds library for use with g++ "-fgc-keyword" extension + # -fgc-keyword was never really available. Historical + # interest only. # c++ - adds C++ interface to library # cords - adds cords (heavyweight strings) to library # test - prints porting information, then builds basic version of gc.a, *************** AS=gcc -c -x assembler-with-cpp $(ABI_FL *** 20,48 **** CXXLD=gxx $(ABI_FLAG) EXE_SUFFIX=.exe ! CFLAGS= -O -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DALL_INTERIOR_POINTERS -DNO_EXECUTE_PERMISSION -DSILENT ! # For dynamic library builds, it may be necessary to add flags to generate ! # PIC code, e.g. -fPIC on Linux. # Setjmp_test may yield overly optimistic results when compiled # without optimization. # -DSILENT disables statistics printing, and improves performance. ! # -DCHECKSUMS reports on erroneously clear dirty bits, and unexpectedly ! # altered stubborn objects, at substantial performance cost. ! # Use only for incremental collector debugging. ! # -DFIND_LEAK causes the collector to assume that all inaccessible # objects should have been explicitly deallocated, and reports exceptions. # Finalization and the test program are not usable in this mode. - # -DSOLARIS_THREADS enables support for Solaris (thr_) threads. - # (Clients should also define SOLARIS_THREADS and then include - # gc.h before performing thr_ or dl* or GC_ operations.) - # Must also define -D_REENTRANT. - # -D_SOLARIS_PTHREADS enables support for Solaris pthreads. - # Define SOLARIS_THREADS as well. - # -DIRIX_THREADS enables support for Irix pthreads. See README.irix. - # -DLINUX_THREADS enables support for Xavier Leroy's Linux threads. - # see README.linux. -D_REENTRANT may also be required. # -DALL_INTERIOR_POINTERS allows all pointers to the interior # of objects to be recognized. (See gc_priv.h for consequences.) # -DSMALL_CONFIG tries to tune the collector for small heap sizes, --- 26,43 ---- CXXLD=gxx $(ABI_FLAG) EXE_SUFFIX=.exe ! srcdir= . ! VPATH= $(srcdir) ! CFLAGS= -O -I$(srcdir)/include -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DALL_INTERIOR_POINTERS -DNO_EXECUTE_PERMISSION -DSILENT # Setjmp_test may yield overly optimistic results when compiled # without optimization. # -DSILENT disables statistics printing, and improves performance. ! # -DFIND_LEAK causes GC_find_leak to be initially set. ! # This causes the collector to assume that all inaccessible # objects should have been explicitly deallocated, and reports exceptions. # Finalization and the test program are not usable in this mode. # -DALL_INTERIOR_POINTERS allows all pointers to the interior # of objects to be recognized. (See gc_priv.h for consequences.) # -DSMALL_CONFIG tries to tune the collector for small heap sizes, *************** CFLAGS= -O -DATOMIC_UNCOLLECTABLE -DNO_S *** 62,76 **** # implementations, and it sometimes has a significant performance # impact. However, it is dangerous for many not-quite-ANSI C # programs that call things like printf in asynchronous signal handlers. # -DNO_EXECUTE_PERMISSION may cause some or all of the heap to not # have execute permission, i.e. it may be impossible to execute # code from the heap. Currently this only affects the incremental # collector on UNIX machines. It may greatly improve its performance, # since this may avoid some expensive cache synchronization. ! # -DOPERATOR_NEW_ARRAY declares that the C++ compiler supports the ! # new syntax "operator new[]" for allocating and deleting arrays. # See gc_cpp.h for details. No effect on the C part of the collector. ! # This is defined implicitly in a few environments. # -DREDIRECT_MALLOC=X causes malloc, realloc, and free to be defined # as aliases for X, GC_realloc, and GC_free, respectively. # Calloc is redefined in terms of the new malloc. X should --- 57,74 ---- # implementations, and it sometimes has a significant performance # impact. However, it is dangerous for many not-quite-ANSI C # programs that call things like printf in asynchronous signal handlers. + # This is on by default. Turning it off has not been extensively tested with + # compilers that reorder stores. It should have been. # -DNO_EXECUTE_PERMISSION may cause some or all of the heap to not # have execute permission, i.e. it may be impossible to execute # code from the heap. Currently this only affects the incremental # collector on UNIX machines. It may greatly improve its performance, # since this may avoid some expensive cache synchronization. ! # -DGC_NO_OPERATOR_NEW_ARRAY declares that the C++ compiler does not support ! # the new syntax "operator new[]" for allocating and deleting arrays. # See gc_cpp.h for details. No effect on the C part of the collector. ! # This is defined implicitly in a few environments. Must also be defined ! # by clients that use gc_cpp.h. # -DREDIRECT_MALLOC=X causes malloc, realloc, and free to be defined # as aliases for X, GC_realloc, and GC_free, respectively. # Calloc is redefined in terms of the new malloc. X should *************** CFLAGS= -O -DATOMIC_UNCOLLECTABLE -DNO_S *** 89,97 **** # finalize.c). Objects reachable from finalizable objects will be marked # in a sepearte postpass, and hence their memory won't be reclaimed. # Not recommended unless you are implementing a language that specifies ! # these semantics. # -DFINALIZE_ON_DEMAND causes finalizers to be run only in response # to explicit GC_invoke_finalizers() calls. # -DATOMIC_UNCOLLECTABLE includes code for GC_malloc_atomic_uncollectable. # This is useful if either the vendor malloc implementation is poor, # or if REDIRECT_MALLOC is used. --- 87,98 ---- # finalize.c). Objects reachable from finalizable objects will be marked # in a sepearte postpass, and hence their memory won't be reclaimed. # Not recommended unless you are implementing a language that specifies ! # these semantics. Since 5.0, determines only only the initial value ! # of GC_java_finalization variable. # -DFINALIZE_ON_DEMAND causes finalizers to be run only in response # to explicit GC_invoke_finalizers() calls. + # In 5.0 this became runtime adjustable, and this only determines the + # initial value of GC_finalize_on_demand. # -DATOMIC_UNCOLLECTABLE includes code for GC_malloc_atomic_uncollectable. # This is useful if either the vendor malloc implementation is poor, # or if REDIRECT_MALLOC is used. *************** CFLAGS= -O -DATOMIC_UNCOLLECTABLE -DNO_S *** 100,175 **** # kind of object. For the incremental collector it makes sense to match # the most likely page size. Otherwise large values result in more # fragmentation, but generally better performance for large heaps. - # -DUSE_MMAP use MMAP instead of sbrk to get new memory. - # Works for Solaris and Irix. - # -DMMAP_STACKS (for Solaris threads) Use mmap from /dev/zero rather than - # GC_scratch_alloc() to get stack memory. # -DPRINT_BLACK_LIST Whenever a black list entry is added, i.e. whenever # the garbage collector detects a value that looks almost, but not quite, # like a pointer, print both the address containing the value, and the # value of the near-bogus-pointer. Can be used to identifiy regions of # memory that are likely to contribute misidentified pointers. ! # -DOLD_BLOCK_ALLOC Use the old, possibly faster, large block ! # allocation strategy. The new strategy tries harder to minimize ! # fragmentation, sometimes at the expense of spending more time in the ! # large block allocator and/or collecting more frequently. ! # If you expect the allocator to promtly use an explicitly expanded ! # heap, this is highly recommended. ! # ! ! - LIBGC_CFLAGS= -O -DNO_SIGNALS -DSILENT \ - -DREDIRECT_MALLOC=GC_malloc_uncollectable \ - -DDONT_ADD_BYTE_AT_END -DALL_INTERIOR_POINTERS - # Flags for building libgc.a -- the last two are required. CXXFLAGS= $(CFLAGS) -DOPERATOR_NEW_ARRAY AR= ar RANLIB= ranlib ! # Redefining srcdir allows object code for the nonPCR version of the collector ! # to be generated in different directories. In this case, the destination directory ! # should contain a copy of the original include directory. ! srcdir = . ! VPATH = $(srcdir) ! ! OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o headers.o mark.o obj_map.o blacklst.o finalize.o new_hblk.o dbg_mlc.o malloc.o stubborn.o checksums.o solaris_threads.o irix_threads.o linux_threads.o typd_mlc.o ptr_chck.o mallocx.o solaris_pthreads.o ! CSRCS= reclaim.c allchblk.c misc.c alloc.c mach_dep.c os_dep.c mark_rts.c headers.c mark.c obj_map.c pcr_interface.c blacklst.c finalize.c new_hblk.c real_malloc.c dyn_load.c dbg_mlc.c malloc.c stubborn.c checksums.c solaris_threads.c irix_threads.c linux_threads.c typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c ! CORD_SRCS= cord/cordbscs.c cord/cordxtra.c cord/cordprnt.c cord/de.c cord/cordtest.c cord/cord.h cord/ec.h cord/private/cord_pos.h cord/de_win.c cord/de_win.h cord/de_cmds.h cord/de_win.ICO cord/de_win.RC cord/SCOPTIONS.amiga cord/SMakefile.amiga CORD_OBJS= cord/cordbscs.o cord/cordxtra.o cord/cordprnt.o SRCS= $(CSRCS) mips_sgi_mach_dep.s rs6000_mach_dep.s alpha_mach_dep.s \ ! sparc_mach_dep.s gc.h gc_typed.h gc_hdrs.h gc_priv.h gc_private.h \ ! gcconfig.h gc_mark.h include/gc_inl.h include/gc_inline.h gc.man \ ! threadlibs.c if_mach.c if_not_there.c gc_cpp.cc gc_cpp.h weakpointer.h \ ! gcc_support.c mips_ultrix_mach_dep.s include/gc_alloc.h gc_alloc.h \ include/new_gc_alloc.h include/javaxfc.h sparc_sunos4_mach_dep.s \ ! solaris_threads.h $(CORD_SRCS) OTHER_FILES= Makefile PCR-Makefile OS2_MAKEFILE NT_MAKEFILE BCC_MAKEFILE \ README test.c test_cpp.cc setjmp_t.c SMakefile.amiga \ SCoptions.amiga README.amiga README.win32 cord/README \ ! cord/gc.h include/gc.h include/gc_typed.h include/cord.h \ ! include/ec.h include/private/cord_pos.h include/private/gcconfig.h \ ! include/private/gc_hdrs.h include/private/gc_priv.h \ ! include/gc_cpp.h README.rs6000 \ ! include/weakpointer.h README.QUICK callprocs pc_excludes \ barrett_diagram README.OS2 README.Mac MacProjects.sit.hqx \ ! MacOS.c EMX_MAKEFILE makefile.depend README.debugging \ ! include/gc_cpp.h Mac_files/datastart.c Mac_files/dataend.c \ Mac_files/MacOS_config.h Mac_files/MacOS_Test_config.h \ add_gc_prefix.c README.solaris2 README.sgi README.hp README.uts \ win32_threads.c NT_THREADS_MAKEFILE gc.mak README.dj Makefile.dj \ ! README.alpha README.linux version.h Makefile.DLLs \ ! WCC_MAKEFILE ! CORD_INCLUDE_FILES= $(srcdir)/gc.h $(srcdir)/cord/cord.h $(srcdir)/cord/ec.h \ ! $(srcdir)/cord/private/cord_pos.h UTILS= if_mach$(EXE_SUFFIX) if_not_there$(EXE_SUFFIX) --- 101,200 ---- # kind of object. For the incremental collector it makes sense to match # the most likely page size. Otherwise large values result in more # fragmentation, but generally better performance for large heaps. # -DPRINT_BLACK_LIST Whenever a black list entry is added, i.e. whenever # the garbage collector detects a value that looks almost, but not quite, # like a pointer, print both the address containing the value, and the # value of the near-bogus-pointer. Can be used to identifiy regions of # memory that are likely to contribute misidentified pointers. ! # -DKEEP_BACK_PTRS Add code to save back pointers in debugging headers ! # for objects allocated with the debugging allocator. If all objects ! # through GC_MALLOC with GC_DEBUG defined, this allows the client ! # to determine how particular or randomly chosen objects are reachable ! # for debugging/profiling purposes. The gc_backptr.h interface is ! # implemented only if this is defined. ! # -DGC_ASSERTIONS Enable some internal GC assertion checking. Currently ! # this facility is only used in a few places. It is intended primarily ! # for debugging of the garbage collector itself, but could also ! # -DDBG_HDRS_ALL Make sure that all objects have debug headers. Increases ! # the reliability (from 99.9999% to 100%) of some of the debugging ! # code (especially KEEP_BACK_PTRS). Makes -DSHORT_DBG_HDRS possible. ! # Assumes that all client allocation is done through debugging ! # allocators. ! # -DSHORT_DBG_HDRS Assume that all objects have debug headers. Shorten ! # the headers to minimize object size, at the expense of checking for ! # writes past the end of an object. This is intended for environments ! # in which most client code is written in a "safe" language, such as ! # Scheme or Java. Assumes that all client allocation is done using ! # the GC_debug_ functions (or through the macros that expand to these. ! # (Also eliminates the field for the requested object size.) ! # occasionally be useful for debugging of client code. Slows down the ! # collector somewhat, but not drastically. ! # -DCHECKSUMS reports on erroneously clear dirty bits, and unexpectedly ! # altered stubborn objects, at substantial performance cost. ! # Use only for debugging of the incremental collector. ! # -DGC_GCJ_SUPPORT includes support for gcj (and possibly other systems ! # that include a pointer to a type descriptor in each allocated object). ! # Building this way requires an ANSI C compiler. ! # -DUSE_I686_PREFETCH causes the collector to issue Pentium III style ! # prefetch instructions. No effect except on X86 Linux platforms. ! # Assumes a very recent gcc-compatible compiler and assembler. ! # (Gas prefetcht0 support was added around May 1999.) ! # Empirically the code appears to still run correctly on Pentium II ! # processors, though with no performance benefit. May not run on other ! # X86 processors? In some cases this improves performance by ! # 15% or so. ! # -DUSE_3DNOW_PREFETCH causes the collector to issue AMD 3DNow style ! # prefetch instructions. Same restrictions as USE_I686_PREFETCH. ! # UNTESTED!! ! # -DGC_USE_LD_WRAP in combination with the gld flags listed in README.linux ! # causes the collector some system and pthread calls in a more transparent ! # fashion than the usual macro-based approach. Requires GNU ld, and ! # currently probably works only with Linux. CXXFLAGS= $(CFLAGS) -DOPERATOR_NEW_ARRAY AR= ar RANLIB= ranlib ! OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o headers.o mark.o obj_map.o blacklst.o finalize.o new_hblk.o dbg_mlc.o malloc.o stubborn.o checksums.o solaris_threads.o hpux_irix_threads.o linux_threads.o typd_mlc.o ptr_chck.o mallocx.o solaris_pthreads.o gcj_mlc.o specific.o ! CSRCS= reclaim.c allchblk.c misc.c alloc.c mach_dep.c os_dep.c mark_rts.c headers.c mark.c obj_map.c pcr_interface.c blacklst.c finalize.c new_hblk.c real_malloc.c dyn_load.c dbg_mlc.c malloc.c stubborn.c checksums.c solaris_threads.c hpux_irix_threads.c linux_threads.c typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c gcj_mlc.c specific.c ! CORD_SRCS= cord/cordbscs.c cord/cordxtra.c cord/cordprnt.c cord/de.c cord/cordtest.c include/cord.h include/ec.h include/private/cord_pos.h cord/de_win.c cord/de_win.h cord/de_cmds.h cord/de_win.ICO cord/de_win.RC cord/SCOPTIONS.amiga cord/SMakefile.amiga CORD_OBJS= cord/cordbscs.o cord/cordxtra.o cord/cordprnt.o SRCS= $(CSRCS) mips_sgi_mach_dep.s rs6000_mach_dep.s alpha_mach_dep.s \ ! sparc_mach_dep.s include/gc.h include/gc_typed.h \ ! include/private/gc_hdrs.h include/private/gc_priv.h \ ! include/private/gcconfig.h include/private/gc_mark.h \ ! include/gc_inl.h include/gc_inline.h gc.man \ ! threadlibs.c if_mach.c if_not_there.c gc_cpp.cc include/gc_cpp.h \ ! include/weakpointer.h include/private/gc_locks.h \ ! gcc_support.c mips_ultrix_mach_dep.s include/gc_alloc.h \ include/new_gc_alloc.h include/javaxfc.h sparc_sunos4_mach_dep.s \ ! include/private/solaris_threads.h include/gc_backptr.h \ ! hpux_test_and_clear.s include/gc_gcj.h \ ! include/gc_local_alloc.h include/private/dbg_mlc.h \ ! include/private/specific.h powerpc_macosx_mach_dep.s \ ! include/leak_detector.h $(CORD_SRCS) OTHER_FILES= Makefile PCR-Makefile OS2_MAKEFILE NT_MAKEFILE BCC_MAKEFILE \ README test.c test_cpp.cc setjmp_t.c SMakefile.amiga \ SCoptions.amiga README.amiga README.win32 cord/README \ ! README.rs6000 README.QUICK callprocs pc_excludes \ barrett_diagram README.OS2 README.Mac MacProjects.sit.hqx \ ! MacOS.c EMX_MAKEFILE README.debugging \ ! Mac_files/datastart.c Mac_files/dataend.c \ Mac_files/MacOS_config.h Mac_files/MacOS_Test_config.h \ add_gc_prefix.c README.solaris2 README.sgi README.hp README.uts \ win32_threads.c NT_THREADS_MAKEFILE gc.mak README.dj Makefile.dj \ ! README.alpha README.linux README.MacOSX version.h Makefile.DLLs \ ! WCC_MAKEFILE nursery.c include/gc_nursery.h include/gc_copy_descr.h ! CORD_INCLUDE_FILES= $(srcdir)/include/gc.h $(srcdir)/include/cord.h \ ! $(srcdir)/include/ec.h $(srcdir)/include/private/cord_pos.h UTILS= if_mach$(EXE_SUFFIX) if_not_there$(EXE_SUFFIX) *************** SPECIALCFLAGS = *** 189,200 **** all: gc.a gctest$(EXE_SUFFIX) ! pcr: PCR-Makefile gc_private.h gc_hdrs.h gc.h gcconfig.h mach_dep.o $(SRCS) ! make -f PCR-Makefile depend ! make -f PCR-Makefile ! ! $(OBJS) test.o dyn_load.o dyn_load_sunos53.o: $(srcdir)/gc_priv.h $(srcdir)/gc_hdrs.h $(srcdir)/gc.h \ ! $(srcdir)/gcconfig.h $(srcdir)/gc_typed.h Makefile # The dependency on Makefile is needed. Changing # options such as -DSILENT affects the size of GC_arrays, # invalidating all .o files that rely on gc_priv.h --- 214,225 ---- all: gc.a gctest$(EXE_SUFFIX) ! $(OBJS) test.o dyn_load.o dyn_load_sunos53.o: \ ! $(srcdir)/include/private/gc_priv.h \ ! $(srcdir)/include/private/gc_hdrs.h $(srcdir)/include/private/gc_locks.h \ ! $(srcdir)/include/gc.h \ ! $(srcdir)/include/private/gcconfig.h $(srcdir)/include/gc_typed.h \ ! Makefile # The dependency on Makefile is needed. Changing # options such as -DSILENT affects the size of GC_arrays, # invalidating all .o files that rely on gc_priv.h *************** cords: $(CORD_OBJS) cord/cordtest$(EXE_S *** 217,233 **** ./if_not_there on_sparc_sunos5_3 $(AR) ru gc.a $(CORD_OBJS) -./if_not_there on_sparc_sunos5_3 $(RANLIB) gc.a ! gc_cpp.o: $(srcdir)/gc_cpp.cc $(srcdir)/gc_cpp.h $(srcdir)/gc.h Makefile $(CXX) -c $(CXXFLAGS) $(srcdir)/gc_cpp.cc ! test_cpp$(EXE_SUFFIX): $(srcdir)/test_cpp.cc $(srcdir)/gc_cpp.h gc_cpp.o $(srcdir)/gc.h \ base_lib $(UTILS) rm -f test_cpp test_cpp$(EXE_SUFFIX) ./if_mach HP_PA "" $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/test_cpp.cc gc_cpp.o gc.a -ldld ./if_not_there test_cpp$(EXE_SUFFIX) $(CXXLD) $(CXXFLAGS) -o test_cpp$(EXE_SUFFIX) $(srcdir)/test_cpp.cc gc_cpp.o gc.a rm -f test_cpp ! c++: gc_cpp.o $(srcdir)/gc_cpp.h test_cpp$(EXE_SUFFIX) rm -f on_sparc_sunos5_4 ./if_mach SPARC SUNOS5 touch on_sparc_sunos5_4 ./if_mach SPARC SUNOS5 $(AR) rus gc.a gc_cpp.o --- 242,258 ---- ./if_not_there on_sparc_sunos5_3 $(AR) ru gc.a $(CORD_OBJS) -./if_not_there on_sparc_sunos5_3 $(RANLIB) gc.a ! gc_cpp.o: $(srcdir)/gc_cpp.cc $(srcdir)/include/gc_cpp.h $(srcdir)/include/gc.h Makefile $(CXX) -c $(CXXFLAGS) $(srcdir)/gc_cpp.cc ! test_cpp$(EXE_SUFFIX): $(srcdir)/test_cpp.cc $(srcdir)/include/gc_cpp.h gc_cpp.o $(srcdir)/include/gc.h \ base_lib $(UTILS) rm -f test_cpp test_cpp$(EXE_SUFFIX) ./if_mach HP_PA "" $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/test_cpp.cc gc_cpp.o gc.a -ldld ./if_not_there test_cpp$(EXE_SUFFIX) $(CXXLD) $(CXXFLAGS) -o test_cpp$(EXE_SUFFIX) $(srcdir)/test_cpp.cc gc_cpp.o gc.a rm -f test_cpp ! c++: gc_cpp.o $(srcdir)/include/gc_cpp.h test_cpp$(EXE_SUFFIX) rm -f on_sparc_sunos5_4 ./if_mach SPARC SUNOS5 touch on_sparc_sunos5_4 ./if_mach SPARC SUNOS5 $(AR) rus gc.a gc_cpp.o *************** liblinuxgc.so: $(OBJS) dyn_load.o *** 259,270 **** gcc -shared -o liblinuxgc.so $(OBJS) dyn_load.o -lo ln liblinuxgc.so libgc.so ! mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/mips_sgi_mach_dep.s $(srcdir)/mips_ultrix_mach_dep.s $(srcdir)/rs6000_mach_dep.s $(UTILS) rm -f mach_dep.o ./if_mach MIPS IRIX5 $(AS) -o mach_dep.o $(srcdir)/mips_sgi_mach_dep.s ./if_mach MIPS RISCOS $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s ./if_mach MIPS ULTRIX $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s ./if_mach RS6000 "" $(AS) -o mach_dep.o $(srcdir)/rs6000_mach_dep.s ./if_mach ALPHA "" $(AS) -o mach_dep.o $(srcdir)/alpha_mach_dep.s ./if_mach SPARC SUNOS5 $(AS) -o mach_dep.o $(srcdir)/sparc_mach_dep.s ./if_mach SPARC SUNOS4 $(AS) -o mach_dep.o $(srcdir)/sparc_sunos4_mach_dep.s --- 284,297 ---- gcc -shared -o liblinuxgc.so $(OBJS) dyn_load.o -lo ln liblinuxgc.so libgc.so ! mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/mips_sgi_mach_dep.s $(srcdir)/mips_ultrix_mach_dep.s \ ! $(srcdir)/rs6000_mach_dep.s $(srcdir)/powerpc_macosx_mach_dep.s $(UTILS) rm -f mach_dep.o ./if_mach MIPS IRIX5 $(AS) -o mach_dep.o $(srcdir)/mips_sgi_mach_dep.s ./if_mach MIPS RISCOS $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s ./if_mach MIPS ULTRIX $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s ./if_mach RS6000 "" $(AS) -o mach_dep.o $(srcdir)/rs6000_mach_dep.s + ./if_mach POWERPC MACOSX $(AS) -o mach_dep.o $(srcdir)/powerpc_macosx_mach_dep.s ./if_mach ALPHA "" $(AS) -o mach_dep.o $(srcdir)/alpha_mach_dep.s ./if_mach SPARC SUNOS5 $(AS) -o mach_dep.o $(srcdir)/sparc_mach_dep.s ./if_mach SPARC SUNOS4 $(AS) -o mach_dep.o $(srcdir)/sparc_sunos4_mach_dep.s *************** cord/de$(EXE_SUFFIX): $(srcdir)/cord/de. *** 312,331 **** ./if_mach ALPHA LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses ./if_not_there cord/de$(EXE_SUFFIX) $(CC) $(CFLAGS) -o cord/de$(EXE_SUFFIX) $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) ! if_mach$(EXE_SUFFIX): $(srcdir)/if_mach.c $(srcdir)/gcconfig.h rm -f if_mach if_mach$(EXE_SUFFIX) $(CC) $(CFLAGS) -o if_mach $(srcdir)/if_mach.c - rm -f if_mach ! threadlibs$(EXE_SUFFIX): $(srcdir)/threadlibs.c $(srcdir)/gcconfig.h Makefile rm -f threadlibs threadlibs$(EXE_SUFFIX) $(CC) $(CFLAGS) -o threadlibs $(srcdir)/threadlibs.c - rm -f threadlibs if_not_there$(EXE_SUFFIX): $(srcdir)/if_not_there.c rm -f if_not_there if_not_there$(EXE_SUFFIX) $(CC) $(CFLAGS) -o if_not_there $(srcdir)/if_not_there.c - rm -f if_not_there # Clean removes *.o several times, # because as the first one doesn't seem to get them all! --- 339,355 ---- ./if_mach ALPHA LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses ./if_not_there cord/de$(EXE_SUFFIX) $(CC) $(CFLAGS) -o cord/de$(EXE_SUFFIX) $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) ! if_mach$(EXE_SUFFIX): $(srcdir)/if_mach.c $(srcdir)/include/private/gcconfig.h rm -f if_mach if_mach$(EXE_SUFFIX) $(CC) $(CFLAGS) -o if_mach $(srcdir)/if_mach.c ! threadlibs$(EXE_SUFFIX): $(srcdir)/threadlibs.c $(srcdir)include/private/gcconfig.h Makefile rm -f threadlibs threadlibs$(EXE_SUFFIX) $(CC) $(CFLAGS) -o threadlibs $(srcdir)/threadlibs.c if_not_there$(EXE_SUFFIX): $(srcdir)/if_not_there.c rm -f if_not_there if_not_there$(EXE_SUFFIX) $(CC) $(CFLAGS) -o if_not_there $(srcdir)/if_not_there.c # Clean removes *.o several times, # because as the first one doesn't seem to get them all! *************** gctest$(EXE_SUFFIX): test.o gc.a if_mach *** 352,358 **** # If an optimized setjmp_test generates a segmentation fault, # odds are your compiler is broken. Gctest may still work. # Try compiling setjmp_t.c unoptimized. ! setjmp_test$(EXE_SUFFIX): $(srcdir)/setjmp_t.c $(srcdir)/gc.h \ if_mach$(EXE_SUFFIX) if_not_there$(EXE_SUFFIX) rm -f setjmp_test$(EXE_SUFFIX) $(CC) $(CFLAGS) -o setjmp_test $(srcdir)/setjmp_t.c --- 376,382 ---- # If an optimized setjmp_test generates a segmentation fault, # odds are your compiler is broken. Gctest may still work. # Try compiling setjmp_t.c unoptimized. ! setjmp_test$(EXE_SUFFIX): $(srcdir)/setjmp_t.c $(srcdir)/include/gc.h \ if_mach$(EXE_SUFFIX) if_not_there$(EXE_SUFFIX) rm -f setjmp_test$(EXE_SUFFIX) $(CC) $(CFLAGS) -o setjmp_test $(srcdir)/setjmp_t.c *************** gc.tar: $(SRCS) $(OTHER_FILES) add_gc_pr *** 377,397 **** pc_gc.tar: $(SRCS) $(OTHER_FILES) tar cvfX pc_gc.tar pc_excludes $(SRCS) $(OTHER_FILES) - floppy: pc_gc.tar - -mmd a:/cord - -mmd a:/cord/private - -mmd a:/include - -mmd a:/include/private - mkdir /tmp/pc_gc - cat pc_gc.tar | (cd /tmp/pc_gc; tar xvf -) - -mcopy -tmn /tmp/pc_gc/* a: - -mcopy -tmn /tmp/pc_gc/cord/* a:/cord - -mcopy -mn /tmp/pc_gc/cord/de_win.ICO a:/cord - -mcopy -tmn /tmp/pc_gc/cord/private/* a:/cord/private - -mcopy -tmn /tmp/pc_gc/include/* a:/include - -mcopy -tmn /tmp/pc_gc/include/private/* a:/include/private - rm -r /tmp/pc_gc - gc.tar.Z: gc.tar compress gc.tar --- 401,406 ---- *************** ABSDIR = `pwd` *** 408,416 **** gctest_dyn_link: test.o libgc.so $(CC) -L$(ABSDIR) -R$(ABSDIR) -o gctest_dyn_link test.o -lgc -ldl -lthread - gctest_irix_dyn_link: test.o libirixgc.so - $(CC) -L$(ABSDIR) -o gctest_irix_dyn_link test.o -lirixgc - test_dll.o: test.c libgc_globals.h $(CC) $(CFLAGS) -DGC_USE_DLL -c test.c -o test_dll.o --- 417,422 ---- *************** SYM_PREFIX-libgc=GC *** 422,436 **** # Uncomment the following line to build a GNU win32 DLL # include Makefile.DLLs - reserved_namespace: $(SRCS) - for file in $(SRCS) test.c test_cpp.cc; do \ - sed s/GC_/_GC_/g < $$file > tmp; \ - cp tmp $$file; \ - done - - user_namespace: $(SRCS) - for file in $(SRCS) test.c test_cpp.cc; do \ - sed s/_GC_/GC_/g < $$file > tmp; \ - cp tmp $$file; \ - done - --- 428,430 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/Makefile.in gcc-3.1/boehm-gc/Makefile.in *** gcc-3.0.4/boehm-gc/Makefile.in Wed Feb 20 19:40:48 2002 --- gcc-3.1/boehm-gc/Makefile.in Wed May 15 02:40:18 2002 *************** *** 1,6 **** ! # Makefile.in generated automatically by automake 1.4 from Makefile.am ! # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. --- 1,6 ---- ! # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am ! # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. *************** target_alias = @target_alias@ *** 65,71 **** target_triplet = @target@ AR = @AR@ AS = @AS@ - BOEHM_GC_CFLAGS = @BOEHM_GC_CFLAGS@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ --- 65,70 ---- *************** EXEEXT = @EXEEXT@ *** 76,81 **** --- 75,81 ---- EXTRA_TEST_LIBS = @EXTRA_TEST_LIBS@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ + GC_CFLAGS = @GC_CFLAGS@ INCLUDES = @INCLUDES@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ *************** STRIP = @STRIP@ *** 90,101 **** THREADLIBS = @THREADLIBS@ VERSION = @VERSION@ addobjs = @addobjs@ ! boehm_gc_basedir = @boehm_gc_basedir@ mkinstalldirs = @mkinstalldirs@ target_all = @target_all@ AUTOMAKE_OPTIONS = cygnus # Multilib support variables. MULTISRCTOP = MULTIBUILDTOP = --- 90,103 ---- THREADLIBS = @THREADLIBS@ VERSION = @VERSION@ addobjs = @addobjs@ ! gc_basedir = @gc_basedir@ mkinstalldirs = @mkinstalldirs@ target_all = @target_all@ AUTOMAKE_OPTIONS = cygnus + SUBDIRS = include + # Multilib support variables. MULTISRCTOP = MULTIBUILDTOP = *************** MULTIDIRS = *** 103,143 **** MULTISUBDIR = MULTIDO = true MULTICLEAN = true ! @USE_LIBDIR_TRUE@toolexeclibdir = \ ! @USE_LIBDIR_TRUE@$(libdir)$(MULTISUBDIR) ! @USE_LIBDIR_FALSE@toolexeclibdir = \ ! @USE_LIBDIR_FALSE@$(toolexecdir)/lib$(MULTISUBDIR) ! @USE_LIBDIR_FALSE@toolexecdir = \ ! @USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias) ! toolexeclib_LTLIBRARIES = $(target_all) ! EXTRA_LTLIBRARIES = libgcjgc.la ! libgcjgc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c \ ! gcconfig.h dbg_mlc.c dyn_load.c finalize.c gc.h gc_alloc.h gc_cpp.h \ ! gc_hdrs.h gc_mark.h gc_priv.h gc_private.h gc_typed.h gcj_mlc.c headers.c \ ! hpux_irix_threads.c linux_threads.c malloc.c mallocx.c mark.c mark_rts.c \ ! misc.c new_hblk.c obj_map.c os_dep.c pcr_interface.c ptr_chck.c \ ! real_malloc.c reclaim.c solaris_pthreads.c solaris_threads.c \ ! solaris_threads.h stubborn.c typd_mlc.c version.h weakpointer.h # Include THREADLIBS here to ensure that the correct versions of # linuxthread semaphore functions get linked: libgcjgc_la_LIBADD = @addobjs@ $(THREADLIBS) libgcjgc_la_DEPENDENCIES = @addobjs@ libgcjgc_la_LDFLAGS = -version-info 1:1:0 -rpath $(toolexeclibdir) ! EXTRA_libgcjgc_la_SOURCES = alpha_mach_dep.s mips_sgi_mach_dep.s \ ! mips_ultrix_mach_dep.s rs6000_mach_dep.s sparc_mach_dep.s \ ! sparc_sunos4_mach_dep.s mach_dep.c ecos.cc ! ! AM_CXXFLAGS = @BOEHM_GC_CFLAGS@ ! AM_CFLAGS = @BOEHM_GC_CFLAGS@ check_PROGRAMS = gctest ! gctest_SOURCES = test.c gctest_LDADD = ./libgcjgc.la $(THREADLIBS) $(EXTRA_TEST_LIBS) gctest_LDFLAGS = -shared-libgcc TESTS_ENVIRONMENT = LD_LIBRARY_PATH=../../$(MULTIBUILDTOP)gcc --- 105,152 ---- MULTISUBDIR = MULTIDO = true MULTICLEAN = true ! @USE_LIBDIR_TRUE@toolexeclibdir = @USE_LIBDIR_TRUE@$(libdir)$(MULTISUBDIR) ! @USE_LIBDIR_FALSE@toolexeclibdir = @USE_LIBDIR_FALSE@$(toolexecdir)/lib$(MULTISUBDIR) ! @USE_LIBDIR_FALSE@toolexecdir = @USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias) ! noinst_LTLIBRARIES = libgcjgc.la libgcjgc_convenience.la ! ! GC_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \ ! dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c irix_threads.c \ ! linux_threads.c malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \ ! obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \ ! solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c \ ! backgraph.c win32_threads.c + EXTRA_GC_SOURCES = alpha_mach_dep.s \ + mips_sgi_mach_dep.S mips_ultrix_mach_dep.s powerpc_macosx_mach_dep.s \ + rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \ + sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s + + + libgcjgc_la_SOURCES = $(GC_SOURCES) + libgcjgc_convenience_la_SOURCES = $(GC_SOURCES) + EXTRA_libgcjgc_la_SOURCES = $(EXTRA_GC_SOURCES) + EXTRA_libgcjgc_convenience_la_SOURCES = $(EXTRA_GC_SOURCES) + # Include THREADLIBS here to ensure that the correct versions of # linuxthread semaphore functions get linked: libgcjgc_la_LIBADD = @addobjs@ $(THREADLIBS) libgcjgc_la_DEPENDENCIES = @addobjs@ libgcjgc_la_LDFLAGS = -version-info 1:1:0 -rpath $(toolexeclibdir) ! libgcjgc_convenience_la_LIBADD = @addobjs@ ! libgcjgc_convenience_la_DEPENDENCIES = @addobjs@ ! AM_CXXFLAGS = @GC_CFLAGS@ ! AM_CFLAGS = @GC_CFLAGS@ check_PROGRAMS = gctest ! # Using $< in the above seems to fail with the HP/UX on Itanium make. ! ! gctest_OBJECTS = test.o gctest_LDADD = ./libgcjgc.la $(THREADLIBS) $(EXTRA_TEST_LIBS) gctest_LDFLAGS = -shared-libgcc TESTS_ENVIRONMENT = LD_LIBRARY_PATH=../../$(MULTIBUILDTOP)gcc *************** all_objs = @addobjs@ $(libgcjgc_la_OBJEC *** 147,153 **** LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) \ ! $(AM_CFLAGS) $(MY_CFLAGS) $(BOEHM_GC_CFLAGS) LINK = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(MY_CFLAGS) $(LDFLAGS) -o $@ --- 156,162 ---- LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) \ ! $(AM_CFLAGS) $(MY_CFLAGS) $(GC_CFLAGS) LINK = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(MY_CFLAGS) $(LDFLAGS) -o $@ *************** CONFIG_STATUS_DEPENDENCIES = $(srcdir)/c *** 198,204 **** MAKEOVERRIDES = ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 CONFIG_CLEAN_FILES = ! LTLIBRARIES = $(toolexeclib_LTLIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) --- 207,213 ---- MAKEOVERRIDES = ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 CONFIG_CLEAN_FILES = ! LTLIBRARIES = $(noinst_LTLIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) *************** CPPFLAGS = @CPPFLAGS@ *** 206,241 **** LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ libgcjgc_la_OBJECTS = allchblk.lo alloc.lo blacklst.lo checksums.lo \ ! dbg_mlc.lo dyn_load.lo finalize.lo gcj_mlc.lo headers.lo \ ! hpux_irix_threads.lo linux_threads.lo malloc.lo mallocx.lo mark.lo \ mark_rts.lo misc.lo new_hblk.lo obj_map.lo os_dep.lo pcr_interface.lo \ ptr_chck.lo real_malloc.lo reclaim.lo solaris_pthreads.lo \ ! solaris_threads.lo stubborn.lo typd_mlc.lo check_PROGRAMS = gctest$(EXEEXT) - gctest_OBJECTS = test.$(OBJEXT) gctest_DEPENDENCIES = ./libgcjgc.la - CXXFLAGS = @CXXFLAGS@ - CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) - LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) - CXXLD = $(CXX) - CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) ! DIST_COMMON = README ChangeLog Makefile.am Makefile.in acinclude.m4 \ ! aclocal.m4 configure configure.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) ! TAR = tar GZIP_ENV = --best ! SOURCES = $(libgcjgc_la_SOURCES) $(EXTRA_libgcjgc_la_SOURCES) $(gctest_SOURCES) ! OBJECTS = $(libgcjgc_la_OBJECTS) $(gctest_OBJECTS) all: all-redirect .SUFFIXES: ! .SUFFIXES: .S .c .cc .lo .o .obj .s $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile --- 215,254 ---- LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ libgcjgc_la_OBJECTS = allchblk.lo alloc.lo blacklst.lo checksums.lo \ ! dbg_mlc.lo dyn_load.lo finalize.lo gc_dlopen.lo gcj_mlc.lo headers.lo \ ! irix_threads.lo linux_threads.lo malloc.lo mallocx.lo mark.lo \ mark_rts.lo misc.lo new_hblk.lo obj_map.lo os_dep.lo pcr_interface.lo \ ptr_chck.lo real_malloc.lo reclaim.lo solaris_pthreads.lo \ ! solaris_threads.lo specific.lo stubborn.lo typd_mlc.lo backgraph.lo \ ! win32_threads.lo ! libgcjgc_convenience_la_LDFLAGS = ! libgcjgc_convenience_la_OBJECTS = allchblk.lo alloc.lo blacklst.lo \ ! checksums.lo dbg_mlc.lo dyn_load.lo finalize.lo gc_dlopen.lo gcj_mlc.lo \ ! headers.lo irix_threads.lo linux_threads.lo malloc.lo mallocx.lo \ ! mark.lo mark_rts.lo misc.lo new_hblk.lo obj_map.lo os_dep.lo \ ! pcr_interface.lo ptr_chck.lo real_malloc.lo reclaim.lo \ ! solaris_pthreads.lo solaris_threads.lo specific.lo stubborn.lo \ ! typd_mlc.lo backgraph.lo win32_threads.lo check_PROGRAMS = gctest$(EXEEXT) gctest_DEPENDENCIES = ./libgcjgc.la CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) ! DIST_COMMON = ChangeLog Makefile.am Makefile.in acinclude.m4 aclocal.m4 \ ! config.guess config.sub configure configure.in install-sh ltconfig \ ! ltmain.sh mkinstalldirs DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) ! TAR = gtar GZIP_ENV = --best ! SOURCES = $(libgcjgc_la_SOURCES) $(EXTRA_libgcjgc_la_SOURCES) $(libgcjgc_convenience_la_SOURCES) $(EXTRA_libgcjgc_convenience_la_SOURCES) ! OBJECTS = $(libgcjgc_la_OBJECTS) $(libgcjgc_convenience_la_OBJECTS) all: all-redirect .SUFFIXES: ! .SUFFIXES: .S .c .lo .o .obj .s $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile *************** config.status: $(srcdir)/configure $(CON *** 251,280 **** $(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) ! mostlyclean-toolexeclibLTLIBRARIES: ! ! clean-toolexeclibLTLIBRARIES: ! -test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES) ! ! distclean-toolexeclibLTLIBRARIES: ! maintainer-clean-toolexeclibLTLIBRARIES: ! install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) ! @$(NORMAL_INSTALL) ! $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) ! @list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \ ! if test -f $$p; then \ ! echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(toolexeclibdir)/$$p"; \ ! $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(toolexeclibdir)/$$p; \ ! else :; fi; \ ! done ! uninstall-toolexeclibLTLIBRARIES: ! @$(NORMAL_UNINSTALL) ! list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \ ! $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(toolexeclibdir)/$$p; \ ! done .c.o: $(COMPILE) -c $< --- 264,277 ---- $(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) ! mostlyclean-noinstLTLIBRARIES: ! clean-noinstLTLIBRARIES: ! -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) ! distclean-noinstLTLIBRARIES: ! maintainer-clean-noinstLTLIBRARIES: .c.o: $(COMPILE) -c $< *************** maintainer-clean-libtool: *** 320,325 **** --- 317,325 ---- libgcjgc.la: $(libgcjgc_la_OBJECTS) $(libgcjgc_la_DEPENDENCIES) $(LINK) $(libgcjgc_la_LDFLAGS) $(libgcjgc_la_OBJECTS) $(libgcjgc_la_LIBADD) $(LIBS) + libgcjgc_convenience.la: $(libgcjgc_convenience_la_OBJECTS) $(libgcjgc_convenience_la_DEPENDENCIES) + $(LINK) $(libgcjgc_convenience_la_LDFLAGS) $(libgcjgc_convenience_la_OBJECTS) $(libgcjgc_convenience_la_LIBADD) $(LIBS) + mostlyclean-checkPROGRAMS: clean-checkPROGRAMS: *************** maintainer-clean-checkPROGRAMS: *** 332,343 **** gctest$(EXEEXT): $(gctest_OBJECTS) $(gctest_DEPENDENCIES) @rm -f gctest$(EXEEXT) $(LINK) $(gctest_LDFLAGS) $(gctest_OBJECTS) $(gctest_LDADD) $(LIBS) ! .cc.o: ! $(CXXCOMPILE) -c $< ! .cc.obj: ! $(CXXCOMPILE) -c `cygpath -w $<` ! .cc.lo: ! $(LTCXXCOMPILE) -c $< tags: TAGS --- 332,392 ---- gctest$(EXEEXT): $(gctest_OBJECTS) $(gctest_DEPENDENCIES) @rm -f gctest$(EXEEXT) $(LINK) $(gctest_LDFLAGS) $(gctest_OBJECTS) $(gctest_LDADD) $(LIBS) ! ! # This directory's subdirectories are mostly independent; you can cd ! # into them and run `make' without going through this Makefile. ! # To change the values of `make' variables: instead of editing Makefiles, ! # (1) if the variable is set in `config.status', edit `config.status' ! # (which will cause the Makefiles to be regenerated when you run `make'); ! # (2) otherwise, pass the desired values on the `make' command line. ! ! @SET_MAKE@ ! ! all-recursive install-data-recursive install-exec-recursive \ ! installdirs-recursive install-recursive uninstall-recursive install-info-recursive \ ! check-recursive installcheck-recursive info-recursive dvi-recursive: ! @set fnord $(MAKEFLAGS); amf=$$2; \ ! dot_seen=no; \ ! target=`echo $@ | sed s/-recursive//`; \ ! list='$(SUBDIRS)'; for subdir in $$list; do \ ! echo "Making $$target in $$subdir"; \ ! if test "$$subdir" = "."; then \ ! dot_seen=yes; \ ! local_target="$$target-am"; \ ! else \ ! local_target="$$target"; \ ! fi; \ ! (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ ! || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ ! done; \ ! if test "$$dot_seen" = "no"; then \ ! $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ ! fi; test -z "$$fail" ! ! mostlyclean-recursive clean-recursive distclean-recursive \ ! maintainer-clean-recursive: ! @set fnord $(MAKEFLAGS); amf=$$2; \ ! dot_seen=no; \ ! rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ ! rev="$$subdir $$rev"; \ ! test "$$subdir" != "." || dot_seen=yes; \ ! done; \ ! test "$$dot_seen" = "no" && rev=". $$rev"; \ ! target=`echo $@ | sed s/-recursive//`; \ ! for subdir in $$rev; do \ ! echo "Making $$target in $$subdir"; \ ! if test "$$subdir" = "."; then \ ! local_target="$$target-am"; \ ! else \ ! local_target="$$target"; \ ! fi; \ ! (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ ! || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ ! done && test -z "$$fail" ! tags-recursive: ! list='$(SUBDIRS)'; for subdir in $$list; do \ ! test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ ! done tags: TAGS *************** ID: $(HEADERS) $(SOURCES) $(LISP) *** 349,357 **** here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) ! TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ --- 398,411 ---- here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) ! TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ *************** distdir: $(DISTFILES) *** 409,421 **** @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ ! cp -pr $$/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done check-TESTS: $(TESTS) @failed=0; all=0; \ srcdir=$(srcdir); export srcdir; \ --- 463,485 ---- @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ ! cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done check-TESTS: $(TESTS) @failed=0; all=0; \ srcdir=$(srcdir); export srcdir; \ *************** check-TESTS: $(TESTS) *** 442,474 **** echo "$$dashes"; \ test "$$failed" -eq 0 info-am: ! info: info-am dvi-am: ! dvi: dvi-am check-am: $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS ! check: check-am installcheck-am: ! installcheck: installcheck-am install-info-am: ! install-info: install-info-am ! install-exec-am: install-toolexeclibLTLIBRARIES ! install-exec: install-exec-am install-data-am: ! install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am ! install: install-am ! uninstall-am: uninstall-toolexeclibLTLIBRARIES ! uninstall: uninstall-am all-am: Makefile $(LTLIBRARIES) ! all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install ! installdirs: ! $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) mostlyclean-generic: --- 506,538 ---- echo "$$dashes"; \ test "$$failed" -eq 0 info-am: ! info: info-recursive dvi-am: ! dvi: dvi-recursive check-am: $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS ! check: check-recursive installcheck-am: ! installcheck: installcheck-recursive install-info-am: ! install-info: install-info-recursive ! install-exec-am: ! install-exec: install-exec-recursive install-data-am: ! install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am ! install: install-recursive ! uninstall-am: ! uninstall: uninstall-recursive all-am: Makefile $(LTLIBRARIES) ! all-redirect: all-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install ! installdirs: installdirs-recursive ! installdirs-am: mostlyclean-generic: *************** distclean-generic: *** 480,532 **** -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: ! mostlyclean-am: mostlyclean-toolexeclibLTLIBRARIES mostlyclean-compile \ mostlyclean-libtool mostlyclean-checkPROGRAMS \ mostlyclean-tags mostlyclean-generic ! mostlyclean: mostlyclean-am ! clean-am: clean-toolexeclibLTLIBRARIES clean-compile clean-libtool \ clean-checkPROGRAMS clean-tags clean-generic \ mostlyclean-am ! clean: clean-am ! distclean-am: distclean-toolexeclibLTLIBRARIES distclean-compile \ distclean-libtool distclean-checkPROGRAMS \ distclean-tags distclean-generic clean-am -rm -f libtool ! distclean: distclean-am -rm -f config.status ! maintainer-clean-am: maintainer-clean-toolexeclibLTLIBRARIES \ maintainer-clean-compile maintainer-clean-libtool \ maintainer-clean-checkPROGRAMS maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." ! maintainer-clean: maintainer-clean-am -rm -f config.status ! .PHONY: mostlyclean-toolexeclibLTLIBRARIES \ ! distclean-toolexeclibLTLIBRARIES clean-toolexeclibLTLIBRARIES \ ! maintainer-clean-toolexeclibLTLIBRARIES \ ! uninstall-toolexeclibLTLIBRARIES install-toolexeclibLTLIBRARIES \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile mostlyclean-libtool distclean-libtool \ clean-libtool maintainer-clean-libtool mostlyclean-checkPROGRAMS \ distclean-checkPROGRAMS clean-checkPROGRAMS \ ! maintainer-clean-checkPROGRAMS tags mostlyclean-tags distclean-tags \ ! clean-tags maintainer-clean-tags distdir check-TESTS info-am info \ ! dvi-am dvi check check-am installcheck-am installcheck install-info-am \ ! install-info install-exec-am install-exec install-data-am install-data \ ! install-am install uninstall-am uninstall all-redirect all-am all \ ! installdirs mostlyclean-generic distclean-generic clean-generic \ ! maintainer-clean-generic clean mostlyclean distclean maintainer-clean ! $(all_objs) : gcconfig.h gc_priv.h gc_hdrs.h gc.h gc_mark.h .s.lo: $(LTCOMPILE) -Wp,-P -x assembler-with-cpp -c $< --- 544,605 ---- -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: ! mostlyclean-am: mostlyclean-noinstLTLIBRARIES mostlyclean-compile \ mostlyclean-libtool mostlyclean-checkPROGRAMS \ mostlyclean-tags mostlyclean-generic ! mostlyclean: mostlyclean-recursive ! clean-am: clean-noinstLTLIBRARIES clean-compile clean-libtool \ clean-checkPROGRAMS clean-tags clean-generic \ mostlyclean-am ! clean: clean-recursive ! distclean-am: distclean-noinstLTLIBRARIES distclean-compile \ distclean-libtool distclean-checkPROGRAMS \ distclean-tags distclean-generic clean-am -rm -f libtool ! distclean: distclean-recursive -rm -f config.status ! maintainer-clean-am: maintainer-clean-noinstLTLIBRARIES \ maintainer-clean-compile maintainer-clean-libtool \ maintainer-clean-checkPROGRAMS maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." ! maintainer-clean: maintainer-clean-recursive -rm -f config.status ! .PHONY: mostlyclean-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \ ! clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile mostlyclean-libtool distclean-libtool \ clean-libtool maintainer-clean-libtool mostlyclean-checkPROGRAMS \ distclean-checkPROGRAMS clean-checkPROGRAMS \ ! maintainer-clean-checkPROGRAMS install-data-recursive \ ! uninstall-data-recursive install-exec-recursive \ ! uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ ! all-recursive check-recursive installcheck-recursive info-recursive \ ! dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ ! maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ ! distclean-tags clean-tags maintainer-clean-tags distdir check-TESTS \ ! info-am info dvi-am dvi check check-am installcheck-am installcheck \ ! install-info-am install-info install-exec-am install-exec \ ! install-data-am install-data install-am install uninstall-am uninstall \ ! all-redirect all-am all installdirs-am installdirs mostlyclean-generic \ ! distclean-generic clean-generic maintainer-clean-generic clean \ ! mostlyclean distclean maintainer-clean ! # The following hack produces a warning from automake, but we need it in order ! # to build a file from a subdirectory. FIXME. ! test.o: tests/test.c ! $(COMPILE) -c $(srcdir)/tests/test.c ! $(all_objs) : include/private/gcconfig.h include/private/gc_priv.h \ ! include/private/gc_hdrs.h include/gc.h include/gc_gcj.h include/gc_mark.h .s.lo: $(LTCOMPILE) -Wp,-P -x assembler-with-cpp -c $< diff -Nrc3pad gcc-3.0.4/boehm-gc/NT_MAKEFILE gcc-3.1/boehm-gc/NT_MAKEFILE *** gcc-3.0.4/boehm-gc/NT_MAKEFILE Sun May 7 00:43:49 2000 --- gcc-3.1/boehm-gc/NT_MAKEFILE Fri Aug 17 18:30:45 2001 *************** OBJS= alloc.obj reclaim.obj allchblk.obj *** 10,38 **** all: gctest.exe cord\de.exe test_cpp.exe .c.obj: ! $(cc) $(cdebug) $(cflags) $(cvars) -DSILENT -DALL_INTERIOR_POINTERS -D__STDC__ $*.c /Fo$*.obj .cpp.obj: ! $(cc) $(cdebug) $(cflags) $(cvars) -DSILENT -DALL_INTERIOR_POINTERS $*.CPP /Fo$*.obj ! $(OBJS) test.obj: gc_priv.h gc_hdrs.h gc.h gc.lib: $(OBJS) lib /MACHINE:i386 /out:gc.lib $(OBJS) # The original NT SDK used lib32 instead of lib ! gctest.exe: test.obj gc.lib # The following works for win32 debugging. For win32s debugging use debugtype:coff # and add mapsympe line. # This produces a "GUI" applications that opens no windows and writes to the log file # "gc.log". This is done to make the result runnable under win32s. ! $(link) -debug:full -debugtype:cv $(guiflags) -stack:131072 -out:$*.exe test.obj $(guilibs) gc.lib # mapsympe -n -o gctest.sym gctest.exe cord\de_win.rbj: cord\de_win.res cvtres -$(CPU) cord\de_win.res -o cord\de_win.rbj ! cord\de.obj cord\de_win.obj: cord\cord.h cord\private\cord_pos.h cord\de_win.h cord\de_cmds.h cord\de_win.res: cord\de_win.rc cord\de_win.h cord\de_cmds.h $(rc) $(rcvars) -r -fo cord\de_win.res $(cvars) cord\de_win.rc --- 10,38 ---- all: gctest.exe cord\de.exe test_cpp.exe .c.obj: ! $(cc) $(cdebug) $(cflags) $(cvars) -Iinclude -DSILENT -DALL_INTERIOR_POINTERS -D__STDC__ -DGC_NOT_DLL $*.c /Fo$*.obj .cpp.obj: ! $(cc) $(cdebug) $(cflags) $(cvars) -Iinclude -DSILENT -DALL_INTERIOR_POINTERS -DGC_NOT_DLL $*.CPP /Fo$*.obj ! $(OBJS) tests\test.obj: include\private\gc_priv.h include\private\gc_hdrs.h include\gc.h include\private\gcconfig.h include\private\gc_locks.h include\private\gc_pmark.h include\gc_mark.h gc.lib: $(OBJS) lib /MACHINE:i386 /out:gc.lib $(OBJS) # The original NT SDK used lib32 instead of lib ! gctest.exe: tests\test.obj gc.lib # The following works for win32 debugging. For win32s debugging use debugtype:coff # and add mapsympe line. # This produces a "GUI" applications that opens no windows and writes to the log file # "gc.log". This is done to make the result runnable under win32s. ! $(link) -debug:full -debugtype:cv $(guiflags) -stack:131072 -out:$*.exe tests\test.obj $(guilibs) gc.lib # mapsympe -n -o gctest.sym gctest.exe cord\de_win.rbj: cord\de_win.res cvtres -$(CPU) cord\de_win.res -o cord\de_win.rbj ! cord\de.obj cord\de_win.obj: include\cord.h include\private\cord_pos.h cord\de_win.h cord\de_cmds.h cord\de_win.res: cord\de_win.rc cord\de_win.h cord\de_cmds.h $(rc) $(rcvars) -r -fo cord\de_win.res $(cvars) cord\de_win.rc *************** cord\de_win.res: cord\de_win.rc cord\de_ *** 41,58 **** cord\de.exe: cord\cordbscs.obj cord\cordxtra.obj cord\de.obj cord\de_win.obj cord\de_win.rbj gc.lib $(link) -debug:full -debugtype:cv $(guiflags) -stack:16384 -out:cord\de.exe cord\cordbscs.obj cord\cordxtra.obj cord\de.obj cord\de_win.obj cord\de_win.rbj gc.lib $(guilibs) ! gc_cpp.obj: gc_cpp.h gc.h gc_cpp.cpp: gc_cpp.cc copy gc_cpp.cc gc_cpp.cpp ! test_cpp.cpp: test_cpp.cc ! copy test_cpp.cc test_cpp.cpp # This generates the C++ test executable. The executable expects # a single numeric argument, which is the number of iterations. # The output appears in the file "gc.log". ! test_cpp.exe: test_cpp.obj gc_cpp.h gc.h gc.lib $(link) -debug:full -debugtype:cv $(guiflags) -stack:16384 -out:test_cpp.exe test_cpp.obj gc.lib $(guilibs) --- 41,58 ---- cord\de.exe: cord\cordbscs.obj cord\cordxtra.obj cord\de.obj cord\de_win.obj cord\de_win.rbj gc.lib $(link) -debug:full -debugtype:cv $(guiflags) -stack:16384 -out:cord\de.exe cord\cordbscs.obj cord\cordxtra.obj cord\de.obj cord\de_win.obj cord\de_win.rbj gc.lib $(guilibs) ! gc_cpp.obj: include\gc_cpp.h include\gc.h gc_cpp.cpp: gc_cpp.cc copy gc_cpp.cc gc_cpp.cpp ! test_cpp.cpp: tests\test_cpp.cc ! copy tests\test_cpp.cc test_cpp.cpp # This generates the C++ test executable. The executable expects # a single numeric argument, which is the number of iterations. # The output appears in the file "gc.log". ! test_cpp.exe: test_cpp.obj include\gc_cpp.h include\gc.h gc.lib $(link) -debug:full -debugtype:cv $(guiflags) -stack:16384 -out:test_cpp.exe test_cpp.obj gc.lib $(guilibs) diff -Nrc3pad gcc-3.0.4/boehm-gc/NT_THREADS_MAKEFILE gcc-3.1/boehm-gc/NT_THREADS_MAKEFILE *** gcc-3.0.4/boehm-gc/NT_THREADS_MAKEFILE Mon Nov 1 20:48:52 1999 --- gcc-3.1/boehm-gc/NT_THREADS_MAKEFILE Tue Oct 16 09:01:35 2001 *************** *** 1,5 **** # Microsoft Developer Studio Generated NMAKE File, Format Version 4.10 ! # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 --- 1,6 ---- # Microsoft Developer Studio Generated NMAKE File, Format Version 4.10 ! # This has been hand-edited way too many times. ! # A clean, manually generated makefile would be an improvement. # TARGTYPE "Win32 (x86) Application" 0x0101 # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 *************** CLEAN : *** 72,77 **** --- 73,80 ---- -@erase ".\Release\finalize.obj" -@erase ".\Release\finalize.sbr" -@erase ".\Release\gc.bsc" + -@erase ".\Release\gc_cpp.obj" + -@erase ".\Release\gc_cpp.sbr" -@erase ".\Release\gc.dll" -@erase ".\Release\gc.exp" -@erase ".\Release\gc.lib" *************** CLEAN : *** 111,120 **** CPP=cl.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "SILENT" /D "GC_BUILD" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "WIN32_THREADS" /FR /YX /c ! CPP_PROJ=/nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "SILENT" /D "GC_BUILD" /D\ "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D\ ! "WIN32_THREADS" /FR"$(INTDIR)/" /Fp"$(INTDIR)/gc.pch" /YX /Fo"$(INTDIR)/" /c CPP_OBJS=.\Release/ CPP_SBRS=.\Release/ --- 114,123 ---- CPP=cl.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I include /D "NDEBUG" /D "SILENT" /D "GC_BUILD" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "GC_WIN32_THREADS" /FR /YX /c ! CPP_PROJ=/nologo /MD /W3 /GX /O2 /I include /D "NDEBUG" /D "SILENT" /D "GC_BUILD" /D\ "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D\ ! "GC_WIN32_THREADS" /FR"$(INTDIR)/" /Fp"$(INTDIR)/gc.pch" /YX /Fo"$(INTDIR)/" /c CPP_OBJS=.\Release/ CPP_SBRS=.\Release/ *************** BSC32_SBRS= \ *** 155,160 **** --- 158,164 ---- ".\Release\dbg_mlc.sbr" \ ".\Release\dyn_load.sbr" \ ".\Release\finalize.sbr" \ + ".\Release\gc_cpp.sbr" \ ".\Release\headers.sbr" \ ".\Release\mach_dep.sbr" \ ".\Release\malloc.sbr" \ *************** LINK32_OBJS= \ *** 192,197 **** --- 196,202 ---- ".\Release\dbg_mlc.obj" \ ".\Release\dyn_load.obj" \ ".\Release\finalize.obj" \ + ".\Release\gc_cpp.obj" \ ".\Release\headers.obj" \ ".\Release\mach_dep.obj" \ ".\Release\malloc.obj" \ *************** CLEAN : *** 245,250 **** --- 250,257 ---- -@erase ".\Debug\dyn_load.sbr" -@erase ".\Debug\finalize.obj" -@erase ".\Debug\finalize.sbr" + -@erase ".\Debug\gc_cpp.obj" + -@erase ".\Debug\gc_cpp.sbr" -@erase ".\Debug\gc.bsc" -@erase ".\Debug\gc.dll" -@erase ".\Debug\gc.exp" *************** CLEAN : *** 289,298 **** CPP=cl.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "SILENT" /D "GC_BUILD" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "WIN32_THREADS" /FR /YX /c ! CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "SILENT" /D "GC_BUILD"\ /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D\ ! "WIN32_THREADS" /FR"$(INTDIR)/" /Fp"$(INTDIR)/gc.pch" /YX /Fo"$(INTDIR)/"\ /Fd"$(INTDIR)/" /c CPP_OBJS=.\Debug/ CPP_SBRS=.\Debug/ --- 296,305 ---- CPP=cl.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I include /D "_DEBUG" /D "SILENT" /D "GC_BUILD" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "GC_WIN32_THREADS" /FR /YX /c ! CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I include /D "_DEBUG" /D "SILENT" /D "GC_BUILD"\ /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D\ ! "GC_WIN32_THREADS" /FR"$(INTDIR)/" /Fp"$(INTDIR)/gc.pch" /YX /Fo"$(INTDIR)/"\ /Fd"$(INTDIR)/" /c CPP_OBJS=.\Debug/ CPP_SBRS=.\Debug/ *************** BSC32_SBRS= \ *** 334,339 **** --- 341,347 ---- ".\Debug\dbg_mlc.sbr" \ ".\Debug\dyn_load.sbr" \ ".\Debug\finalize.sbr" \ + ".\Debug\gc_cpp.sbr" \ ".\Debug\headers.sbr" \ ".\Debug\mach_dep.sbr" \ ".\Debug\malloc.sbr" \ *************** LINK32_OBJS= \ *** 371,376 **** --- 379,385 ---- ".\Debug\dbg_mlc.obj" \ ".\Debug\dyn_load.obj" \ ".\Debug\finalize.obj" \ + ".\Debug\gc_cpp.obj" \ ".\Debug\headers.obj" \ ".\Debug\mach_dep.obj" \ ".\Debug\malloc.obj" \ *************** CLEAN : *** 416,426 **** "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "WIN32_THREADS" /YX /c ! CPP_PROJ=/nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D\ ! "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "WIN32_THREADS"\ /Fp"$(INTDIR)/gctest.pch" /YX /Fo"$(INTDIR)/" /c CPP_OBJS=.\gctest\Release/ CPP_SBRS=.\. --- 425,438 ---- "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + test.c : tests\test.c + copy tests\test.c test.c + CPP=cl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I include /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "GC_WIN32_THREADS" /YX /c ! CPP_PROJ=/nologo /MD /W3 /GX /O2 /I include /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D\ ! "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "GC_WIN32_THREADS"\ /Fp"$(INTDIR)/gctest.pch" /YX /Fo"$(INTDIR)/" /c CPP_OBJS=.\gctest\Release/ CPP_SBRS=.\. *************** CLEAN : *** 504,512 **** CPP=cl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "WIN32_THREADS" /FR /YX /c ! CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS"\ ! /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "WIN32_THREADS" /FR"$(INTDIR)/"\ /Fp"$(INTDIR)/gctest.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c CPP_OBJS=.\gctest\Debug/ CPP_SBRS=.\gctest\Debug/ --- 516,524 ---- CPP=cl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "GC_WIN32_THREADS" /FR /YX /c ! CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I include /D "_DEBUG" /D "WIN32" /D "_WINDOWS"\ ! /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "GC_WIN32_THREADS" /FR"$(INTDIR)/"\ /Fp"$(INTDIR)/gctest.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c CPP_OBJS=.\gctest\Debug/ CPP_SBRS=.\gctest\Debug/ *************** CLEAN : *** 596,602 **** CPP=cl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /YX /c ! CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D\ "ALL_INTERIOR_POINTERS" /Fp"$(INTDIR)/cord.pch" /YX /Fo"$(INTDIR)/" /c CPP_OBJS=.\cord\Release/ CPP_SBRS=.\. --- 608,614 ---- CPP=cl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /YX /c ! CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "." /I include /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D\ "ALL_INTERIOR_POINTERS" /Fp"$(INTDIR)/cord.pch" /YX /Fo"$(INTDIR)/" /c CPP_OBJS=.\cord\Release/ CPP_SBRS=.\. *************** CLEAN : *** 688,694 **** CPP=cl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /YX /c ! CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /D "_DEBUG" /D "WIN32" /D\ "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /Fp"$(INTDIR)/cord.pch" /YX\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c CPP_OBJS=.\cord\Debug/ --- 700,706 ---- CPP=cl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /YX /c ! CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I include /D "_DEBUG" /D "WIN32" /D\ "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /Fp"$(INTDIR)/cord.pch" /YX\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c CPP_OBJS=.\cord\Debug/ *************** LINK32_OBJS= \ *** 763,777 **** ################################################################################ # Begin Source File SOURCE=.\reclaim.c !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_RECLA=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_RECLA=\ --- 775,839 ---- ################################################################################ # Begin Source File + SOURCE=.\gc_cpp.cpp + + !IF "$(CFG)" == "gc - Win32 Release" + + DEP_CPP_RECLA=\ + ".\include\private\gcconfig.h"\ + ".\include\gc.h"\ + ".\include\private\gc_hdrs.h"\ + ".\include\private\gc_priv.h"\ + ".\include\gc_cpp.h"\ + {$(INCLUDE)}"\sys\TYPES.H"\ + + NODEP_CPP_RECLA=\ + ".\th\PCR_Th.h"\ + ".\th\PCR_ThCrSec.h"\ + ".\th\PCR_ThCtl.h"\ + + + ".\Release\gc_cpp.obj" : $(SOURCE) $(DEP_CPP_RECLA) "$(INTDIR)" + + ".\Release\gc_cpp.sbr" : $(SOURCE) $(DEP_CPP_RECLA) "$(INTDIR)" + + + !ELSEIF "$(CFG)" == "gc - Win32 Debug" + + DEP_CPP_RECLA=\ + ".\include\private\gcconfig.h"\ + ".\include\gc.h"\ + ".\include\private\gc_hdrs.h"\ + ".\include\private\gc_priv.h"\ + ".\include\gc_cpp.h"\ + {$(INCLUDE)}"\sys\TYPES.H"\ + + NODEP_CPP_RECLA=\ + ".\th\PCR_Th.h"\ + ".\th\PCR_ThCrSec.h"\ + ".\th\PCR_ThCtl.h"\ + + + ".\Debug\gc_cpp.obj" : $(SOURCE) $(DEP_CPP_RECLA) "$(INTDIR)" + + ".\Debug\gc_cpp.sbr" : $(SOURCE) $(DEP_CPP_RECLA) "$(INTDIR)" + + + !ENDIF + + # End Source File + ################################################################################ + # Begin Source File + SOURCE=.\reclaim.c !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_RECLA=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_RECLA=\ *************** NODEP_CPP_RECLA=\ *** 788,797 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_RECLA=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_RECLA=\ --- 850,859 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_RECLA=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_RECLA=\ *************** NODEP_CPP_RECLA=\ *** 808,813 **** --- 870,876 ---- !ENDIF # End Source File + ################################################################################ # Begin Source File *************** SOURCE=.\os_dep.c *** 816,825 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_OS_DE=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ --- 879,888 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_OS_DE=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ *************** NODEP_CPP_OS_DE=\ *** 840,849 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_OS_DE=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ --- 903,912 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_OS_DE=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ *************** SOURCE=.\misc.c *** 872,881 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MISC_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MISC_=\ --- 935,944 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MISC_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MISC_=\ *************** NODEP_CPP_MISC_=\ *** 893,902 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MISC_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MISC_=\ --- 956,965 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MISC_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MISC_=\ *************** SOURCE=.\mark_rts.c *** 922,931 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MARK_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_=\ --- 985,994 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MARK_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_=\ *************** NODEP_CPP_MARK_=\ *** 942,951 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MARK_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_=\ --- 1005,1014 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MARK_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_=\ *************** SOURCE=.\mach_dep.c *** 970,979 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MACH_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MACH_=\ --- 1033,1042 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MACH_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MACH_=\ *************** NODEP_CPP_MACH_=\ *** 990,999 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MACH_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MACH_=\ --- 1053,1062 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MACH_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MACH_=\ *************** SOURCE=.\headers.c *** 1018,1027 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_HEADE=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_HEADE=\ --- 1081,1090 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_HEADE=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_HEADE=\ *************** NODEP_CPP_HEADE=\ *** 1038,1047 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_HEADE=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_HEADE=\ --- 1101,1110 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_HEADE=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_HEADE=\ *************** SOURCE=.\alloc.c *** 1066,1075 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_ALLOC=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLOC=\ --- 1129,1138 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_ALLOC=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLOC=\ *************** NODEP_CPP_ALLOC=\ *** 1086,1095 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_ALLOC=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLOC=\ --- 1149,1158 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_ALLOC=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLOC=\ *************** SOURCE=.\allchblk.c *** 1114,1123 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_ALLCH=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLCH=\ --- 1177,1186 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_ALLCH=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLCH=\ *************** NODEP_CPP_ALLCH=\ *** 1134,1143 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_ALLCH=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLCH=\ --- 1197,1206 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_ALLCH=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLCH=\ *************** SOURCE=.\stubborn.c *** 1162,1171 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_STUBB=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_STUBB=\ --- 1225,1234 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_STUBB=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_STUBB=\ *************** NODEP_CPP_STUBB=\ *** 1182,1191 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_STUBB=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_STUBB=\ --- 1245,1254 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_STUBB=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_STUBB=\ *************** SOURCE=.\obj_map.c *** 1210,1219 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_OBJ_M=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_OBJ_M=\ --- 1273,1282 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_OBJ_M=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_OBJ_M=\ *************** NODEP_CPP_OBJ_M=\ *** 1230,1239 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_OBJ_M=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_OBJ_M=\ --- 1293,1302 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_OBJ_M=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_OBJ_M=\ *************** SOURCE=.\new_hblk.c *** 1258,1267 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_NEW_H=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_NEW_H=\ --- 1321,1330 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_NEW_H=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_NEW_H=\ *************** NODEP_CPP_NEW_H=\ *** 1278,1287 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_NEW_H=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_NEW_H=\ --- 1341,1350 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_NEW_H=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_NEW_H=\ *************** SOURCE=.\mark.c *** 1306,1316 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MARK_C=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_C=\ --- 1369,1380 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MARK_C=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_C=\ *************** NODEP_CPP_MARK_C=\ *** 1327,1337 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MARK_C=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_C=\ --- 1391,1402 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MARK_C=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_C=\ *************** SOURCE=.\malloc.c *** 1356,1365 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MALLO=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLO=\ --- 1421,1430 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MALLO=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLO=\ *************** NODEP_CPP_MALLO=\ *** 1376,1385 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MALLO=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLO=\ --- 1441,1450 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MALLO=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLO=\ *************** SOURCE=.\mallocx.c *** 1404,1413 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MALLX=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLX=\ --- 1469,1478 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MALLX=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLX=\ *************** NODEP_CPP_MALLX=\ *** 1424,1433 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MALLX=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLX=\ --- 1489,1498 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MALLX=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLX=\ *************** SOURCE=.\finalize.c *** 1452,1462 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_FINAL=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_FINAL=\ --- 1517,1528 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_FINAL=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_FINAL=\ *************** NODEP_CPP_FINAL=\ *** 1473,1483 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_FINAL=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_FINAL=\ --- 1539,1550 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_FINAL=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_FINAL=\ *************** SOURCE=.\dbg_mlc.c *** 1502,1511 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_DBG_M=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_DBG_M=\ --- 1569,1578 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_DBG_M=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_DBG_M=\ *************** NODEP_CPP_DBG_M=\ *** 1522,1531 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_DBG_M=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_DBG_M=\ --- 1589,1598 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_DBG_M=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_DBG_M=\ *************** SOURCE=.\blacklst.c *** 1550,1559 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_BLACK=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_BLACK=\ --- 1617,1626 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_BLACK=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_BLACK=\ *************** NODEP_CPP_BLACK=\ *** 1570,1579 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_BLACK=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_BLACK=\ --- 1637,1646 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_BLACK=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_BLACK=\ *************** SOURCE=.\typd_mlc.c *** 1598,1609 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_TYPD_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ ! ".\gc_typed.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_TYPD_=\ --- 1665,1677 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_TYPD_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ ! ".\include\gc_typed.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_TYPD_=\ *************** NODEP_CPP_TYPD_=\ *** 1620,1631 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_TYPD_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ ! ".\gc_typed.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_TYPD_=\ --- 1688,1700 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_TYPD_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ ! ".\include\gc_typed.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_TYPD_=\ *************** SOURCE=.\ptr_chck.c *** 1650,1660 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_PTR_C=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_PTR_C=\ --- 1719,1730 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_PTR_C=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_PTR_C=\ *************** NODEP_CPP_PTR_C=\ *** 1671,1681 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_PTR_C=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_PTR_C=\ --- 1741,1752 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_PTR_C=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_PTR_C=\ *************** SOURCE=.\dyn_load.c *** 1700,1709 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_DYN_L=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ --- 1771,1780 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_DYN_L=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ *************** NODEP_CPP_DYN_L=\ *** 1723,1732 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_DYN_L=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ --- 1794,1803 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_DYN_L=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ *************** SOURCE=.\win32_threads.c *** 1754,1763 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_WIN32=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_WIN32=\ --- 1825,1834 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_WIN32=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_WIN32=\ *************** NODEP_CPP_WIN32=\ *** 1774,1783 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_WIN32=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_WIN32=\ --- 1845,1854 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_WIN32=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_WIN32=\ *************** SOURCE=.\checksums.c *** 1802,1811 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_CHECK=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_CHECK=\ --- 1873,1882 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_CHECK=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_CHECK=\ *************** NODEP_CPP_CHECK=\ *** 1822,1831 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_CHECK=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_CHECK=\ --- 1893,1902 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_CHECK=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_CHECK=\ *************** NODEP_CPP_CHECK=\ *** 1876,1888 **** ################################################################################ # Begin Source File ! SOURCE=.\test.c DEP_CPP_TEST_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ ! ".\gc_typed.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_TEST_=\ --- 1947,1959 ---- ################################################################################ # Begin Source File ! SOURCE=.\tests\test.c DEP_CPP_TEST_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ ! ".\include\gc_typed.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_TEST_=\ *************** NODEP_CPP_TEST_=\ *** 1944,1956 **** SOURCE=.\cord\de_win.c DEP_CPP_DE_WI=\ ! ".\cord\cord.h"\ ".\cord\de_cmds.h"\ ".\cord\de_win.h"\ ! ".\cord\private\cord_pos.h"\ NODEP_CPP_DE_WI=\ ! ".\cord\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" --- 2015,2027 ---- SOURCE=.\cord\de_win.c DEP_CPP_DE_WI=\ ! ".\include\cord.h"\ ".\cord\de_cmds.h"\ ".\cord\de_win.h"\ ! ".\include\private\cord_pos.h"\ NODEP_CPP_DE_WI=\ ! ".\include\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" *************** NODEP_CPP_DE_WI=\ *** 1975,1987 **** SOURCE=.\cord\de.c DEP_CPP_DE_C2e=\ ! ".\cord\cord.h"\ ".\cord\de_cmds.h"\ ".\cord\de_win.h"\ ! ".\cord\private\cord_pos.h"\ NODEP_CPP_DE_C2e=\ ! ".\cord\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" --- 2046,2058 ---- SOURCE=.\cord\de.c DEP_CPP_DE_C2e=\ ! ".\include\cord.h"\ ".\cord\de_cmds.h"\ ".\cord\de_win.h"\ ! ".\include\private\cord_pos.h"\ NODEP_CPP_DE_C2e=\ ! ".\include\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" *************** NODEP_CPP_DE_C2e=\ *** 2006,2017 **** SOURCE=.\cord\cordxtra.c DEP_CPP_CORDX=\ ! ".\cord\cord.h"\ ! ".\cord\ec.h"\ ! ".\cord\private\cord_pos.h"\ NODEP_CPP_CORDX=\ ! ".\cord\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" --- 2077,2088 ---- SOURCE=.\cord\cordxtra.c DEP_CPP_CORDX=\ ! ".\include\cord.h"\ ! ".\include\ec.h"\ ! ".\include\private\cord_pos.h"\ NODEP_CPP_CORDX=\ ! ".\include\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" *************** NODEP_CPP_CORDX=\ *** 2036,2046 **** SOURCE=.\cord\cordbscs.c DEP_CPP_CORDB=\ ! ".\cord\cord.h"\ ! ".\cord\private\cord_pos.h"\ NODEP_CPP_CORDB=\ ! ".\cord\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" --- 2107,2117 ---- SOURCE=.\cord\cordbscs.c DEP_CPP_CORDB=\ ! ".\include\cord.h"\ ! ".\include\private\cord_pos.h"\ NODEP_CPP_CORDB=\ ! ".\include\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" diff -Nrc3pad gcc-3.0.4/boehm-gc/OS2_MAKEFILE gcc-3.1/boehm-gc/OS2_MAKEFILE *** gcc-3.0.4/boehm-gc/OS2_MAKEFILE Wed Jun 30 12:42:37 1999 --- gcc-3.1/boehm-gc/OS2_MAKEFILE Fri Aug 17 18:30:45 2001 *************** CFLAGS= /O /Q /DSILENT /DSMALL_CONFIG /D *** 17,23 **** all: $(OBJS) gctest.exe cord\cordtest.exe ! $(OBJS) test.obj: gc_priv.h gc_hdrs.h gc.h ## ERASE THE LIB FIRST - if it is already there then this command will fail ## (make sure its there or erase will fail!) --- 17,23 ---- all: $(OBJS) gctest.exe cord\cordtest.exe ! $(OBJS) test.obj: include\private\gc_priv.h include\private\gc_hdrs.h include\gc.h include\private\gcconfig.h ## ERASE THE LIB FIRST - if it is already there then this command will fail ## (make sure its there or erase will fail!) *************** mach_dep.obj: mach_dep.c *** 32,45 **** gctest.exe: test.obj gc.lib $(CC) $(CFLAGS) /B"/STACK:524288" /Fegctest test.obj gc.lib ! cord\cordbscs.obj: cord\cordbscs.c cord\cord.h cord\private\cord_pos.h $(CC) $(CFLAGS) /C /Focord\cordbscs cord\cordbscs.c ! cord\cordxtra.obj: cord\cordxtra.c cord\cord.h cord\private\cord_pos.h cord\ec.h $(CC) $(CFLAGS) /C /Focord\cordxtra cord\cordxtra.c ! cord\cordprnt.obj: cord\cordprnt.c cord\cord.h cord\private\cord_pos.h cord\ec.h $(CC) $(CFLAGS) /C /Focord\cordprnt cord\cordprnt.c ! cord\cordtest.exe: cord\cordtest.c cord\cord.h cord\private\cord_pos.h cord\ec.h $(CORDOBJS) gc.lib $(CC) $(CFLAGS) /B"/STACK:65536" /Fecord\cordtest cord\cordtest.c gc.lib $(CORDOBJS) --- 32,45 ---- gctest.exe: test.obj gc.lib $(CC) $(CFLAGS) /B"/STACK:524288" /Fegctest test.obj gc.lib ! cord\cordbscs.obj: cord\cordbscs.c include\cord.h include\private\cord_pos.h $(CC) $(CFLAGS) /C /Focord\cordbscs cord\cordbscs.c ! cord\cordxtra.obj: cord\cordxtra.c include\cord.h include\private\cord_pos.h include\ec.h $(CC) $(CFLAGS) /C /Focord\cordxtra cord\cordxtra.c ! cord\cordprnt.obj: cord\cordprnt.c include\cord.h include\private\cord_pos.h include\ec.h $(CC) $(CFLAGS) /C /Focord\cordprnt cord\cordprnt.c ! cord\cordtest.exe: cord\cordtest.c include\cord.h include\private\cord_pos.h include\ec.h $(CORDOBJS) gc.lib $(CC) $(CFLAGS) /B"/STACK:65536" /Fecord\cordtest cord\cordtest.c gc.lib $(CORDOBJS) diff -Nrc3pad gcc-3.0.4/boehm-gc/README gcc-3.1/boehm-gc/README *** gcc-3.0.4/boehm-gc/README Tue Jun 20 01:04:58 2000 --- gcc-3.1/boehm-gc/README Thu Jan 1 00:00:00 1970 *************** *** 1,1646 **** - Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers - Copyright (c) 1991-1996 by Xerox Corporation. All rights reserved. - Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. - Copyright (c) 1999 by Hewlett-Packard Company. All rights reserved. - - [ This version of the collector modified for use in libgcj. - See the file ChangeLog for details ] - - THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - - Permission is hereby granted to use or copy this program - for any purpose, provided the above notices are retained on all copies. - Permission to modify the code and to distribute modified code is granted, - provided the above notices are retained, and a notice that the code was - modified is included with the above copyright notice. - - This is version 5.1 of a conservative garbage collector for C and C++. - - You might find a more recent version of this at - - http://www.hpl.hp.com/personal/Hans_Boehm/gc - - HISTORY - - - Early versions of this collector were developed as a part of research - projects supported in part by the National Science Foundation - and the Defense Advance Research Projects Agency. - Much of the code was rewritten by Hans-J. Boehm (boehm@acm.org) at Xerox PARC, - SGI, and HP Labs. - - Some other contributors: - - More recent contributors are mentioned in the modification history at the - end of this file. My apologies for any omissions. - - The SPARC specific code was contributed by Mark Weiser - (weiser@parc.xerox.com). The Encore Multimax modifications were supplied by - Kevin Kenny (kenny@m.cs.uiuc.edu). The adaptation to the RT is largely due - to Vernon Lee (scorpion@rice.edu), on machines made available by IBM. - Much of the HP specific code and a number of good suggestions for improving the - generic code are due to Walter Underwood (wunder@hp-ses.sde.hp.com). - Robert Brazile (brazile@diamond.bbn.com) originally supplied the ULTRIX code. - Al Dosser (dosser@src.dec.com) and Regis Cridlig (Regis.Cridlig@cl.cam.ac.uk) - subsequently provided updates and information on variation between ULTRIX - systems. Parag Patel (parag@netcom.com) supplied the A/UX code. - Jesper Peterson(jep@mtiame.mtia.oz.au), Michel Schinz, and - Martin Tauchmann (martintauchmann@bigfoot.com) supplied the Amiga port. - Thomas Funke (thf@zelator.in-berlin.de(?)) and - Brian D.Carlstrom (bdc@clark.lcs.mit.edu) supplied the NeXT ports. - Douglas Steel (doug@wg.icl.co.uk) provided ICL DRS6000 code. - Bill Janssen (janssen@parc.xerox.com) supplied the SunOS dynamic loader - specific code. Manuel Serrano (serrano@cornas.inria.fr) supplied linux and - Sony News specific code. Al Dosser provided Alpha/OSF/1 code. He and - Dave Detlefs(detlefs@src.dec.com) also provided several generic bug fixes. - Alistair G. Crooks(agc@uts.amdahl.com) supplied the NetBSD and 386BSD ports. - Jeffrey Hsu (hsu@soda.berkeley.edu) provided the FreeBSD port. - Brent Benson (brent@jade.ssd.csd.harris.com) ported the collector to - a Motorola 88K processor running CX/UX (Harris NightHawk). - Ari Huttunen (Ari.Huttunen@hut.fi) generalized the OS/2 port to - nonIBM development environments (a nontrivial task). - Patrick Beard (beard@cs.ucdavis.edu) provided the initial MacOS port. - David Chase, then at Olivetti Research, suggested several improvements. - Scott Schwartz (schwartz@groucho.cse.psu.edu) supplied some of the - code to save and print call stacks for leak detection on a SPARC. - Jesse Hull and John Ellis supplied the C++ interface code. - Zhong Shao performed much of the experimentation that led to the - current typed allocation facility. (His dynamic type inference code hasn't - made it into the released version of the collector, yet.) - (Blame for misinstallation of these modifications goes to the first author, - however.) - - OVERVIEW - - This is intended to be a general purpose, garbage collecting storage - allocator. The algorithms used are described in: - - Boehm, H., and M. Weiser, "Garbage Collection in an Uncooperative Environment", - Software Practice & Experience, September 1988, pp. 807-820. - - Boehm, H., A. Demers, and S. Shenker, "Mostly Parallel Garbage Collection", - Proceedings of the ACM SIGPLAN '91 Conference on Programming Language Design - and Implementation, SIGPLAN Notices 26, 6 (June 1991), pp. 157-164. - - Boehm, H., "Space Efficient Conservative Garbage Collection", Proceedings - of the ACM SIGPLAN '91 Conference on Programming Language Design and - Implementation, SIGPLAN Notices 28, 6 (June 1993), pp. 197-206. - - Possible interactions between the collector and optimizing compilers are - discussed in - - Boehm, H., and D. Chase, "A Proposal for GC-safe C Compilation", - The Journal of C Language Translation 4, 2 (December 1992). - - and - - Boehm H., "Simple GC-safe Compilation", Proceedings - of the ACM SIGPLAN '96 Conference on Programming Language Design and - Implementation. - - (Both are also available from - http://reality.sgi.com/boehm/papers/, among other places.) - - Unlike the collector described in the second reference, this collector - operates either with the mutator stopped during the entire collection - (default) or incrementally during allocations. (The latter is supported - on only a few machines.) It does not rely on threads, but is intended - to be thread-safe. - - Some of the ideas underlying the collector have previously been explored - by others. (Doug McIlroy wrote a vaguely similar collector that is part of - version 8 UNIX (tm).) However none of this work appears to have been widely - disseminated. - - Rudimentary tools for use of the collector as a leak detector are included, as - is a fairly sophisticated string package "cord" that makes use of the collector. - (See cord/README.) - - - GENERAL DESCRIPTION - - This is a garbage collecting storage allocator that is intended to be - used as a plug-in replacement for C's malloc. - - Since the collector does not require pointers to be tagged, it does not - attempt to ensure that all inaccessible storage is reclaimed. However, - in our experience, it is typically more successful at reclaiming unused - memory than most C programs using explicit deallocation. Unlike manually - introduced leaks, the amount of unreclaimed memory typically stays - bounded. - - In the following, an "object" is defined to be a region of memory allocated - by the routines described below. - - Any objects not intended to be collected must be pointed to either - from other such accessible objects, or from the registers, - stack, data, or statically allocated bss segments. Pointers from - the stack or registers may point to anywhere inside an object. - The same is true for heap pointers if the collector is compiled with - ALL_INTERIOR_POINTERS defined, as is now the default. - - Compiling without ALL_INTERIOR_POINTERS may reduce accidental retention - of garbage objects, by requiring pointers from the heap to to the beginning - of an object. But this no longer appears to be a significant - issue for most programs. - - There are a number of routines which modify the pointer recognition - algorithm. GC_register_displacement allows certain interior pointers - to be recognized even if ALL_INTERIOR_POINTERS is nor defined. - GC_malloc_ignore_off_page allows some pointers into the middle of large objects - to be disregarded, greatly reducing the probablility of accidental - retention of large objects. For most purposes it seems best to compile - with ALL_INTERIOR_POINTERS and to use GC_malloc_ignore_off_page if - you get collector warnings from allocations of very large objects. - See README.debugging for details. - - Note that pointers inside memory allocated by the standard "malloc" are not - seen by the garbage collector. Thus objects pointed to only from such a - region may be prematurely deallocated. It is thus suggested that the - standard "malloc" be used only for memory regions, such as I/O buffers, that - are guaranteed not to contain pointers to garbage collectable memory. - Pointers in C language automatic, static, or register variables, - are correctly recognized. (Note that GC_malloc_uncollectable has semantics - similar to standard malloc, but allocates objects that are traced by the - collector.) - - The collector does not always know how to find pointers in data - areas that are associated with dynamic libraries. This is easy to - remedy IF you know how to find those data areas on your operating - system (see GC_add_roots). Code for doing this under SunOS, IRIX 5.X and 6.X, - HP/UX, Alpha OSF/1, Linux, and win32 is included and used by default. (See - README.win32 for win32 details.) On other systems pointers from dynamic - library data areas may not be considered by the collector. - - Note that the garbage collector does not need to be informed of shared - read-only data. However if the shared library mechanism can introduce - discontiguous data areas that may contain pointers, then the collector does - need to be informed. - - Signal processing for most signals may be deferred during collection, - and during uninterruptible parts of the allocation process. Unlike - standard ANSI C mallocs, it can be safe to invoke malloc - from a signal handler while another malloc is in progress, provided - the original malloc is not restarted. (Empirically, many UNIX - applications already assume this.) To obtain this level of signal - safety, remove the definition of -DNO_SIGNALS in Makefile. This incurs - a minor performance penalty, and hence is no longer the default. - - The allocator/collector can also be configured for thread-safe operation. - (Full signal safety can also be achieved, but only at the cost of two system - calls per malloc, which is usually unacceptable.) - - INSTALLATION AND PORTABILITY - - As distributed, the macro SILENT is defined in Makefile. - In the event of problems, this can be removed to obtain a moderate - amount of descriptive output for each collection. - (The given statistics exhibit a few peculiarities. - Things don't appear to add up for a variety of reasons, most notably - fragmentation losses. These are probably much more significant for the - contrived program "test.c" than for your application.) - - Note that typing "make test" will automatically build the collector - and then run setjmp_test and gctest. Setjmp_test will give you information - about configuring the collector, which is useful primarily if you have - a machine that's not already supported. Gctest is a somewhat superficial - test of collector functionality. Failure is indicated by a core dump or - a message to the effect that the collector is broken. Gctest takes about - 35 seconds to run on a SPARCstation 2. On a slower machine, - expect it to take a while. It may use up to 8 MB of memory. (The - multi-threaded version will use more.) "Make test" will also, as - its last step, attempt to build and test the "cord" string library. - This will fail without an ANSI C compiler. - - The Makefile will generate a library gc.a which you should link against. - Typing "make cords" will add the cord library to gc.a. - Note that this requires an ANSI C compiler. - - It is suggested that if you need to replace a piece of the collector - (e.g. GC_mark_rts.c) you simply list your version ahead of gc.a on the - work.) - ld command line, rather than replacing the one in gc.a. (This will - generate numerous warnings under some versions of AIX, but it still - works.) - - All include files that need to be used by clients will be put in the - include subdirectory. (Normally this is just gc.h. "Make cords" adds - "cord.h" and "ec.h".) - - The collector currently is designed to run essentially unmodified on - machines that use a flat 32-bit or 64-bit address space. - That includes the vast majority of Workstations and X86 (X >= 3) PCs. - (The list here was deleted because it was getting too long and constantly - out of date.) - It does NOT run under plain 16-bit DOS or Windows 3.X. There are however - various packages (e.g. win32s, djgpp) that allow flat 32-bit address - applications to run under those systemsif the have at least an 80386 processor, - and several of those are compatible with the collector. - - In a few cases (Amiga, OS/2, Win32, MacOS) a separate makefile - or equivalent is supplied. Many of these have separate README.system - files. - - Dynamic libraries are completely supported only under SunOS - (and even that support is not functional on the last Sun 3 release), - IRIX 5&6, HP-PA, Win32 (not Win32S) and OSF/1 on DEC AXP machines. - On other machines we recommend that you do one of the following: - - 1) Add dynamic library support (and send us the code). - 2) Use static versions of the libraries. - 3) Arrange for dynamic libraries to use the standard malloc. - This is still dangerous if the library stores a pointer to a - garbage collected object. But nearly all standard interfaces - prohibit this, because they deal correctly with pointers - to stack allocated objects. (Strtok is an exception. Don't - use it.) - - In all cases we assume that pointer alignment is consistent with that - enforced by the standard C compilers. If you use a nonstandard compiler - you may have to adjust the alignment parameters defined in gc_priv.h. - - A port to a machine that is not byte addressed, or does not use 32 bit - or 64 bit addresses will require a major effort. A port to plain MSDOS - or win16 is hard. - - For machines not already mentioned, or for nonstandard compilers, the - following are likely to require change: - - 1. The parameters in gcconfig.h. - The parameters that will usually require adjustment are - STACKBOTTOM, ALIGNMENT and DATASTART. Setjmp_test - prints its guesses of the first two. - DATASTART should be an expression for computing the - address of the beginning of the data segment. This can often be - &etext. But some memory management units require that there be - some unmapped space between the text and the data segment. Thus - it may be more complicated. On UNIX systems, this is rarely - documented. But the adb "$m" command may be helpful. (Note - that DATASTART will usually be a function of &etext. Thus a - single experiment is usually insufficient.) - STACKBOTTOM is used to initialize GC_stackbottom, which - should be a sufficient approximation to the coldest stack address. - On some machines, it is difficult to obtain such a value that is - valid across a variety of MMUs, OS releases, etc. A number of - alternatives exist for using the collector in spite of this. See the - discussion in gcconfig.h immediately preceding the various - definitions of STACKBOTTOM. - - 2. mach_dep.c. - The most important routine here is one to mark from registers. - The distributed file includes a generic hack (based on setjmp) that - happens to work on many machines, and may work on yours. Try - compiling and running setjmp_t.c to see whether it has a chance of - working. (This is not correct C, so don't blame your compiler if it - doesn't work. Based on limited experience, register window machines - are likely to cause trouble. If your version of setjmp claims that - all accessible variables, including registers, have the value they - had at the time of the longjmp, it also will not work. Vanilla 4.2 BSD - on Vaxen makes such a claim. SunOS does not.) - If your compiler does not allow in-line assembly code, or if you prefer - not to use such a facility, mach_dep.c may be replaced by a .s file - (as we did for the MIPS machine and the PC/RT). - At this point enough architectures are supported by mach_dep.c - that you will rarely need to do more than adjust for assembler - syntax. - - 3. os_dep.c (and gc_priv.h). - Several kinds of operating system dependent routines reside here. - Many are optional. Several are invoked only through corresponding - macros in gc_priv.h, which may also be redefined as appropriate. - The routine GC_register_data_segments is crucial. It registers static - data areas that must be traversed by the collector. (User calls to - GC_add_roots may sometimes be used for similar effect.) - Routines to obtain memory from the OS also reside here. - Alternatively this can be done entirely by the macro GET_MEM - defined in gc_priv.h. Routines to disable and reenable signals - also reside here if they are need by the macros DISABLE_SIGNALS - and ENABLE_SIGNALS defined in gc_priv.h. - In a multithreaded environment, the macros LOCK and UNLOCK - in gc_priv.h will need to be suitably redefined. - The incremental collector requires page dirty information, which - is acquired through routines defined in os_dep.c. Unless directed - otherwise by gcconfig.h, these are implemented as stubs that simply - treat all pages as dirty. (This of course makes the incremental - collector much less useful.) - - 4. dyn_load.c - This provides a routine that allows the collector to scan data - segments associated with dynamic libraries. Often it is not - necessary to provide this routine unless user-written dynamic - libraries are used. - - For a different version of UN*X or different machines using the - Motorola 68000, Vax, SPARC, 80386, NS 32000, PC/RT, or MIPS architecture, - it should frequently suffice to change definitions in gcconfig.h. - - - THE C INTERFACE TO THE ALLOCATOR - - The following routines are intended to be directly called by the user. - Note that usually only GC_malloc is necessary. GC_clear_roots and GC_add_roots - calls may be required if the collector has to trace from nonstandard places - (e.g. from dynamic library data areas on a machine on which the - collector doesn't already understand them.) On some machines, it may - be desirable to set GC_stacktop to a good approximation of the stack base. - (This enhances code portability on HP PA machines, since there is no - good way for the collector to compute this value.) Client code may include - "gc.h", which defines all of the following, plus many others. - - 1) GC_malloc(nbytes) - - allocate an object of size nbytes. Unlike malloc, the object is - cleared before being returned to the user. Gc_malloc will - invoke the garbage collector when it determines this to be appropriate. - GC_malloc may return 0 if it is unable to acquire sufficient - space from the operating system. This is the most probable - consequence of running out of space. Other possible consequences - are that a function call will fail due to lack of stack space, - or that the collector will fail in other ways because it cannot - maintain its internal data structures, or that a crucial system - process will fail and take down the machine. Most of these - possibilities are independent of the malloc implementation. - - 2) GC_malloc_atomic(nbytes) - - allocate an object of size nbytes that is guaranteed not to contain any - pointers. The returned object is not guaranteed to be cleared. - (Can always be replaced by GC_malloc, but results in faster collection - times. The collector will probably run faster if large character - arrays, etc. are allocated with GC_malloc_atomic than if they are - statically allocated.) - - 3) GC_realloc(object, new_size) - - change the size of object to be new_size. Returns a pointer to the - new object, which may, or may not, be the same as the pointer to - the old object. The new object is taken to be atomic iff the old one - was. If the new object is composite and larger than the original object, - then the newly added bytes are cleared (we hope). This is very likely - to allocate a new object, unless MERGE_SIZES is defined in gc_priv.h. - Even then, it is likely to recycle the old object only if the object - is grown in small additive increments (which, we claim, is generally bad - coding practice.) - - 4) GC_free(object) - - explicitly deallocate an object returned by GC_malloc or - GC_malloc_atomic. Not necessary, but can be used to minimize - collections if performance is critical. Probably a performance - loss for very small objects (<= 8 bytes). - - 5) GC_expand_hp(bytes) - - Explicitly increase the heap size. (This is normally done automatically - if a garbage collection failed to GC_reclaim enough memory. Explicit - calls to GC_expand_hp may prevent unnecessarily frequent collections at - program startup.) - - 6) GC_malloc_ignore_off_page(bytes) - - identical to GC_malloc, but the client promises to keep a pointer to - the somewhere within the first 256 bytes of the object while it is - live. (This pointer should nortmally be declared volatile to prevent - interference from compiler optimizations.) This is the recommended - way to allocate anything that is likely to be larger than 100Kbytes - or so. (GC_malloc may result in failure to reclaim such objects.) - - 7) GC_set_warn_proc(proc) - - Can be used to redirect warnings from the collector. Such warnings - should be rare, and should not be ignored during code development. - - 8) GC_enable_incremental() - - Enables generational and incremental collection. Useful for large - heaps on machines that provide access to page dirty information. - Some dirty bit implementations may interfere with debugging - (by catching address faults) and place restrictions on heap arguments - to system calls (since write faults inside a system call may not be - handled well). - - 9) Several routines to allow for registration of finalization code. - User supplied finalization code may be invoked when an object becomes - unreachable. To call (*f)(obj, x) when obj becomes inaccessible, use - GC_register_finalizer(obj, f, x, 0, 0); - For more sophisticated uses, and for finalization ordering issues, - see gc.h. - - The global variable GC_free_space_divisor may be adjusted up from its - default value of 4 to use less space and more collection time, or down for - the opposite effect. Setting it to 1 or 0 will effectively disable collections - and cause all allocations to simply grow the heap. - - The variable GC_non_gc_bytes, which is normally 0, may be changed to reflect - the amount of memory allocated by the above routines that should not be - considered as a candidate for collection. Careless use may, of course, result - in excessive memory consumption. - - Some additional tuning is possible through the parameters defined - near the top of gc_priv.h. - - If only GC_malloc is intended to be used, it might be appropriate to define: - - #define malloc(n) GC_malloc(n) - #define calloc(m,n) GC_malloc((m)*(n)) - - For small pieces of VERY allocation intensive code, gc_inl.h - includes some allocation macros that may be used in place of GC_malloc - and friends. - - All externally visible names in the garbage collector start with "GC_". - To avoid name conflicts, client code should avoid this prefix, except when - accessing garbage collector routines or variables. - - There are provisions for allocation with explicit type information. - This is rarely necessary. Details can be found in gc_typed.h. - - THE C++ INTERFACE TO THE ALLOCATOR: - - The Ellis-Hull C++ interface to the collector is included in - the collector distribution. If you intend to use this, type - "make c++" after the initial build of the collector is complete. - See gc_cpp.h for the definition of the interface. This interface - tries to approximate the Ellis-Detlefs C++ garbage collection - proposal without compiler changes. - - Cautions: - 1. Arrays allocated without new placement syntax are - allocated as uncollectable objects. They are traced by the - collector, but will not be reclaimed. - - 2. Failure to use "make c++" in combination with (1) will - result in arrays allocated using the default new operator. - This is likely to result in disaster without linker warnings. - - 3. If your compiler supports an overloaded new[] operator, - then gc_cpp.cc and gc_cpp.h should be suitably modified. - - 4. Many current C++ compilers have deficiencies that - break some of the functionality. See the comments in gc_cpp.h - for suggested workarounds. - - USE AS LEAK DETECTOR: - - The collector may be used to track down leaks in C programs that are - intended to run with malloc/free (e.g. code with extreme real-time or - portability constraints). To do so define FIND_LEAK in Makefile - This will cause the collector to invoke the report_leak - routine defined near the top of reclaim.c whenever an inaccessible - object is found that has not been explicitly freed. The collector will - no longer reclaim inaccessible memory; in this form it is purely a - debugging tool. - Productive use of this facility normally involves redefining report_leak - to do something more intelligent. This typically requires annotating - objects with additional information (e.g. creation time stack trace) that - identifies their origin. Such code is typically not very portable, and is - not included here, except on SPARC machines. - If all objects are allocated with GC_DEBUG_MALLOC (see next section), - then the default version of report_leak will report the source file - and line number at which the leaked object was allocated. This may - sometimes be sufficient. (On SPARC/SUNOS4 machines, it will also report - a cryptic stack trace. This can often be turned into a sympolic stack - trace by invoking program "foo" with "callprocs foo". Callprocs is - a short shell script that invokes adb to expand program counter values - to symbolic addresses. It was largely supplied by Scott Schwartz.) - Note that the debugging facilities described in the next section can - sometimes be slightly LESS effective in leak finding mode, since in - leak finding mode, GC_debug_free actually results in reuse of the object. - (Otherwise the object is simply marked invalid.) Also note that the test - program is not designed to run meaningfully in FIND_LEAK mode. - Use "make gc.a" to build the collector. - - DEBUGGING FACILITIES: - - The routines GC_debug_malloc, GC_debug_malloc_atomic, GC_debug_realloc, - and GC_debug_free provide an alternate interface to the collector, which - provides some help with memory overwrite errors, and the like. - Objects allocated in this way are annotated with additional - information. Some of this information is checked during garbage - collections, and detected inconsistencies are reported to stderr. - - Simple cases of writing past the end of an allocated object should - be caught if the object is explicitly deallocated, or if the - collector is invoked while the object is live. The first deallocation - of an object will clear the debugging info associated with an - object, so accidentally repeated calls to GC_debug_free will report the - deallocation of an object without debugging information. Out of - memory errors will be reported to stderr, in addition to returning - NIL. - - GC_debug_malloc checking during garbage collection is enabled - with the first call to GC_debug_malloc. This will result in some - slowdown during collections. If frequent heap checks are desired, - this can be achieved by explicitly invoking GC_gcollect, e.g. from - the debugger. - - GC_debug_malloc allocated objects should not be passed to GC_realloc - or GC_free, and conversely. It is however acceptable to allocate only - some objects with GC_debug_malloc, and to use GC_malloc for other objects, - provided the two pools are kept distinct. In this case, there is a very - low probablility that GC_malloc allocated objects may be misidentified as - having been overwritten. This should happen with probability at most - one in 2**32. This probability is zero if GC_debug_malloc is never called. - - GC_debug_malloc, GC_malloc_atomic, and GC_debug_realloc take two - additional trailing arguments, a string and an integer. These are not - interpreted by the allocator. They are stored in the object (the string is - not copied). If an error involving the object is detected, they are printed. - - The macros GC_MALLOC, GC_MALLOC_ATOMIC, GC_REALLOC, GC_FREE, and - GC_REGISTER_FINALIZER are also provided. These require the same arguments - as the corresponding (nondebugging) routines. If gc.h is included - with GC_DEBUG defined, they call the debugging versions of these - functions, passing the current file name and line number as the two - extra arguments, where appropriate. If gc.h is included without GC_DEBUG - defined, then all these macros will instead be defined to their nondebugging - equivalents. (GC_REGISTER_FINALIZER is necessary, since pointers to - objects with debugging information are really pointers to a displacement - of 16 bytes form the object beginning, and some translation is necessary - when finalization routines are invoked. For details, about what's stored - in the header, see the definition of the type oh in debug_malloc.c) - - INCREMENTAL/GENERATIONAL COLLECTION: - - The collector normally interrupts client code for the duration of - a garbage collection mark phase. This may be unacceptable if interactive - response is needed for programs with large heaps. The collector - can also run in a "generational" mode, in which it usually attempts to - collect only objects allocated since the last garbage collection. - Furthermore, in this mode, garbage collections run mostly incrementally, - with a small amount of work performed in response to each of a large number of - GC_malloc requests. - - This mode is enabled by a call to GC_enable_incremental(). - - Incremental and generational collection is effective in reducing - pause times only if the collector has some way to tell which objects - or pages have been recently modified. The collector uses two sources - of information: - - 1. Information provided by the VM system. This may be provided in - one of several forms. Under Solaris 2.X (and potentially under other - similar systems) information on dirty pages can be read from the - /proc file system. Under other systems (currently SunOS4.X) it is - possible to write-protect the heap, and catch the resulting faults. - On these systems we require that system calls writing to the heap - (other than read) be handled specially by client code. - See os_dep.c for details. - - 2. Information supplied by the programmer. We define "stubborn" - objects to be objects that are rarely changed. Such an object - can be allocated (and enabled for writing) with GC_malloc_stubborn. - Once it has been initialized, the collector should be informed with - a call to GC_end_stubborn_change. Subsequent writes that store - pointers into the object must be preceded by a call to - GC_change_stubborn. - - This mechanism performs best for objects that are written only for - initialization, and such that only one stubborn object is writable - at once. It is typically not worth using for short-lived - objects. Stubborn objects are treated less efficiently than pointerfree - (atomic) objects. - - A rough rule of thumb is that, in the absence of VM information, garbage - collection pauses are proportional to the amount of pointerful storage - plus the amount of modified "stubborn" storage that is reachable during - the collection. - - Initial allocation of stubborn objects takes longer than allocation - of other objects, since other data structures need to be maintained. - - We recommend against random use of stubborn objects in client - code, since bugs caused by inappropriate writes to stubborn objects - are likely to be very infrequently observed and hard to trace. - However, their use may be appropriate in a few carefully written - library routines that do not make the objects themselves available - for writing by client code. - - - BUGS: - - Any memory that does not have a recognizable pointer to it will be - reclaimed. Exclusive-or'ing forward and backward links in a list - doesn't cut it. - Some C optimizers may lose the last undisguised pointer to a memory - object as a consequence of clever optimizations. This has almost - never been observed in practice. Send mail to boehm@acm.org - for suggestions on how to fix your compiler. - This is not a real-time collector. In the standard configuration, - percentage of time required for collection should be constant across - heap sizes. But collection pauses will increase for larger heaps. - (On SPARCstation 2s collection times will be on the order of 300 msecs - per MB of accessible memory that needs to be scanned. Your mileage - may vary.) The incremental/generational collection facility helps, - but is portable only if "stubborn" allocation is used. - Please address bug reports to boehm@acm.org. If you are - contemplating a major addition, you might also send mail to ask whether - it's already been done (or whether we tried and discarded it). - - RECENT VERSIONS: - - Version 1.3 and immediately preceding versions contained spurious - assembly language assignments to TMP_SP. Only the assignment in the PC/RT - code is necessary. On other machines, with certain compiler options, - the assignments can lead to an unsaved register being overwritten. - Known to cause problems under SunOS 3.5 WITHOUT the -O option. (With - -O the compiler recognizes it as dead code. It probably shouldn't, - but that's another story.) - - Version 1.4 and earlier versions used compile time determined values - for the stack base. This no longer works on Sun 3s, since Sun 3/80s use - a different stack base. We now use a straightforward heuristic on all - machines on which it is known to work (incl. Sun 3s) and compile-time - determined values for the rest. There should really be library calls - to determine such values. - - Version 1.5 and earlier did not ensure 8 byte alignment for objects - allocated on a sparc based machine. - - Version 1.8 added ULTRIX support in gc_private.h. - - Version 1.9 fixed a major bug in gc_realloc. - - Version 2.0 introduced a consistent naming convention for collector - routines and added support for registering dynamic library data segments - in the standard mark_roots.c. Most of the data structures were revamped. - The treatment of interior pointers was completely changed. Finalization - was added. Support for locking was added. Object kinds were added. - We added a black listing facility to avoid allocating at addresses known - to occur as integers somewhere in the address space. Much of this - was accomplished by adapting ideas and code from the PCR collector. - The test program was changed and expanded. - - Version 2.1 was the first stable version since 1.9, and added support - for PPCR. - - Version 2.2 added debugging allocation, and fixed various bugs. Among them: - - GC_realloc could fail to extend the size of the object for certain large object sizes. - - A blatant subscript range error in GC_printf, which unfortunately - wasn't exercised on machines with sufficient stack alignment constraints. - - GC_register_displacement did the wrong thing if it was called after - any allocation had taken place. - - The leak finding code would eventually break after 2048 byte - byte objects leaked. - - interface.c didn't compile. - - The heap size remained much too small for large stacks. - - The stack clearing code behaved badly for large stacks, and perhaps - on HP/PA machines. - - Version 2.3 added ALL_INTERIOR_POINTERS and fixed the following bugs: - - Missing declaration of etext in the A/UX version. - - Some PCR root-finding problems. - - Blacklisting was not 100% effective, because the plausible future - heap bounds were being miscalculated. - - GC_realloc didn't handle out-of-memory correctly. - - GC_base could return a nonzero value for addresses inside free blocks. - - test.c wasn't really thread safe, and could erroneously report failure - in a multithreaded environment. (The locking primitives need to be - replaced for other threads packages.) - - GC_CONS was thoroughly broken. - - On a SPARC with dynamic linking, signals stayed diabled while the - client code was running. - (Thanks to Manuel Serrano at INRIA for reporting the last two.) - - Version 2.4 added GC_free_space_divisor as a tuning knob, added - support for OS/2 and linux, and fixed the following bugs: - - On machines with unaligned pointers (e.g. Sun 3), every 128th word could - fail to be considered for marking. - - Dynamic_load.c erroneously added 4 bytes to the length of the data and - bss sections of the dynamic library. This could result in a bad memory - reference if the actual length was a multiple of a page. (Observed on - Sun 3. Can probably also happen on a Sun 4.) - (Thanks to Robert Brazile for pointing out that the Sun 3 version - was broken. Dynamic library handling is still broken on Sun 3s - under 4.1.1U1, but apparently not 4.1.1. If you have such a machine, - use -Bstatic.) - - Version 2.5 fixed the following bugs: - - Removed an explicit call to exit(1) - - Fixed calls to GC_printf and GC_err_printf, so the correct number of - arguments are always supplied. The OS/2 C compiler gets confused if - the number of actuals and the number of formals differ. (ANSI C - doesn't require this to work. The ANSI sanctioned way of doing things - causes too many compatibility problems.) - - Version 3.0 added generational/incremental collection and stubborn - objects. - - Version 3.1 added the following features: - - A workaround for a SunOS 4.X SPARC C compiler - misfeature that caused problems when the collector was turned into - a dynamic library. - - A fix for a bug in GC_base that could result in a memory fault. - - A fix for a performance bug (and several other misfeatures) pointed - out by Dave Detlefs and Al Dosser. - - Use of dirty bit information for static data under Solaris 2.X. - - DEC Alpha/OSF1 support (thanks to Al Dosser). - - Incremental collection on more platforms. - - A more refined heap expansion policy. Less space usage by default. - - Various minor enhancements to reduce space usage, and to reduce - the amount of memory scanned by the collector. - - Uncollectable allocation without per object overhead. - - More conscientious handling of out-of-memory conditions. - - Fixed a bug in debugging stubborn allocation. - - Fixed a bug that resulted in occasional erroneous reporting of smashed - objects with debugging allocation. - - Fixed bogus leak reports of size 4096 blocks with FIND_LEAK. - - Version 3.2 fixed a serious and not entirely repeatable bug in - the incremental collector. It appeared only when dirty bit info - on the roots was available, which is normally only under Solaris. - It also added GC_general_register_disappearing_link, and some - testing code. Interface.c disappeared. - - Version 3.3 fixes several bugs and adds new ports: - - PCR-specific bugs. - - Missing locking in GC_free, redundant FASTUNLOCK - in GC_malloc_stubborn, and 2 bugs in - GC_unregister_disappearing_link. - All of the above were pointed out by Neil Sharman - (neil@cs.mu.oz.au). - - Common symbols allocated by the SunOS4.X dynamic loader - were not included in the root set. - - Bug in GC_finalize (reported by Brian Beuning and Al Dosser) - - Merged Amiga port from Jesper Peterson (untested) - - Merged NeXT port from Thomas Funke (significantly - modified and untested) - - Version 3.4: - - Fixed a performance bug in GC_realloc. - - Updated the amiga port. - - Added NetBSD and 386BSD ports. - - Added cord library. - - Added trivial performance enhancement for - ALL_INTERIOR_POINTERS. (Don't scan last word.) - - Version 3.5 - - Minor collections now mark from roots only once, if that - doesn't cause an excessive pause. - - The stack clearing heuristic was refined to prevent anomalies - with very heavily recursive programs and sparse stacks. - - Fixed a bug that prevented mark stack growth in some cases. - GC_objects_are_marked should be set to TRUE after a call - to GC_push_roots and as part of GC_push_marked, since - both can now set mark bits. I think this is only a performance - bug, but I wouldn't bet on it. It's certainly very hard to argue - that the old version was correct. - - Fixed an incremental collection bug that prevented it from - working at all when HBLKSIZE != getpagesize() - - Changed dynamic_loading.c to include gc_priv.h before testing - DYNAMIC_LOADING. SunOS dynamic library scanning - must have been broken in 3.4. - - Object size rounding now adapts to program behavior. - - Added a workaround (provided by Manuel Serrano and - colleagues) to a long-standing SunOS 4.X (and 3.X?) ld bug - that I had incorrectly assumed to have been squished. - The collector was broken if the text segment size was within - 32 bytes of a multiple of 8K bytes, and if the beginning of - the data segment contained interesting roots. The workaround - assumes a demand-loadable executable. The original may have - have "worked" in some other cases. - - Added dynamic library support under IRIX5. - - Added support for EMX under OS/2 (thanks to Ari Huttunen). - - Version 3.6: - - fixed a bug in the mark stack growth code that was introduced - in 3.4. - - fixed Makefile to work around DEC AXP compiler tail recursion - bug. - - Version 3.7: - - Added a workaround for an HP/UX compiler bug. - - Fixed another stack clearing performance bug. Reworked - that code once more. - - Version 4.0: - - Added support for Solaris threads (which was possible - only by reimplementing some fraction of Solaris threads, - since Sun doesn't currently make the thread debugging - interface available). - - Added non-threads win32 and win32S support. - - (Grudgingly, with suitable muttering of obscenities) renamed - files so that the collector distribution could live on a FAT - file system. Files that are guaranteed to be useless on - a PC still have long names. Gc_inline.h and gc_private.h - still exist, but now just include gc_inl.h and gc_priv.h. - - Fixed a really obscure bug in finalization that could cause - undetected mark stack overflows. (I would be surprised if - any real code ever tickled this one.) - - Changed finalization code to dynamically resize the hash - tables it maintains. (This probably does not matter for well- - -written code. It no doubt does for C++ code that overuses - destructors.) - - Added typed allocation primitives. Rewrote the marker to - accommodate them with more reasonable efficiency. This - change should also speed up marking for GC_malloc allocated - objects a little. See gc_typed.h for new primitives. - - Improved debugging facilities slightly. Allocation time - stack traces are now kept by default on SPARC/SUNOS4. - (Thanks to Scott Schwartz.) - - Added better support for small heap applications. - - Significantly extended cord package. Fixed a bug in the - implementation of lazily read files. Printf and friends now - have cord variants. Cord traversals are a bit faster. - - Made ALL_INTERIOR_POINTERS recognition the default. - - Fixed de so that it can run in constant space, independent - of file size. Added simple string searching to cords and de. - - Added the Hull-Ellis C++ interface. - - Added dynamic library support for OSF/1. - (Thanks to Al Dosser and Tim Bingham at DEC.) - - Changed argument to GC_expand_hp to be expressed - in units of bytes instead of heap blocks. (Necessary - since the heap block size now varies depending on - configuration. The old version was never very clean.) - - Added GC_get_heap_size(). The previous "equivalent" - was broken. - - Restructured the Makefile a bit. - - Since version 4.0: - - Changed finalization implementation to guarantee that - finalization procedures are called outside of the allocation - lock, making direct use of the interface a little less dangerous. - MAY BREAK EXISTING CLIENTS that assume finalizers - are protected by a lock. Since there seem to be few multithreaded - clients that use finalization, this is hopefully not much of - a problem. - - Fixed a gross bug in CORD_prev. - - Fixed a bug in blacklst.c that could result in unbounded - heap growth during startup on machines that do not clear - memory obtained from the OS (e.g. win32S). - - Ported de editor to win32/win32S. (This is now the only - version with a mouse-sensitive UI.) - - Added GC_malloc_ignore_off_page to allocate large arrays - in the presence of ALL_INTERIOR_POINTERS. - - Changed GC_call_with_alloc_lock to not disable signals in - the single-threaded case. - - Reduced retry count in GC_collect_or_expand for garbage - collecting when out of memory. - - Made uncollectable allocations bypass black-listing, as they - should. - - Fixed a bug in typed_test in test.c that could cause (legitimate) - GC crashes. - - Fixed some potential synchronization problems in finalize.c - - Fixed a real locking problem in typd_mlc.c. - - Worked around an AIX 3.2 compiler feature that results in - out of bounds memory references. - - Partially worked around an IRIX5.2 beta problem (which may - or may not persist to the final release). - - Fixed a bug in the heap integrity checking code that could - result in explicitly deallocated objects being identified as - smashed. Fixed a bug in the dbg_mlc stack saving code - that caused old argument pointers to be considered live. - - Fixed a bug in CORD_ncmp (and hence CORD_str). - - Repaired the OS2 port, which had suffered from bit rot - in 4.0. Worked around what appears to be CSet/2 V1.0 - optimizer bug. - - Fixed a Makefile bug for target "c++". - - Since version 4.1: - - Multiple bug fixes/workarounds in the Solaris threads version. - (It occasionally failed to locate some register contents for - marking. It also turns out that thr_suspend and friends are - unreliable in Solaris 2.3. Dirty bit reads appear - to be unreliable under some weird - circumstances. My stack marking code - contained a serious performance bug. The new code is - extremely defensive, and has not failed in several cpu - hours of testing. But no guarantees ...) - - Added MacOS support (thanks to Patrick Beard.) - - Fixed several syntactic bugs in gc_c++.h and friends. (These - didn't bother g++, but did bother most other compilers.) - Fixed gc_c++.h finalization interface. (It didn't.) - - 64 bit alignment for allocated objects was not guaranteed in a - few cases in which it should have been. - - Added GC_malloc_atomic_ignore_off_page. - - Added GC_collect_a_little. - - Added some prototypes to gc.h. - - Some other minor bug fixes (notably in Makefile). - - Fixed OS/2 / EMX port (thanks to Ari Huttunen). - - Fixed AmigaDOS port. (thanks to Michel Schinz). - - Fixed the DATASTART definition under Solaris. There - was a 1 in 16K chance of the collector missing the first - 64K of static data (and thus crashing). - - Fixed some blatant anachronisms in the README file. - - Fixed PCR-Makefile for upcoming PPCR release. - - Since version 4.2: - - Fixed SPARC alignment problem with GC_DEBUG. - - Fixed Solaris threads /proc workaround. The real - problem was an interaction with mprotect. - - Incorporated fix from Patrick Beard for gc_c++.h (now gc_cpp.h). - - Slightly improved allocator space utilization by - fixing the GC_size_map mechanism. - - Integrated some Sony News and MIPS RISCos 4.51 - patches. (Thanks to Nobuyuki Hikichi of - Software Research Associates, Inc. Japan) - - Fixed HP_PA alignment problem. (Thanks to - xjam@cork.cs.berkeley.edu.) - - Added GC_same_obj and friends. Changed GC_base - to return 0 for pointers past the end of large objects. - Improved GC_base performance with ALL_INTERIOR_POINTERS - on machines with a slow integer mod operation. - Added GC_PTR_ADD, GC_PTR_STORE, etc. to prepare - for preprocessor. - - changed the default on most UNIX machines to be that - signals are not disabled during critical GC operations. - This is still ANSI-conforming, though somewhat dangerous - in the presence of signal handlers. But the performance - cost of the alternative is sometimes problematic. - Can be changed back with a minor Makefile edit. - - renamed IS_STRING in gc.h, to CORD_IS_STRING, thus - following my own naming convention. Added the function - CORD_to_const_char_star. - - Fixed a gross bug in GC_finalize. Symptom: occasional - address faults in that function. (Thanks to Anselm - Baird-Smith (Anselm.BairdSmith@inria.fr) - - Added port to ICL DRS6000 running DRS/NX. Restructured - things a bit to factor out common code, and remove obsolete - code. Collector should now run under SUNOS5 with either - mprotect or /proc dirty bits. (Thanks to Douglas Steel - (doug@wg.icl.co.uk)). - - More bug fixes and workarounds for Solaris 2.X. (These were - mostly related to putting the collector in a dynamic library, - which didn't really work before. Also SOLARIS_THREADS - didn't interact well with dl_open.) Thanks to btlewis@eng.sun.com. - - Fixed a serious performance bug on the DEC Alpha. The text - segment was getting registered as part of the root set. - (Amazingly, the result was still fast enough that the bug - was not conspicuous.) The fix works on OSF/1, version 1.3. - Hopefully it also works on other versions of OSF/1 ... - - Fixed a bug in GC_clear_roots. - - Fixed a bug in GC_generic_malloc_words_small that broke - gc_inl.h. (Reported by Antoine de Maricourt. I broke it - in trying to tweak the Mac port.) - - Fixed some problems with cord/de under Linux. - - Fixed some cord problems, notably with CORD_riter4. - - Added DG/UX port. - Thanks to Ben A. Mesander (ben@piglet.cr.usgs.gov) - - Added finalization registration routines with weaker ordering - constraints. (This is necessary for C++ finalization with - multiple inheritance, since the compiler often adds self-cycles.) - - Filled the holes in the SCO port. (Thanks to Michael Arnoldus - .) - - John Ellis' additions to the C++ support: From John: - - * I completely rewrote the documentation in the interface gc_c++.h - (later renamed gc_cpp.h). I've tried to make it both clearer and more - precise. - - * The definition of accessibility now ignores pointers from an - finalizable object (an object with a clean-up function) to itself. - This allows objects with virtual base classes to be finalizable by the - collector. Compilers typically implement virtual base classes using - pointers from an object to itself, which under the old definition of - accessibility prevented objects with virtual base classes from ever - being collected or finalized. - - * gc_cleanup now includes gc as a virtual base. This was enabled by - the change in the definition of accessibility. - - * I added support for operator new[]. Since most (all?) compilers - don't yet support operator new[], it is conditionalized on - -DOPERATOR_NEW_ARRAY. The code is untested, but its trivial and looks - correct. - - * The test program test_gc_c++ (later renamed test_cpp.cc) - tries to test for the C++-specific functionality not tested by the - other programs. - - Added include to misc.c. (Needed for ppcr.) - - Added PowerMac port. (Thanks to Patrick Beard again.) - - Fixed "srcdir"-related Makefile problems. Changed things so - that all externally visible include files always appear in the - include subdirectory of the source. Made gc.h directly - includable from C++ code. (These were at Per - Bothner's suggestion.) - - Changed Intel code to also mark from ebp (Kevin Warne's - suggestion). - - Renamed C++ related files so they could live in a FAT - file system. (Charles Fiterman's suggestion.) - - Changed Windows NT Makefile to include C++ support in - gc.lib. Added C++ test as Makefile target. - - Since version 4.3: - - ASM_CLEAR_CODE was erroneously defined for HP - PA machines, resulting in a compile error. - - Fixed OS/2 Makefile to create a library. (Thanks to - Mark Boulter (mboulter@vnet.ibm.com)). - - Gc_cleanup objects didn't work if they were created on - the stack. Fixed. - - One copy of Gc_cpp.h in the distribution was out of - synch, and failed to document some known compiler - problems with explicit destructor invocation. Partially - fixed. There are probably other compilers on which - gc_cleanup is miscompiled. - - Fixed Makefile to pass C compiler flags to C++ compiler. - - Added Mac fixes. - - Fixed os_dep.c to work around what appears to be - a new and different VirtualQuery bug under newer - versions of win32S. - - GC_non_gc_bytes was not correctly maintained by - GC_free. Fixed. Thanks to James Clark (jjc@jclark.com). - - Added GC_set_max_heap_size. - - Changed allocation code to ignore blacklisting if it is preventing - use of a very large block of memory. This has the advantage - that naive code allocating very large objects is much more - likely to work. The downside is you might no - longer find out that such code should really use - GC_malloc_ignore_off_page. - - Changed GC_printf under win32 to close and reopen the file - between calls. FAT file systems otherwise make the log file - useless for debugging. - - Added GC_try_to_collect and GC_get_bytes_since_gc. These - allow starting an abortable collection during idle times. - This facility does not require special OS support. (Thanks to - Michael Spertus of Geodesic Systems for suggesting this. It was - actually an easy addition. Kumar Srikantan previously added a similar - facility to a now ancient version of the collector. At the time - this was much harder, and the result was less convincing.) - - Added some support for the Borland development environment. (Thanks - to John Ellis and Michael Spertus.) - - Removed a misfeature from checksums.c that caused unexpected - heap growth. (Thanks to Scott Schwartz.) - - Changed finalize.c to call WARN if it encounters a finalization cycle. - WARN is defined in gc_priv.h to write a message, usually to stdout. - In many environments, this may be inappropriate. - - Renamed NO_PARAMS in gc.h to GC_NO_PARAMS, thus adhering to my own - naming convention. - - Added GC_set_warn_proc to intercept warnings. - - Fixed Amiga port. (Thanks to Michel Schinz (schinz@alphanet.ch).) - - Fixed a bug in mark.c that could result in an access to unmapped - memory from GC_mark_from_mark_stack on machines with unaligned - pointers. - - Fixed a win32 specific performance bug that could result in scanning of - objects allocated with the system malloc. - - Added REDIRECT_MALLOC. - - Since version 4.4: - - Fixed many minor and one major README bugs. (Thanks to Franklin Chen - (chen@adi.com) for pointing out many of them.) - - Fixed ALPHA/OSF/1 dynamic library support. (Thanks to Jonathan Bachrach - (jonathan@harlequin.com)). - - Added incremental GC support (MPROTECT_VDB) for Linux (with some - help from Bruno Haible). - - Altered SPARC recognition tests in gc.h and config.h (mostly as - suggested by Fergus Henderson). - - Added basic incremental GC support for win32, as implemented by - Windows NT and Windows 95. GC_enable_incremental is a noop - under win32s, which doesn't implement enough of the VM interface. - - Added -DLARGE_CONFIG. - - Fixed GC_..._ignore_off_page to also function without - -DALL_INTERIOR_POINTERS. - - (Hopefully) fixed RS/6000 port. (Only the test was broken.) - - Fixed a performance bug in the nonincremental collector running - on machines supporting incremental collection with MPROTECT_VDB - (e.g. SunOS 4, DEC AXP). This turned into a correctness bug under - win32s with win32 incremental collection. (Not all memory protection - was disabled.) - - Fixed some ppcr related bit rot. - - Caused dynamic libraries to be unregistered before reregistering. - The old way turned out to be a performance bug on some machines. - - GC_root_size was not properly maintained under MSWIN32. - - Added -DNO_DEBUGGING and GC_dump. - - Fixed a couple of bugs arising with SOLARIS_THREADS + - REDIRECT_MALLOC. - - Added NetBSD/M68K port. (Thanks to Peter Seebach - .) - - Fixed a serious realloc bug. For certain object sizes, the collector - wouldn't scan the expanded part of the object. (Thanks to Clay Spence - (cds@peanut.sarnoff.com) for noticing the problem, and helping me to - track it down.) - - Since version 4.5: - - Added Linux ELF support. (Thanks to Arrigo Triulzi .) - - GC_base crashed if it was called before any other GC_ routines. - This could happen if a gc_cleanup object was allocated outside the heap - before any heap allocation. - - The heap expansion heuristic was not stable if all objects had finalization - enabled. Fixed finalize.c to count memory in finalization queue and - avoid explicit deallocation. Changed alloc.c to also consider this count. - (This is still not recommended. It's expensive if nothing else.) Thanks - to John Ellis for pointing this out. - - GC_malloc_uncollectable(0) was broken. Thanks to Phong Vo for pointing - this out. - - The collector didn't compile under Linux 1.3.X. (Thanks to Fred Gilham for - pointing this out.) The current workaround is ugly, but expected to be - temporary. - - Fixed a formatting problem for SPARC stack traces. - - Fixed some '=='s in os_dep.c that should have been assignments. - Fortunately these were in code that should never be executed anyway. - (Thanks to Fergus Henderson.) - - Fixed the heap block allocator to only drop blacklisted blocks in small - chunks. Made BL_LIMIT self adjusting. (Both of these were in response - to heap growth observed by Paul Graham.) - - Fixed the Metrowerks/68K Mac code to also mark from a6. (Thanks - to Patrick Beard.) - - Significantly updated README.debugging. - - Fixed some problems with longjmps out of signal handlers, especially under - Solaris. Added a workaround for the fact that siglongjmp doesn't appear to - do the right thing with -lthread under Solaris. - - Added MSDOS/djgpp port. (Thanks to Mitch Harris (maharri@uiuc.edu).) - - Added "make reserved_namespace" and "make user_namespace". The - first renames ALL "GC_xxx" identifiers as "_GC_xxx". The second is the - inverse transformation. Note that doing this is guaranteed to break all - clients written for the other names. - - descriptor field for kind NORMAL in GC_obj_kinds with ADD_BYTE_AT_END - defined should be -ALIGNMENT not WORDS_TO_BYTES(-1). This is - a serious bug on machines with pointer alignment of less than a word. - - GC_ignore_self_finalize_mark_proc didn't handle pointers to very near the - end of the object correctly. Caused failures of the C++ test on a DEC Alpha - with g++. - - gc_inl.h still had problems. Partially fixed. Added warnings at the - beginning to hopefully specify the remaining dangers. - - Added DATAEND definition to config.h. - - Fixed some of the .h file organization. Fixed "make floppy". - - Since version 4.6: - - Fixed some compilation problems with -DCHECKSUMS (thanks to Ian Searle) - - Updated some Mac specific files to synchronize with Patrick Beard. - - Fixed a serious bug for machines with non-word-aligned pointers. - (Thanks to Patrick Beard for pointing out the problem. The collector - should fail almost any conceivable test immediately on such machines.) - - Since version 4.7: - - Changed a "comment" in a MacOS specific part of mach-dep.c that caused - gcc to fail on other platforms. - - Since version 4.8 - - More README.debugging fixes. - - Objects ready for finalization, but not finalized in the same GC - cycle, could be prematurely collected. This occasionally happened - in test_cpp. - - Too little memory was obtained from the system for very large - objects. That could cause a heap explosion if these objects were - not contiguous (e.g. under PCR), and too much of them was blacklisted. - - Due to an improper initialization, the collector was too hesitant to - allocate blacklisted objects immediately after system startup. - - Moved GC_arrays from the data into the bss segment by not explicitly - initializing it to zero. This significantly - reduces the size of executables, and probably avoids some disk accesses - on program startup. It's conceivable that it might break a port that I - didn't test. - - Fixed EMX_MAKEFILE to reflect the gc_c++.h to gc_cpp.h renaming which - occurred a while ago. - - Since 4.9: - - Fixed a typo around a call to GC_collect_or_expand in alloc.c. It broke - handling of out of memory. (Thanks to Patrick Beard for noticing.) - - Since 4.10: - - Rationalized (hopefully) GC_try_to_collect in an incremental collection - environment. It appeared to not handle a call while a collection was in - progress, and was otherwise too conservative. - - Merged GC_reclaim_or_delete_all into GC_reclaim_all to get rid of some - code. - - Added Patrick Beard's Mac fixes, with substantial completely untested - modifications. - - Fixed the MPROTECT_VDB code to deal with large pages and imprecise - fault addresses (as on an UltraSPARC running Solaris 2.5). Note that this - was not a problem in the default configuration, which uses PROC_VDB. - - The DEC Alpha assembly code needed to restore $gp between calls. - Thanks to Fergus Henderson for tracking this down and supplying a - patch. - - The write command for "de" was completely broken for large files. - I used the easiest portable fix, which involved changing the semantics - so that f.new is written instead of overwriting f. That's safer anyway. - - Added README.solaris2 with a discussion of the possible problems of - mixing the collector's sbrk allocation with malloc/realloc. - - Changed the data segment starting address for SGI machines. The - old code failed under IRIX6. - - Required double word alignment for MIPS. - - Various minor fixes to remove warnings. - - Attempted to fix some Solaris threads problems reported by Zhiying Chen. - In particular, the collector could try to fork a thread with the - world stopped as part of GC_thr_init. It also failed to deal with - the case in which the original thread terminated before the whole - process did. - - Added -DNO_EXECUTE_PERMISSION. This has a major performance impact - on the incremental collector under Irix, and perhaps under other - operating systems. - - Added some code to support allocating the heap with mmap. This may - be preferable under some circumstances. - - Integrated dynamic library support for HP. - (Thanks to Knut Tvedten .) - - Integrated James Clark's win32 threads support, and made a number - of changes to it, many of which were suggested by Pontus Rydin. - This is still not 100% solid. - - Integrated Alistair Crooks' support for UTS4 running on an Amdahl - 370-class machine. - - Fixed a serious bug in explicitly typed allocation. Objects requiring - large descriptors where handled in a way that usually resulted in - a segmentation fault in the marker. (Thanks to Jeremy Fitzhardinge - for helping to track this down.) - - Added partial support for GNU win32 development. (Thanks to Fergus - Henderson.) - - Added optional support for Java-style finalization semantics. (Thanks - to Patrick Bridges.) This is recommended only for Java implementations. - - GC_malloc_uncollectable faulted instead of returning 0 when out of - memory. (Thanks to dan@math.uiuc.edu for noticing.) - - Calls to GC_base before the collector was initialized failed on a - DEC Alpha. (Thanks to Matthew Flatt.) - - Added base pointer checking to GC_REGISTER_FINALIZER in debugging - mode, at the suggestion of Jeremy Fitzhardinge. - - GC_debug_realloc failed for uncollectable objects. (Thanks to - Jeremy Fitzhardinge.) - - Explicitly typed allocation could crash if it ran out of memory. - (Thanks to Jeremy Fitzhardinge.) - - Added minimal support for a DEC Alpha running Linux. - - Fixed a problem with allocation of objects whose size overflowed - ptrdiff_t. (This now fails unconditionally, as it should.) - - Added the beginning of Irix pthread support. - - Integrated Xiaokun Zhu's fixes for djgpp 2.01. - - Added SGI-style STL allocator support (gc_alloc.h). - - Fixed a serious bug in README.solaris2. Multithreaded programs must include - gc.h with SOLARIS_THREADS defined. - - Changed GC_free so it actually deallocates uncollectable objects. - (Thanks to Peter Chubb for pointing out the problem.) - - Added Linux ELF support for dynamic libararies. (Thanks again to - Patrick Bridges.) - - Changed the Borland cc configuration so that the assembler is not - required. - - Fixed a bug in the C++ test that caused it to fail in 64-bit - environments. - - Since 4.11: - - Fixed ElfW definition in dyn_load.c. (Thanks to Fergus Henderson.) - This prevented the dynamic library support from compiling on some - older ELF Linux systems. - - Fixed UTS4 port (which I apparently mangled during the integration) - (Thanks to again to Alistair Crooks.) - - "Make C++" failed on Suns with SC4.0, due to a problem with "bool". - Fixed in gc_priv.h. - - Added more pieces for GNU win32. (Thanks to Timothy N. Newsham.) - The current state of things should suffice for at least some - applications. - - Changed the out of memory retry count handling as suggested by - Kenjiro Taura. (This matters only if GC_max_retries > 0, which - is no longer the default.) - - If a /proc read failed repeatedly, GC_written_pages was not updated - correctly. (Thanks to Peter Chubb for diagnosing this.) - - Under unlikely circumstances, the allocator could infinite loop in - an out of memory situation. (Thanks again to Kenjiro Taura for - identifying the problem and supplying a fix.) - - Fixed a syntactic error in the DJGPP code. (Thanks to Fergus - Henderson for finding this by inspection.) Also fixed a test program - problem with DJGPP (Thanks to Peter Monks.) - - Atomic uncollectable objects were not treated correctly by the - incremental collector. This resulted in weird log statistics and - occasional performance problems. (Thanks to Peter Chubb for pointing - this out.) - - Fixed some problems resulting from compilers that dont define - __STDC__. In this case void * and char * were used inconsistently - in some cases. (Void * should not have been used at all. If - you have an ANSI superset compiler that does not define __STDC__, - please compile with -D__STDC__=0. Thanks to Manuel Serrano and others - for pointing out the problem.) - - Fixed a compilation problem on Irix with -n32 and -DIRIX_THREADS. - Also fixed some other IRIX_THREADS problems which may or may not have - had observable symptoms. - - Fixed an HP PA compilation problem in dyn_load.c. (Thanks to - Philippe Queinnec.) - - SEGV fault handlers sometimes did not get reset correctly. (Thanks - to David Pickens.) - - Added a fix for SOLARIS_THREADS on Intel. (Thanks again to David - Pickens.) This probably needs more work to become functional. - - Fixed struct sigcontext_struct in os_dep.c for compilation under - Linux 2.1.X. (Thanks to Fergus Henderson.) - - Changed the DJGPP STACKBOTTOM and DATASTART values to those suggested - by Kristian Kristensen. These may still not be right, but it is - it is likely to work more often than what was there before. They may - even be exactly right. - - Added a #include to test_cpp.cc. This appears to help - with HP/UX and gcc. (Thanks to assar@sics.se.) - - Version 4.11 failed to run in incremental mode on recent 64-bit Irix - kernels. This was a problem related to page unaligned heap segments. - Changed the code to page align heap sections on all platforms. - (I had mistakenly identified this as a kernel problem earlier. - It was not.) - - Version 4.11 did not make allocated storage executable, except on - one or two platforms, due to a bug in a #if test. (Thanks to Dave - Grove for pointing this out.) - - Added sparc_sunos4_mach_dep.s to support Sun's compilers under SunOS4. - - Added GC_exclude_static_roots. - - Fixed the object size mapping algorithm. This shouldn't matter, - but the old code was ugly. - - Heap checking code could die if one of the allocated objects was - larger than its base address. (Unsigned underflow problem. Thanks - to Clay Spence for isolating the problem.) - - Added RS6000 (AIX) dynamic library support and fixed STACK_BOTTOM. - (Thanks to Fred Stearns.) - - Added Fergus Henderson's patches for improved robustness with large - heaps and lots of blacklisting. - - Added Peter Chubb's changes to support Solaris Pthreads, to support - MMAP allocation in Solaris, to allow Solaris to find dynamic libraries - through /proc, to add malloc_typed_ignore_off_page, and a few other - minor features and bug fixes. - - The Solaris 2 port should not use sbrk. I received confirmation from - Sun that the use of sbrk and malloc in the same program is not - supported. The collector now defines USE_MMAP by default on Solaris. - - Replaced the djgpp makefile with Gary Leavens' version. - - Fixed MSWIN32 detection test. - - Added Fergus Henderson's patches to allow putting the collector into - a DLL under GNU win32. - - Added Ivan V. Demakov's port to Watcom C on X86. - - Added Ian Piumarta's Linux/PowerPC port. - - On Brian Burton's suggestion added PointerFreeGC to the placement - options in gc_cpp.h. This is of course unsafe, and may be controversial. - On the other hand, it seems to be needed often enough that it's worth - adding as a standard facility. - - Since 4.12: - - Fixed a crucial bug in the Watcom port. There was a redundant decl - of GC_push_one in gc_priv.h. - - Added FINALIZE_ON_DEMAND. - - Fixed some pre-ANSI cc problems in test.c. - - Removed getpagesize() use for Solaris. It seems to be missing in one - or two versions. - - Fixed bool handling for SPARCCompiler version 4.2. - - Fixed some files in include that had gotten unlinked from the main - copy. - - Some RS/6000 fixes (missing casts). Thanks to Toralf Foerster. - - Fixed several problems in GC_debug_realloc, affecting mostly the - FIND_LEAK case. - - GC_exclude_static_roots contained a buggy unsigned comparison to - terminate a loop. (Thanks to Wilson Ho.) - - CORD_str failed if the substring occurred at the last possible position. - (Only affects cord users.) - - Fixed Linux code to deal with RedHat 5.0 and integrated Peter Bigot's - os_dep.c code for dealing with various Linux versions. - - Added workaround for Irix pthreads sigaction bug and possible signal - misdirection problems. - Since alpha1: - - Changed RS6000 STACKBOTTOM. - - Integrated Patrick Beard's Mac changes. - - Alpha1 didn't compile on Irix m.n, m < 6. - - Replaced Makefile.dj with a new one from Gary Leavens. - - Added Andrew Stitcher's changes to support SCO OpenServer. - - Added PRINT_BLACK_LIST, to allow debugging of high densities of false - pointers. - - Added code to debug allocator to keep track of return address - in GC_malloc caller, thus giving a bit more context. - - Changed default behavior of large block allocator to more - aggressively avoid fragmentation. This is likely to slow down the - collector when it succeeds at reducing space cost. - - Integrated Fergus Henderson's CYGWIN32 changes. They are untested, - but needed for newer versions. - - USE_MMAP had some serious bugs. This caused the collector to fail - consistently on Solaris with -DSMALL_CONFIG. - - Added Linux threads support, thanks largely to Fergus Henderson. - Since alpha2: - - Fixed more Linux threads problems. - - Changed default GC_free_space_divisor to 3 with new large block allocation. - (Thanks to Matthew Flatt for some measurements that suggest the old - value sometimes favors space too much over time.) - - More CYGWIN32 fixes. - - Integrated Tyson-Dowd's Linux-M68K port. - - Minor HP PA and DEC UNIX fixes from Fergus Henderson. - - Integrated Christoffe Raffali's Linux-SPARC changes. - - Allowed for one more GC fixup iteration after a full GC in incremental - mode. Some quick measurements suggested that this significantly - reduces pause times even with smaller GC_RATE values. - - Moved some more GC data structures into GC_arrays. This decreases - pause times and GC overhead, but makes debugging slightly less convenient. - - Fixed namespace pollution problem ("excl_table"). - - Made GC_incremental a constant for -DSMALL_CONFIG, hopefully shrinking - that slightly. - - Added some win32 threads fixes. - - Integrated Ivan Demakov and David Stes' Watcom fixes. - - Various other minor fixes contributed by many people. - - Renamed config.h to gcconfig.h, since config.h tends to be used for - many other things. - - Integrated Matthew Flatt's support for 68K MacOS "far globals". - - Fixed up some of the dynamic library Makefile targets for consistency - across platforms. - - Fixed a USE_MMAP typo that caused out-of-memory handling to fail - on Solaris. - - Added code to test.c to test thread creation a bit more. - - Integrated GC_win32_free_heap, as suggested by Ivan Demakov. - - Fixed Solaris 2.7 stack base finding problem. (This may actually - have been done in an earlier alpha release.) - Since alpha3: - - Fixed MSWIN32 recognition test, which interfered with cygwin. - - Removed unnecessary gc_watcom.asm from distribution. Removed - some obsolete README.win32 text. - - Added Alpha Linux incremental GC support. (Thanks to Philipp Tomsich - for code for retrieving the fault address in a signal handler.) - Changed Linux signal handler context argument to be a pointer. - - Took care of some new warnings generated by the 7.3 SGI compiler. - - Integrated Phillip Musumeci's FreeBSD/ELF fixes. - - -DIRIX_THREADS was broken with the -o32 ABI (typo in gc_priv.h> - - Since 4.13: - - Fixed GC_print_source_ptr to not use a prototype. - - generalized CYGWIN test. - - gc::new did the wrong thing with PointerFreeGC placement. - (Thanks to Rauli Ruohonen.) - - In the ALL_INTERIOR_POINTERS (default) case, some callee-save register - values could fail to be scanned if the register was saved and - reused in a GC frame. This showed up in verbose mode with gctest - compiled with an unreleased SGI compiler. I vaguely recall an old - bug report that may have been related. The bug was probably quite old. - (The problem was that the stack scanning could be deferred until - after the relevant frame was overwritten, and the new save location - might be outside the scanned area. Fixed by more eager stack scanning.) - - PRINT_BLACK_LIST had some problems. A few source addresses were garbage. - - Replaced Makefile.dj and added -I flags to cord make targets. - (Thanks to Gary Leavens.) - - GC_try_to_collect was broken with the nonincremental collector. - - gc_cleanup destructors could pass the wrong address to - GC_register_finalizer_ignore_self in the presence of multiple - inheritance. (Thanks to Darrell Schiebel.) - - Changed PowerPC Linux stack finding code. - - Since 4.14alpha1 - - -DSMALL_CONFIG did not work reliably with large (> 4K) pages. - Recycling the mark stack during expansion could result in a size - zero heap segment, which confused things. (This was probably also an - issue with the normal config and huge pages.) - - Did more work to make sure that callee-save registers were scanned - completely, even with the setjmp-based code. Added USE_GENERIC_PUSH_REGS - macro to facilitate testing on machines I have access to. - - Added code to explicitly push register contents for win32 threads. - This seems to be necessary. (Thanks to Pierre de Rop.) - - Since 4.14alpha2 - - changed STACKBOTTOM for DJGPP (Thanks to Salvador Eduardo Tropea). - - Since 4.14 - - Reworked large block allocator. Now uses multiple doubly linked free - lists to approximate best fit. - - Changed heap expansion heuristic. Entirely free blocks are no longer - counted towards the heap size. This seems to have a major impact on - heap size stability; the old version could expand the heap way too - much in the presence of large block fragmentation. - - added -DGC_ASSERTIONS and some simple assertions inside the collector. - This is mainlyt for collector debugging. - - added -DUSE_MUNMAP to allow the heap to shrink. Suupported on only - a few UNIX-like platforms for now. - - added GC_dump_regions() for debugging of fragmentation issues. - - Changed PowerPC pointer alignment under Linux to 4. (This needs - checking by someone who has one. The suggestions came to me via a - rather circuitous path.) - - Changed the Linux/Alpha port to walk the data segment backwards until - it encounters a SIGSEGV. The old way to find the start of the data - segment broke with a recent release. - - cordxtra.c needed to call GC_REGISTER_FINALIZER instead of - GC_register_finalizer, so that it would continue to work with GC_DEBUG. - - allochblk sometimes cleared the wrong block for debugging purposes - when it dropped blacklisted blocks. This could result in spurious - error reports with GC_DEBUG. - - added MACOS X Server support. (Thanks to Andrew Stone.) - - Changed the Solaris threads code to ignore stack limits > 8 MB with - a warning. Empirically, it is not safe to access arbitrary pages - in such large stacks. And the dirty bit implementation does not - guarantee that none of them will be accessed. - - Integrated Martin Tauchmann's Amiga changes. - - Integrated James Dominy's OpenBSD/SPARC port. - - Since 5.0alpha1 - - Fixed bugs introduced in alpha1 (OpenBSD & large block initialization). - - Added -DKEEP_BACK_PTRS and backptr.h interface. (The implementation - idea came from Al Demers.) - - Since 5.0alpha2 - - Added some highly incomplete code to support a copied young generation. - Comments on nursery.h are appreciated. - - Changed -DFIND_LEAK, -DJAVA_FINALIZATION, and -DFINALIZE_ON_DEMAND, - so the same effect could be obtained with a runtime switch. This is - a step towards standardizing on a single dynamic GC library. - - Significantly changed the way leak detection is handled, as a consequence - of the above. - - Since 5.0 alpha3 - - Added protection fault handling patch for Linux/M68K from Fergus - Henderson and Roman Hodek. - - Removed the tests for SGI_SOURCE in new_gc_alloc.h. This was causing that - interface to fail on nonSGI platforms. - - Changed the Linux stack finding code to use /proc, after changing it - to use HEURISTIC1. (Thanks to David Mossberger for pointing out the - /proc hook.) - - Added HP/UX incremental GC support and HP/UX 11 thread support. - Thread support is currently still flakey. - - Added basic Linux/IA64 support. - - Integrated Anthony Green's PicoJava support. - - Integrated Scott Ananian's StrongARM/NetBSD support. - - Fixed some fairly serious performance bugs in the incremental - collector. These have probably been there essentially forever. - (Mark bits were sometimes set before scanning dirty pages. - The reclaim phase unnecessarily dirtied full small object pages.) - - Changed the reclaim phase to ignore nearly full pages to avoid - touching them. - - Limited GC_black_list_spacing to roughly the heap growth increment. - - Changed full collection triggering heuristic to decrease full GC - frequency by default, but to explicitly trigger full GCs during - heap growth. This doesn't always improve things, but on average it's - probably a win. - - GC_debug_free(0, ...) failed. Thanks to Fergus Henderson for the - bug report and fix. - - Since 5.0 alpha4 - - GC_malloc_explicitly_typed and friends sometimes failed to - initialize first word. - - Added allocation routines and support in the marker for mark descriptors - in a type structure referenced by the first word of an object. This was - introduced to support gcj, but hopefully in a way that makes it - generically useful. - - Added GC_requested_heapsize, and inhibited collections in nonincremental - mode if the actual used heap size is less than what was explicitly - requested. - - The Solaris pthreads version of GC_pthread_create didn't handle a NULL - attribute pointer. Solaris thread support used the wrong default thread - stack size. (Thanks to Melissa O'Neill for the patch.) - - Changed PUSH_CONTENTS macro to no longer modify first parameter. - This usually doesn't matter, but it was certainly an accident waiting - to happen ... - - Added GC_register_finalizer_no_order and friends to gc.h. They're - needed by Java implementations. - - Integrated a fix for a win32 deadlock resulting from clock() calling - malloc. (Thanks to Chris Dodd.) - - Integrated Hiroshi Kawashima's port to Linux/MIPS. This was designed - for a handheld platform, and may or may not be sufficient for other - machines. - - Fixed a va_arg problem with the %c specifier in cordprnt.c. It appears - that this was always broken, but recent versions of gcc are the first to - report the (statically detectable) bug. - - Added an attempt at a more general solution to dlopen races/deadlocks. - GC_dlopen now temporarily disables collection. Still not ideal, but ... - - Added -DUSE_I686_PREFETCH, -DUSE_3DNOW_PREFETCH, and support for IA64 - prefetch instructions. May improve performance measurably, but I'm not - sure the code will run correctly on processors that don't support the - instruction. Won't build except with very recent gcc. - - Added caching for header lookups in the marker. This seems to result - in a barely measurable performance gain. Added support for interleaved - lookups of two pointers, but unconfigured that since the performance - gain is currently near zero, and it adds to code size. - - Changed Linux DATA_START definition to check both data_start and - __data_start, since nothing else seems to be portable. - - Added -DUSE_LD_WRAP to optionally take advantage of the GNU ld function - wrapping mechanism. Probably currently useful only on Linux. - - Moved some variables for the scratch allocator into GC_arrays, on - Martin Hirzel's suggestion. - - Fixed a win32 threads bug that caused the collector to not look for - interior pointers from one of the thread stacks without - ALL_INTERIOR_POINTERS. (Thanks to Jeff Sturm.) - - Added Mingw32 support. (Thanks again to Jeff Sturm for the patch.) - - Changed the alpha port to use the generic register scanning code instead - of alpha_mach_dep.s. Alpha_mach_dep.s doesn't look for pointers in fp - registers, but gcc sometimes spills pointers there. (Thanks to Manuel - Serrano for helping me debug this by email.) Changed the IA64 code to - do something similar for similar reasons. - - Since 5.0alpha6: - - -DREDIRECT_MALLOC was broken in alpha6. Fixed. - - Cleaned up gc_ccp.h slightly, thus also causing the HP C++ compiler to - accept it. - - Removed accidental reference to dbg_mlc.c, which caused dbg_mlc.o to be - linked into every executable. - - Added PREFETCH to bitmap marker. Changed it to use the header cache. - - GC_push_marked sometimes pushed one object too many, resulting in a - segmentation fault in GC_mark_from_mark_stack. This was probably an old - bug. It finally showed up in gctest on win32. - - Gc_priv.h erroneously #defined GC_incremental to be TRUE instead of FALSE - when SMALL_CONFIG was defined. This was no doubt a major performance bug for - the default win32 configuration. - - Removed -DSMALL_CONFIG from NT_MAKEFILE. It seemed like an anchronism now - that the average PC has 64MB or so. - - Integrated Bryce McKinley's patches for linux threads and dynamic loading - from the libgcj tree. Turned on dynamic loading support for Linux/PPC. - - Changed the stack finding code to use environ on HP/UX. (Thanks - to Gustavo Rodriguez-Rivera for the suggestion.) This should probably - be done on other platforms, too. Since I can't test those, that'll - wait until after 5.0. - - Since 5.0alpha7: - - Fixed threadlibs.c for linux threads. -DUSE_LD_WRAP was broken and - -ldl was omitted. Fixed Linux stack finding code to handle - -DUSE_LD_WRAP correctly. - - Added MSWIN32 exception handler around marker, so that the collector - can recover from root segments that are unmapped during the collection. - This caused occasional failures under Windows 98, and may also be - an issue under Windows NT/2000. - - Since 5.0 - - Fixed a gc.h header bug which showed up under Irix. (Thanks to - Dan Sullivan.) - - Fixed a typo in GC_double_descr in typd_mlc.c not getting traced correctly. - This probably could result in objects described by array descriptors not - getting traced correctly. (Thanks to Ben Hutchings for pointing this out.) - - The block nearly full tests in reclaim.c were not correct for 64 bit - environments. This could result in unnecessary heap growth under unlikely - conditions. - - Removed use of CLEAR_DOUBLE from generic reclaim code, since odd sizes - could occur. - - To do: - - Integrate Linux/SPARC fixes. - - Very large root set sizes (> 16 MB or so) could cause the collector - to abort with an unexpected mark stack overflow. (Thanks again to - Peter Chubb.) NOT YET FIXED. Workaround is to increase the initial - size. - - The SGI version of the collector marks from mmapped pages, even - if they are not part of dynamic library static data areas. This - causes performance problems with some SGI libraries that use mmap - as a bitmap allocator. NOT YET FIXED. It may be possible to turn - off DYNAMIC_LOADING in the collector as a workaround. It may also - be possible to conditionally intercept mmap and use GC_exclude_static_roots. - The real fix is to walk rld data structures, which looks possible. - - Integrate MIT and DEC pthreads ports. - - Incremental collector should handle large objects better. Currently, - it looks like the whole object is treated as dirty if any part of it - is. - - Cord/cordprnt.c doesn't build on a few platforms (notably PowerPC), since - we make some unwarranted assumptions about how varargs are handled. This - currently makes the cord-aware versions of printf unusable on some platforms. - Fixing this is unfortunately not trivial. --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/README.Mac gcc-3.1/boehm-gc/README.Mac *** gcc-3.0.4/boehm-gc/README.Mac Mon Nov 1 23:15:51 1999 --- gcc-3.1/boehm-gc/README.Mac Thu Jan 1 00:00:00 1970 *************** *** 1,385 **** - Patrick Beard's Notes for building GC v4.12 with CodeWarrior Pro 2: - ---------------------------------------------------------------------------- - The current build environment for the collector is CodeWarrior Pro 2. - Projects for CodeWarrior Pro 2 (and for quite a few older versions) - are distributed in the file Mac_projects.sit.hqx. The project file - :Mac_projects:gc.prj builds static library versions of the collector. - :Mac_projects:gctest.prj builds the GC test suite. - - Configuring the collector is still done by editing the files - :Mac_files:MacOS_config.h and :Mac_files:MacOS_Test_config.h. - - Lars Farm's suggestions on building the collector: - ---------------------------------------------------------------------------- - Garbage Collection on MacOS - a manual 'MakeFile' - ------------------------------------------------- - - Project files and IDE's are great on the Macintosh, but they do have - problems when used as distribution media. This note tries to provide - porting instructions in pure TEXT form to avoid those problems. A manual - 'makefile' if you like. - - GC version: 4.12a2 - Codewarrior: CWPro1 - date: 18 July 1997 - - The notes may or may not apply to earlier or later versions of the - GC/CWPro. Actually, they do apply to earlier versions of both except that - until recently a project could only build one target so each target was a - separate project. The notes will most likely apply to future versions too. - Possibly with minor tweaks. - - This is just to record my experiences. These notes do not mean I now - provide a supported port of the GC to MacOS. It works for me. If it works - for you, great. If it doesn't, sorry, try again...;-) Still, if you find - errors, please let me know. - - mailto: lars.farm@ite.mh.se - - address: Lars Farm - Krönvägen 33b - 856 44 Sundsvall - Sweden - - Porting to MacOS is a bit more complex than it first seems. Which MacOS? - 68K/PowerPC? Which compiler? Each supports both 68K and PowerPC and offer a - large number of (unique to each environment) compiler settings. Each - combination of compiler/68K/PPC/settings require a unique combination of - standard libraries. And the IDE's does not select them for you. They don't - even check that the library is built with compatible setting and this is - the major source of problems when porting the GC (and otherwise too). - - You will have to make choices when you configure the GC. I've made some - choices here, but there are other combinations of settings and #defines - that work too. - - As for target settings the major obstacles may be: - - 68K Processor: check "4-byte Ints". - - PPC Processor: uncheck "Store Static Data in TOC". - - What you need to do: - =================== - - 1) Build the GC as a library - 2) Test that the library works with 'test.c'. - 3) Test that the C++ interface 'gc_cpp.cc/h' works with 'test_cpp.cc'. - - 1) The Libraries: - ================= - I made one project with four targets (68K/PPC tempmem or appheap). One target - will suffice if you're able to decide which one you want. I wasn't... - - Codewarrior allows a large number of compiler/linker settings. I used these: - - Settings shared by all targets: - ------------------------------ - o Access Paths: - - User Paths: the GC folder - - System Paths: {Compiler}:Metrowerks Standard Library: - {Compiler}:MacOS Support:Headers: - {Compiler}:MacOS Support:MacHeaders: - o C/C++ language: - - inlining: normal - - direct to SOM: off - - enable/check: exceptions, RTTI, bool (and if you like pool strings) - - PowerPC target settings - ----------------------- - o Target Settings: - - name of target - - MacOS PPC Linker - o PPC Target - - name of library - o C/C++ language - - prefix file as described below - o PPC Processor - - Struct Alignment: PowerPC - - uncheck "Store Static Data in TOC" -- important! - I don't think the others matter, I use full optimization and its ok - o PPC Linker - - Factory Settings (SYM file with full paths, faster linking, dead-strip - static init, Main: __start) - - - 68K target settings - ------------------- - o Target Settings: - - name of target - - MacOS 68K Linker - o 68K Target - - name of library - - A5 relative data - o C/C++ language - - prefix file as described below - o 68K Processor - - Code model: smart - - Struct alignment: 68K - - FP: SANE - - enable 4-Byte Ints -- important! - I don't think the others matter. I selected... - - enable: 68020 - - enable: global register allocation - o IR Optimizer - - enable: Optimize Space, Optimize Speed - I suppose the others would work too, but haven't tried... - o 68K Linker - - Factory Settings (New Style MacsBug,SYM file with full paths, - A6 Frames, fast link, Merge compiler glue into segment 1, - dead-strip static init) - - Prefix Files to configure the GC sources - ---------------------------------------- - The Codewarrior equivalent of commandline compilers -DNAME=X is to use - prefix-files. A TEXT file that is automatically #included before the first byte - of every source file. I used these: - - ---- ( cut here ) ---- gc_prefix_tempmem.h -- 68K and PPC ----- - #include "gc_prefix_common.h" - #undef USE_TEMPORARY_MEMORY - #define USE_TEMPORARY_MEMORY - ---- ( cut here ) ---- gc_prefix_appmem.h -- 68K and PPC ----- - #include "gc_prefix_common.h" - #undef USE_TEMPORARY_MEMORY - // #define USE_TEMPORARY_MEMORY - - ---- ( cut here ) ---- gc_prefix_common.h -------------------- - // gc_prefix_common.h - // ------------------ - // Codewarrior prefix file to configure the GC libraries - // - // prefix files are the Codewarrior equivalent of the - // command line option -Dname=x frequently seen in makefiles - - #if !__MWERKS__ - #error only tried this with Codewarrior - #endif - - #if macintosh - #define MSL_USE_PRECOMPILED_HEADERS 0 - #include - #ifndef __STDC__ - #define __STDC__ 0 - #endif - - // See list of #defines to configure the library in: 'MakeFile' - // see also README - - #define SILENT // no collection messages. In case - // of trouble you might want this off - #define ALL_INTERIOR_POINTERS // follows interior pointers. - //#define DONT_ADD_BYTE_AT_END // disables the padding if defined. - //#define SMALL_CONFIG // whether to use a smaller heap. - #define NO_SIGNALS // signals aren't real on the Macintosh. - #define ATOMIC_UNCOLLECTABLE // GC_malloc_atomic_uncollectable() - - // define either or none as per personal preference - // used in malloc.c - #define REDIRECT_MALLOC GC_malloc - //#define REDIRECT_MALLOC GC_malloc_uncollectable - // if REDIRECT_MALLOC is #defined make sure that the GC library - // is listed before the ANSI/ISO libs in the Codewarrior - // 'Link order' panel - //#define IGNORE_FREE - - // mac specific configs - //#define USE_TEMPORARY_MEMORY // use Macintosh temporary memory. - //#define SHARED_LIBRARY_BUILD // build for use in a shared library. - - #else - // could build Win32 here too, or in the future - // Rhapsody PPC-mach, Rhapsody PPC-MacOS, - // Rhapsody Intel-mach, Rhapsody Intel-Win32,... - // ... ugh this will get messy ... - #endif - - // make sure ints are at least 32-bit - // ( could be set to 16-bit by compiler settings (68K) ) - - struct gc_private_assert_intsize_{ char x[ sizeof(int)>=4 ? 1 : 0 ]; }; - - #if __powerc - #if __option(toc_data) - #error turn off "store static data in TOC" when using GC - // ... or find a way to add TOC to the root set...(?) - #endif - #endif - ---- ( cut here ) ---- end of gc_prefix_common.h ----------------- - - Files to build the GC libraries: - -------------------------------- - allchblk.c - alloc.c - blacklst.c - checksums.c - dbg_mlc.c - finalize.c - headers.c - mach_dep.c - MacOS.c -- contains MacOS code - malloc.c - mallocx.c - mark.c - mark_rts.c - misc.c - new_hblk.c - obj_map.c - os_dep.c -- contains MacOS code - ptr_chck.c - reclaim.c - stubborn.c - typd_mlc.c - gc++.cc -- this is 'gc_cpp.cc' with less 'inline' and - -- throw std::bad_alloc when out of memory - -- gc_cpp.cc works just fine too - - 2) Test that the library works with 'test.c'. - ============================================= - - The test app is just an ordinary ANSI-C console app. Make sure settings - match the library you're testing. - - Files - ----- - test.c - the GC library to test -- link order before ANSI libs - suitable Mac+ANSI libraries - - prefix: - ------ - ---- ( cut here ) ---- gc_prefix_testlib.h -- all libs ----- - #define MSL_USE_PRECOMPILED_HEADERS 0 - #include - #undef NDEBUG - - #define ALL_INTERIOR_POINTERS /* for GC_priv.h */ - ---- ( cut here ) ---- - - 3) Test that the C++ interface 'gc_cpp.cc/h' works with 'test_cpp.cc'. - - The test app is just an ordinary ANSI-C console app. Make sure settings match - the library you're testing. - - Files - ----- - test_cpp.cc - the GC library to test -- link order before ANSI libs - suitable Mac+ANSI libraries - - prefix: - ------ - same as for test.c - - For convenience I used one test-project with several targets so that all - test apps are build at once. Two for each library to test: test.c and - gc_app.cc. When I was satisfied that the libraries were ok. I put the - libraries + gc.h + the c++ interface-file in a folder that I then put into - the MSL hierarchy so that I don't have to alter access-paths in projects - that use the GC. - - After that, just add the proper GC library to your project and the GC is in - action! malloc will call GC_malloc and free GC_free, new/delete too. You - don't have to call free or delete. You may have to be a bit cautious about - delete if you're freeing other resources than RAM. See gc_cpp.h. You can - also keep coding as always with delete/free. That works too. If you want, - "include and tweak it's use a bit. - - Symantec SPM - ============ - It has been a while since I tried the GC in SPM, but I think that the above - instructions should be sufficient to guide you through in SPM too. SPM - needs to know where the global data is. Use the files 'datastart.c' and - 'dataend.c'. Put 'datastart.c' at the top of your project and 'dataend.c' - at the bottom of your project so that all data is surrounded. This is not - needed in Codewarrior because it provides intrinsic variables - __datastart__, __data_end__ that wraps all globals. - - Source Changes (GC 4.12a2) - ========================== - Very few. Just one tiny in the GC, not strictly needed. - - MacOS.c line 131 in routine GC_MacFreeTemporaryMemory() - change # if !defined(SHARED_LIBRARY_BUILD) - to # if !defined(SILENT) && !defined(SHARED_LIBRARY_BUILD) - To turn off a message when the application quits (actually, I faked - this change by #defining SHARED_LIBRARY_BUILD in a statically linked - library for more than a year without ill effects but perhaps this is - better). - - - test_cpp.cc - made the first lines of main() look like this: - ------------ - int main( int argc, char* argv[] ) { - #endif - #if macintosh // MacOS - char* argv_[] = {"test_cpp","10"}; // doesn't - argv=argv_; // have a - argc = sizeof(argv_)/sizeof(argv_[0]); // commandline - #endif // - - int i, iters, n; - # ifndef __GNUC__ - alloc dummy_to_fool_the_compiler_into_doing_things_it_currently_cant_handle; - ------------ - - - config.h [now gcconfig.h] - __MWERKS__ does not have to mean MACOS. You can use Codewarrior to - build a Win32 or BeOS library and soon a Rhapsody library. You may - have to change that #if... - - - - It worked for me, hope it works for you. - - Lars Farm - 18 July 1997 - ---------------------------------------------------------------------------- - - - Patrick Beard's instructions (may be dated): - - v4.3 of the collector now runs under Symantec C++/THINK C v7.0.4, and - Metrowerks C/C++ v4.5 both 68K and PowerPC. Project files are provided - to build and test the collector under both development systems. - - Configuration - ------------- - - To configure the collector, under both development systems, a prefix file - is used to set preprocessor directives. This file is called "MacOS_config.h". - Also to test the collector, "MacOS_Test_config.h" is provided. - - Testing - ------- - - To test the collector (always a good idea), build one of the gctest projects, - gctest.¹ (Symantec C++/THINK C), mw/gctest.68K.¹, or mw/gctest.PPC.¹. The - test will ask you how many times to run; 1 should be sufficient. - - Building - -------- - - For your convenience project files for the major Macintosh development - systems are provided. - - For Symantec C++/THINK C, you must build the two projects gclib-1.¹ and - gclib-2.¹. It has to be split up because the collector has more than 32k - of static data and no library can have more than this in the Symantec - environment. (Future versions will probably fix this.) - - For Metrowerks C/C++ 4.5 you build gc.68K.¹/gc.PPC.¹ and the result will - be a library called gc.68K.lib/gc.PPC.lib. - - Using - ----- - - Under Symantec C++/THINK C, you can just add the gclib-1.¹ and gclib-2.¹ - projects to your own project. Under Metrowerks, you add gc.68K.lib or - gc.PPC.lib and two additional files. You add the files called datastart.c - and dataend.c to your project, bracketing all files that use the collector. - See mw/gctest.¹ for an example. - - Include the projects/libraries you built above into your own project, - #include "gc.h", and call GC_malloc. You don't have to call GC_free. - - - Patrick C. Beard - January 4, 1995 --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/README.OS2 gcc-3.1/boehm-gc/README.OS2 *** gcc-3.0.4/boehm-gc/README.OS2 Wed Jun 30 12:42:42 1999 --- gcc-3.1/boehm-gc/README.OS2 Thu Jan 1 00:00:00 1970 *************** *** 1,6 **** - The code assumes static linking, and a single thread. The editor de has - not been ported. The cord test program has. The supplied OS2_MAKEFILE - assumes the IBM C Set/2 environment, but the code shouldn't. - - Since we haven't figured out hoe to do perform partial links or to build static - libraries, clients currently need to link against a long list of executables. --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/README.QUICK gcc-3.1/boehm-gc/README.QUICK *** gcc-3.0.4/boehm-gc/README.QUICK Mon Nov 1 23:15:51 1999 --- gcc-3.1/boehm-gc/README.QUICK Thu Jan 1 00:00:00 1970 *************** *** 1,43 **** - Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers - Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved. - Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. - Copyright (c) 1999 by Hewlett-Packard. All rights reserved. - - THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - - Permission is hereby granted to use or copy this program - for any purpose, provided the above notices are retained on all copies. - Permission to modify the code and to distribute modified code is granted, - provided the above notices are retained, and a notice that the code was - modified is included with the above copyright notice. - - - For more details and the names of other contributors, see the - README file and gc.h. This file describes typical use of - the collector on a machine that is already supported. - - INSTALLATION: - Under UN*X, type "make test". Under OS/2 or Windows NT, copy the - appropriate makefile to MAKEFILE, read it, and type "nmake test". - Read the machine specific README if one exists. The only way to - develop code with the collector for Windows 3.1 is to develop under - Windows NT, and then to use win32S. - - If you wish to use the cord (structured string) library type - "make cords". (This requires an ANSI C compiler. You may need - to redefine CC in the Makefile.) - - If you wish to use the collector from C++, type - "make c++". These add further files to gc.a and to the include - subdirectory. See cord/cord.h and gc_c++.h. - - TYPICAL USE: - Include "gc.h" from this directory. Link against the appropriate library - ("gc.a" under UN*X). Replace calls to malloc by calls to GC_MALLOC, - and calls to realloc by calls to GC_REALLOC. If the object is known - to never contain pointers, use GC_MALLOC_ATOMIC instead of - GC_MALLOC. - - Define GC_DEBUG before including gc.h for additional checking. - --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/README.alpha gcc-3.1/boehm-gc/README.alpha *** gcc-3.0.4/boehm-gc/README.alpha Mon Nov 1 23:15:51 1999 --- gcc-3.1/boehm-gc/README.alpha Thu Jan 1 00:00:00 1970 *************** *** 1,22 **** - Should work under OSF/1 and Linux. Currently no VMS or NT support, though - the latter shouldn't be hard. - - Incremental gc not yet supported under Linux because signal handler - for SIGSEGV can't get a hold of fault address. Dynamic library support - is also missing from Linux/alpha, probably for no good reason. - - Currently there is no thread support in the standard distribution. There - exists a separate port to DEC Unix pthreads. It should be possible to - port the X86 Linux threads support to Alpha without much trouble. - - If you get asssembler errors, be sure to read the first few lines of the - Makefile. - - From Philippe Queinnec: - - System: DEC/Alpha OSF1 v3.2, vendor cc - Problem: can't link if libgc has been compiled with "cc -std1". - It works if the library has been compiled with either gcc or "cc" - alone. The problem is because the variable "end" is not defined if - compiling in std1 mode (see man ld). - Proposed fix: none. Don't use cc -std1 ! --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/README.amiga gcc-3.1/boehm-gc/README.amiga *** gcc-3.0.4/boehm-gc/README.amiga Mon Nov 1 23:15:51 1999 --- gcc-3.1/boehm-gc/README.amiga Thu Jan 1 00:00:00 1970 *************** *** 1,180 **** - =========================================================================== - Martin Tauchmann's notes (1-Apr-99) - =========================================================================== - - Works now, also with the GNU-C compiler V2.7.2.1. - Modify the `Makefile` - CC=cc $(ABI_FLAG) - to - CC=gcc $(ABI_FLAG) - - TECHNICAL NOTES - - - `GC_get_stack_base()`, `GC_register_data_segments()` works now with every - C compiler; also Workbench. - - - Removed AMIGA_SKIP_SEG, but the Code-Segment must not be scanned by GC. - - - PROBLEMS - - When the Linker, does`t merge all Code-Segments to an single one. LD of GCC - do it always. - - - With ixemul.library V47.3, when an GC program launched from another program - (example: `Make` or `if_mach M68K AMIGA gctest`), `GC_register_data_segments()` - found the Segment-List of the caller program. - Can be fixed, if the run-time initialization code (for C programs, usually *crt0*) - support `__data` and `__bss`. - - - PowerPC Amiga currently not supported. - - - Dynamic libraries (dyn_load.c) not supported. - - - TESTED WITH SOFTWARE - - `Optimized Oberon 2 C` (oo2c) - - - TESTED WITH HARDWARE - - MC68030 - - - CONTACT - - Please, contact me at , when you change the - Amiga port. - - =========================================================================== - Michel Schinz's notes - =========================================================================== - WHO DID WHAT - - The original Amiga port was made by Jesper Peterson. I (Michel Schinz) - modified it slightly to reflect the changes made in the new official - distributions, and to take advantage of the new SAS/C 6.x features. I also - created a makefile to compile the "cord" package (see the cord - subdirectory). - - TECHNICAL NOTES - - In addition to Jesper's notes, I have the following to say: - - - Starting with version 4.3, gctest checks to see if the code segment is - added to the root set or not, and complains if it is. Previous versions - of this Amiga port added the code segment to the root set, so I tried to - fix that. The only problem is that, as far as I know, it is impossible to - know which segments are code segments and which are data segments (there - are indeed solutions to this problem, like scanning the program on disk - or patch the LoadSeg functions, but they are rather complicated). The - solution I have chosen (see os_dep.c) is to test whether the program - counter is in the segment we are about to add to the root set, and if it - is, to skip the segment. The problems are that this solution is rather - awkward and that it works only for one code segment. This means that if - your program has more than one code segment, all of them but one will be - added to the root set. This isn't a big problem in fact, since the - collector will continue to work correctly, but it may be slower. - - Anyway, the code which decides whether to skip a segment or not can be - removed simply by not defining AMIGA_SKIP_SEG. But notice that if you do - so, gctest will complain (it will say that "GC_is_visible produced wrong - failure indication"). However, it may be useful if you happen to have - pointers stored in a code segment (you really shouldn't). - - If anyone has a good solution to the problem of finding, when a program - is loaded in memory, whether a segment is a code or a data segment, - please let me know. - - PROBLEMS - - If you have any problem with this version, please contact me at - schinz@alphanet.ch (but do *not* send long files, since we pay for - every mail!). - - =========================================================================== - Jesper Peterson's notes - =========================================================================== - - ADDITIONAL NOTES FOR AMIGA PORT - - These notes assume some familiarity with Amiga internals. - - WHY I PORTED TO THE AMIGA - - The sole reason why I made this port was as a first step in getting - the Sather(*) language on the Amiga. A port of this language will - be done as soon as the Sather 1.0 sources are made available to me. - Given this motivation, the garbage collection (GC) port is rather - minimal. - - (*) For information on Sather read the comp.lang.sather newsgroup. - - LIMITATIONS - - This port assumes that the startup code linked with target programs - is that supplied with SAS/C versions 6.0 or later. This allows - assumptions to be made about where to find the stack base pointer - and data segments when programs are run from WorkBench, as opposed - to running from the CLI. The compiler dependent code is all in the - GC_get_stack_base() and GC_register_data_segments() functions, but - may spread as I add Amiga specific features. - - Given that SAS/C was assumed, the port is set up to be built with - "smake" using the "SMakefile". Compiler options in "SCoptions" can - be set with "scopts" program. Both "smake" and "scopts" are part of - the SAS/C commercial development system. - - In keeping with the porting philosophy outlined above, this port - will not behave well with Amiga specific code. Especially not inter- - process comms via messages, and setting up public structures like - Intuition objects or anything else in the system lists. For the - time being the use of this library is limited to single threaded - ANSI/POSIX compliant or near-complient code. (ie. Stick to stdio - for now). Given this limitation there is currently no mechanism for - allocating "CHIP" or "PUBLIC" memory under the garbage collector. - I'll add this after giving it considerable thought. The major - problem is the entire physical address space may have to me scanned, - since there is no telling who we may have passed memory to. - - If you allocate your own stack in client code, you will have to - assign the pointer plus stack size to GC_stackbottom. - - The initial stack size of the target program can be compiled in by - setting the __stack symbol (see SAS documentaion). It can be over- - ridden from the CLI by running the AmigaDOS "stack" program, or from - the WorkBench by setting the stack size in the tool types window. - - SAS/C COMPILER OPTIONS (SCoptions) - - You may wish to check the "CPU" code option is appropriate for your - intended target system. - - Under no circumstances set the "StackExtend" code option in either - compiling the library or *ANY* client code. - - All benign compiler warnings have been suppressed. These mainly - involve lack of prototypes in the code, and dead assignments - detected by the optimizer. - - THE GOOD NEWS - - The library as it stands is compatible with the GigaMem commercial - virtual memory software, and probably similar PD software. - - The performance of "gctest" on an Amiga 2630 (68030 @ 25Mhz) - compares favourably with an HP9000 with similar architecture (a 325 - with a 68030 I think). - - ----------------------------------------------------------------------- - - The Amiga port has been brought to you by: - - Jesper Peterson. - - jep@mtiame.mtia.oz.au (preferred, but 1 week turnaround) - jep@orca1.vic.design.telecom.au (that's orca, 1 day turnaround) - - At least one of these addresses should be around for a while, even - though I don't work for either of the companies involved. - --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/README.debugging gcc-3.1/boehm-gc/README.debugging *** gcc-3.0.4/boehm-gc/README.debugging Wed Apr 19 10:09:57 2000 --- gcc-3.1/boehm-gc/README.debugging Thu Jan 1 00:00:00 1970 *************** *** 1,68 **** - Debugging suggestions: - - ****If you get a segmentation fault or bus error while debugging with a debugger: - If the fault occurred in GC_find_limit, or with incremental collection enabled, this is probably normal. The collector installs handlers to take care of these. You will not see these unless you are using a debugger. Your debugger should allow you to continue. It's preferable to tell the debugger to ignore SIGBUS and SIGSEGV ("handle" in gdb, "ignore" in most versions of dbx) and set a breakpoint in abort. The collector will call abort if the signal had another cause, and there was not other handler previously installed. I recommend debugging without incremental collection if possible. (This applies directly to UNIX systems. Debugging with incremental collection under win32 is worse. See README.win32.) - - ****If you get warning messages informing you that the collector needed to allocate blacklisted blocks: - - 0) Ignore these warnings while you are using GC_DEBUG. Some of the routines mentioned below don't have debugging equivalents. (Alternatively, write the missing routines and send them to me.) - - 1) Replace allocator calls that request large blocks with calls to GC_malloc_ignore_off_page or GC_malloc_atomic_ignore_off_page. You may want to set a breakpoint in GC_default_warn_proc to help you identify such calls. Make sure that a pointer to somewhere near the beginning of the resulting block is maintained in a (preferably volatile) variable as long as the block is needed. - - 2) If the large blocks are allocated with realloc, I suggest instead allocating them with something like the following. Note that the realloc size increment should be fairly large (e.g. a factor of 3/2) for this to exhibit reasonable performance. But we all know we should do that anyway. - - void * big_realloc(void *p, size_t new_size) - { - size_t old_size = GC_size(p); - void * result; - - if (new_size <= 10000) return(GC_realloc(p, new_size)); - if (new_size <= old_size) return(p); - result = GC_malloc_ignore_off_page(new_size); - if (result == 0) return(0); - memcpy(result,p,old_size); - GC_free(p); - return(result); - } - - 3) In the unlikely case that even relatively small object (<20KB) allocations are triggering these warnings, then your address space contains lots of "bogus pointers", i.e. values that appear to be pointers but aren't. Usually this can be solved by using GC_malloc_atomic or the routines in gc_typed.h to allocate large pointerfree regions of bitmaps, etc. Sometimes the problem can be solved with trivial changes of encoding in certain values. It is possible, though not pleasant, to identify the source of the bogus pointers by setting a breakpoint in GC_add_to_black_list_stack, and looking at the value of current_p in the GC_mark_from_mark_stack frame. Current_p contains the address of the bogus pointer. - - 4) If you get only a fixed number of these warnings, you are probably only introducing a bounded leak by ignoring them. If the data structures being allocated are intended to be permanent, then it is also safe to ignore them. The warnings can be turned off by calling GC_set_warn_proc with a procedure that ignores these warnings (e.g. by doing absolutely nothing). - - - ****If the collector dies in GC_malloc while trying to remove a free list element: - - 1) With > 99% probability, you wrote past the end of an allocated object. Try setting GC_DEBUG and using the debugging facilities in gc.h. - - - ****If the heap grows too much: - - 1) Consider using GC_malloc_atomic for objects containing nonpointers. This is especially important for large arrays containg compressed data, pseudo-random numbers, and the like. (This isn't all that likely to solve your problem, but it's a useful and easy optimization anyway, and this is a good time to try it.) If you allocate large objects containg only one or two pointers at the beginning, either try the typed allocation primitives is gc.h, or separate out the pointerfree component. - 2) If you are using the collector in its default mode, with interior pointer recognition enabled, consider using GC_malloc_ignore_off_page to allocate large objects. (See gc.h and above for details. Large means > 100K in most environments.) - 3) GC_print_block_list() will print a list of all currently allocated heap blocks and what size objects they contain. GC_print_hblkfreelist() will print a list of free heap blocks, and whether they are blacklisted. GC_dump calls both of these, and also prints information about heap sections, and root segments. - 4) Build the collector with -DKEEP_BACK_PTRS, and use the backptr.h - interface to determine why objects are being retained. - - - ****If the collector appears to be losing objects: - - 1) Replace all calls to GC_malloc_atomic and typed allocation by GC_malloc calls. If this fixes the problem, gradually reinsert your optimizations. - 2) You may also want to try the safe(r) pointer manipulation primitives in gc.h. But those are hard to use until the preprocessor becomes available. - 3) Try using the GC_DEBUG facilities. This is less likely to be successful here than if the collector crashes. - [The rest of these are primarily for wizards. You shouldn't need them unless you're doing something really strange, or debugging a collector port.] - 4) Don't turn on incremental collection. If that fixes the problem, suspect a bug in the dirty bit implementation. Try compiling with -DCHECKSUMS to check for modified, but supposedly clean, pages. - 5) On a SPARC, in a single-threaded environment, GC_print_callers(GC_arrays._last_stack) prints a cryptic stack trace as of the time of the last collection. (You will need a debugger to decipher the result.) The question to ask then is "why should this object have been accessible at the time of the last collection? Where was a pointer to it stored?". This facility should be easy to add for some other collector ports (namely if it's easy to traverse stack frames), but will be hard for others. - 6) "print *GC_find_header(p)" in dbx or gdb will print the garbage collector block header information associated with the object p (e.g. object size, etc.) - 7) GC_is_marked(p) determines whether p is the base address of a marked object. Note that objects allocated since the last collection should not be marked, and that unmarked objects are reclaimed incrementally. It's usually most interesting to set a breakpoint in GC_finish_collection and then to determine how much of the damaged data structure is marked at that point. - 8) Look at the tracing facility in mark.c. (Ignore this suggestion unless you are very familiar with collector internals.) - 9) [From Melissa O'Neill:] - If you're using multiple threads, double check that all thread - creation goes through the GC_ wrapper functions rather than - calling the thread-creation functions themselves (e.g., - GC_pthread_create rather than pthread_create). The gc.h header - file includes suitable preprocessor definitions to accomplish - this mapping transparently -- the question is: are you including - it in all the modules that create threads? - - - --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/README.dj gcc-3.1/boehm-gc/README.dj *** gcc-3.0.4/boehm-gc/README.dj Wed Jun 30 12:42:48 1999 --- gcc-3.1/boehm-gc/README.dj Thu Jan 1 00:00:00 1970 *************** *** 1,12 **** - [Original version supplied by Xiaokun Zhu ] - [This version came mostly from Gary Leavens. ] - - Look first at Makefile.dj, and possibly change the definitions of - RM and MV if you don't have rm and mv installed. - Then use Makefile.dj to compile the garbage collector. - For example, you can do: - - make -f Makefile.dj test - - All the tests should work fine. - --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/README.hp gcc-3.1/boehm-gc/README.hp *** gcc-3.0.4/boehm-gc/README.hp Mon Nov 1 23:15:51 1999 --- gcc-3.1/boehm-gc/README.hp Thu Jan 1 00:00:00 1970 *************** *** 1,16 **** - Dynamic loading support requires that executables be linked with -ldld. - The alternative is to build the collector without defining DYNAMIC_LOADING - in gcconfig.h and ensuring that all garbage collectable objects are - accessible without considering statically allocated variables in dynamic - libraries. - - The collector should compile with either plain cc or cc -Ae. CC -Aa - fails to define _HPUX_SOURCE and thus will not configure the collector - correctly. - - Incremental collection support was reccently added, and should now work. - - Thread support for HP/UX 11 Pthreads was also recently added. It is still - flakey in this release. (It has only been tested on a uniprocessor. Even - there some fraction of thread creation calls fail with a not-yet-understood - error return from sem_wait.) --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/README.linux gcc-3.1/boehm-gc/README.linux *** gcc-3.0.4/boehm-gc/README.linux Wed Apr 19 10:09:57 2000 --- gcc-3.1/boehm-gc/README.linux Thu Jan 1 00:00:00 1970 *************** *** 1,68 **** - See README.alpha for Linux on DEC AXP info. - - This file applies mostly to Linux/Intel IA32. Ports to Linux on an M68K - and PowerPC are also integrated. They should behave similarly, except that - the PowerPC port lacks incremental GC support, and it is unknown to what - extent the Linux threads code is functional. - - Incremental GC is supported on Intel IA32 and M68K. - - Dynamic libraries are supported on an ELF system. A static executable - should be linked with the gcc option "-Wl,-defsym,_DYNAMIC=0". - - The collector appears to work with Linux threads. We have seen - intermittent hangs in sem_wait. So far we have been unable to reproduce - these unless the process was being debugged or traced. Thus it's - possible that the only real issue is that the debugger loses - signals on rare occasions. - - The garbage collector uses SIGPWR and SIGXCPU if it is used with - Linux threads. These should not be touched by the client program. - - To use threads, you need to abide by the following requirements: - - 1) You need to use LinuxThreads (which are included in libc6). - - The collector relies on some implementation details of the LinuxThreads - package. It is unlikely that this code will work on other - pthread implementations (in particular it will *not* work with - MIT pthreads). - - 2) You must compile the collector with -DLINUX_THREADS and -D_REENTRANT - specified in the Makefile. - - 3a) Every file that makes thread calls should define LINUX_THREADS and - _REENTRANT and then include gc.h. Gc.h redefines some of the - pthread primitives as macros which also provide the collector with - information it requires. - - 3b) A new alternative to (3a) is to build the collector with - -DUSE_LD_WRAP, and to link the final program with - - (for ld) --wrap read --wrap dlopen --wrap pthread_create \ - --wrap pthread_join --wrap pthread_sigmask - - (for gcc) -Wl,--wrap -Wl,read -Wl,--wrap -Wl,dlopen -Wl,--wrap \ - -Wl,pthread_create -Wl,--wrap -Wl,pthread_join -Wl,--wrap \ - -Wl,pthread_sigmask - - In any case, _REENTRANT should be defined during compilation. - - 4) Dlopen() disables collection during its execution. (It can't run - concurrently with the collector, since the collector looks at its - data structures. It can't acquire the allocator lock, since arbitrary - user startup code may run as part of dlopen().) Under unusual - conditions, this may cause unexpected heap growth. - - 5) The combination of LINUX_THREADS, REDIRECT_MALLOC, and incremental - collection fails in seemingly random places. This hasn't been tracked - down yet, but is perhaps not completely astonishing. The thread package - uses malloc, and thus can presumably get SIGSEGVs while inside the - package. There is no real guarantee that signals are handled properly - at that point. - - 6) Thread local storage may not be viewed as part of the root set by the - collector. This probably depends on the linuxthreads version. For the - time being, any collectable memory referenced by thread local storage should - also be referenced from elsewhere, or be allocated as uncollectable. - (This is really a bug that should be fixed somehow.) --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/README.rs6000 gcc-3.1/boehm-gc/README.rs6000 *** gcc-3.0.4/boehm-gc/README.rs6000 Mon Nov 1 23:15:51 1999 --- gcc-3.1/boehm-gc/README.rs6000 Thu Jan 1 00:00:00 1970 *************** *** 1,9 **** - We have so far failed to find a good way to determine the stack base. - It is highly recommended that GC_stackbottom be set explicitly on program - startup. The supplied value sometimes causes failure under AIX 4.1, though - it appears to work under 3.X. HEURISTIC2 seems to work under 4.1, but - involves a substantial performance penalty, and will fail if there is - no limit on stack size. - - There is no thread support. (I assume recent versions of AIX provide - pthreads? I no longer have access to a machine ...) --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/README.sgi gcc-3.1/boehm-gc/README.sgi *** gcc-3.0.4/boehm-gc/README.sgi Mon Nov 1 23:15:51 1999 --- gcc-3.1/boehm-gc/README.sgi Thu Jan 1 00:00:00 1970 *************** *** 1,41 **** - Performance of the incremental collector can be greatly enhanced with - -DNO_EXECUTE_PERMISSION. - - The collector should run with all of the -32, -n32 and -64 ABIs. Remember to - define the AS macro in the Makefile to be "as -64", or "as -n32". - - If you use -DREDIRECT_MALLOC=GC_malloc with C++ code, your code should make - at least one explicit call to malloc instead of new to ensure that the proper - version of malloc is linked in. - - Sproc threads are not supported in this version, though there may exist other - ports. - - Pthreads support is provided. This requires that: - - 1) You compile the collector with -DIRIX_THREADS specified in the Makefile. - - 2) You have the latest pthreads patches installed. - - (Though the collector makes only documented pthread calls, - it relies on signal/threads interactions working just right in ways - that are not required by the standard. It is unlikely that this code - will run on other pthreads platforms. But please tell me if it does.) - - 3) Every file that makes thread calls should define IRIX_THREADS and then - include gc.h. Gc.h redefines some of the pthread primitives as macros which - also provide the collector with information it requires. - - 4) pthread_cond_wait and pthread_cond_timed_wait should be prepared for - premature wakeups. (I believe the pthreads and realted standards require this - anyway. Irix pthreads often terminate a wait if a signal arrives. - The garbage collector uses signals to stop threads.) - - 5) It is expensive to stop a thread waiting in IO at the time the request is - initiated. Applications with many such threads may not exhibit acceptable - performance with the collector. (Increasing the heap size may help.) - - 6) The collector should not be compiled with -DREDIRECT_MALLOC. This - confuses some library calls made by the pthreads implementation, which - expect the standard malloc. - --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/README.solaris2 gcc-3.1/boehm-gc/README.solaris2 *** gcc-3.0.4/boehm-gc/README.solaris2 Wed Apr 19 10:09:57 2000 --- gcc-3.1/boehm-gc/README.solaris2 Thu Jan 1 00:00:00 1970 *************** *** 1,62 **** - The collector supports both incremental collection and threads under - Solaris 2. The incremental collector normally retrieves page dirty information - through the appropriate /proc calls. But it can also be configured - (by defining MPROTECT_VDB instead of PROC_VDB in gcconfig.h) to use mprotect - and signals. This may result in shorter pause times, but it is no longer - safe to issue arbitrary system calls that write to the heap. - - Under other UNIX versions, - the collector normally obtains memory through sbrk. There is some reason - to expect that this is not safe if the client program also calls the system - malloc, or especially realloc. The sbrk man page strongly suggests this is - not safe: "Many library routines use malloc() internally, so use brk() - and sbrk() only when you know that malloc() definitely will not be used by - any library routine." This doesn't make a lot of sense to me, since there - seems to be no documentation as to which routines can transitively call malloc. - Nonetheless, under Solaris2, the collector now (since 4.12) allocates - memory using mmap by default. (It defines USE_MMAP in gcconfig.h.) - You may want to reverse this decisions if you use -DREDIRECT_MALLOC=... - - - SOLARIS THREADS: - - The collector must be compiled with -DSOLARIS_THREADS to be thread safe. - It is also essential that gc.h be included in files that call thr_create, - thr_join, thr_suspend, thr_continue, or dlopen. Gc.h macro defines - these to also do GC bookkeeping, etc. Gc.h must be included with - SOLARIS_THREADS defined, otherwise these replacements are not visible. - A collector built in this way way only be used by programs that are - linked with the threads library. - - If you are using the Pthreads interface, also define _SOLARIS_PTHREADS. - - In this mode, the collector contains various workarounds for older Solaris - bugs. Mostly, these should not be noticeable unless you look at system - call traces. However, it cannot protect a guard page at the end of - a thread stack. If you know that you will only be running Solaris2.5 - or later, it should be possible to fix this by compiling the collector - with -DSOLARIS23_MPROTECT_BUG_FIXED. - - Since 5.0 alpha5, dlopen disables collection temporarily, - unless USE_PROC_FOR_LIBRARIES is defined. In some unlikely cases, this - can result in unpleasant heap growth. But it seems better than the - race/deadlock issues we had before. - - If solaris_threads are used on an X86 processor with malloc redirected to - GC_malloc, it is necessary to call GC_thr_init explicitly before forking the - first thread. (This avoids a deadlock arising from calling GC_thr_init - with the allocation lock held.) - - It appears that there is a problem in using gc_cpp.h in conjunction with - Solaris threads and Sun's C++ runtime. Apparently the overloaded new operator - is invoked by some iostream initialization code before threads are correctly - initialized. As a result, call to thr_self() in garbage collector - initialization segfaults. Currently the only known workaround is to not - invoke the garbage collector from a user defined global operator new, or to - have it invoke the garbage-collector's allocators only after main has started. - (Note that the latter requires a moderately expensive test in operator - delete.) - - Hans-J. Boehm - (The above contains my personal opinions, which are probably not shared - by anyone else.) --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/README.uts gcc-3.1/boehm-gc/README.uts *** gcc-3.0.4/boehm-gc/README.uts Wed Jun 30 12:42:56 1999 --- gcc-3.1/boehm-gc/README.uts Thu Jan 1 00:00:00 1970 *************** *** 1,2 **** - Alistair Crooks supplied the port. He used Lexa C version 2.1.3 with - -Xa to compile. --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/README.win32 gcc-3.1/boehm-gc/README.win32 *** gcc-3.0.4/boehm-gc/README.win32 Mon Nov 1 23:15:51 1999 --- gcc-3.1/boehm-gc/README.win32 Thu Jan 1 00:00:00 1970 *************** *** 1,149 **** - The collector has only been compiled under Windows NT, with the - original Microsoft SDK, with Visual C++ 2.0 and later, with - the GNU win32 environment, with Borland 4.5, and recently with - Watcom C. - - It runs under both win32s and win32, but with different semantics. - Under win32, all writable pages outside of the heaps and stack are - scanned for roots. Thus the collector sees pointers in DLL data - segments. Under win32s, only the main data segment is scanned. - (The main data segment should always be scanned. Under some - versions of win32s, other regions may also be scanned.) - Thus all accessible objects should be accessible from local variables - or variables in the main data segment. Alternatively, other data - segments (e.g. in DLLs) may be registered with the collector by - calling GC_init() and then GC_register_root_section(a), where - a is the address of some variable inside the data segment. (Duplicate - registrations are ignored, but not terribly quickly.) - - (There are two reasons for this. We didn't want to see many 16:16 - pointers. And the VirtualQuery call has different semantics under - the two systems, and under different versions of win32s.) - - The collector test program "gctest" is linked as a GUI application, - but does not open any windows. Its output appears in the file - "gc.log". It may be started from the file manager. The hour glass - cursor will appear as long as it's running. If it is started from the - command line, it will usually run in the background. Wait a few - minutes (a few seconds on a modern machine) before you check the output. - You should see either a failure indication or a "Collector appears to - work" message. - - The cord test program has not been ported (but should port - easily). A toy editor (cord/de.exe) based on cords (heavyweight - strings represented as trees) has been ported and is included. - It runs fine under either win32 or win32S. It serves as an example - of a true Windows application, except that it was written by a - nonexpert Windows programmer. (There are some peculiarities - in the way files are displayed. The is displayed explicitly - for standard DOS text files. As in the UNIX version, control - characters are displayed explicitly, but in this case as red text. - This may be suboptimal for some tastes and/or sets of default - window colors.) - - For Microsoft development tools, rename NT_MAKEFILE as - MAKEFILE. (Make sure that the CPU environment variable is defined - to be i386.) - - For GNU-win32, use the regular makefile, possibly after uncommenting - the line "include Makefile.DLLs". The latter should be necessary only - if you want to package the collector as a DLL. The GNU-win32 port is - believed to work only for b18, not b19, probably dues to linker changes - in b19. This is probably fixable with a different definition of - DATASTART and DATAEND in gcconfig.h. - - For Borland tools, use BCC_MAKEFILE. Note that - Borland's compiler defaults to 1 byte alignment in structures (-a1), - whereas Visual C++ appears to default to 8 byte alignment (/Zp8). - The garbage collector in its default configuration EXPECTS AT - LEAST 4 BYTE ALIGNMENT. Thus the BORLAND DEFAULT MUST - BE OVERRIDDEN. (In my opinion, it should usually be anyway. - I expect that -a1 introduces major performance penalties on a - 486 or Pentium.) Note that this changes structure layouts. (As a last - resort, gcconfig.h can be changed to allow 1 byte alignment. But - this has significant negative performance implications.) - The Makefile is set up to assume Borland 4.5. If you have another - version, change the line near the top. By default, it does not - require the assembler. If you do have the assembler, I recommend - removing the -DUSE_GENERIC. - - Incremental collection support was recently added. This is - currently pretty simpleminded. Pages are protected. Protection - faults are caught by a handler installed at the bottom of the handler - stack. This is both slow and interacts poorly with a debugger. - Whenever possible, I recommend adding a call to - GC_enable_incremental at the last possible moment, after most - debugging is complete. Unlike the UNIX versions, no system - calls are wrapped by the collector itself. It may be necessary - to wrap ReadFile calls that use a buffer in the heap, so that the - call does not encounter a protection fault while it's running. - (As usual, none of this is an issue unless GC_enable_incremental - is called.) - - Note that incremental collection is disabled with -DSMALL_CONFIG, - which is the default for win32. If you need incremental collection, - undefine SMALL_CONFIG. - - Incremental collection is not supported under win32s, and it may not - be possible to do so. However, win32 applications that attempt to use - incremental collection should continue to run, since the - collector detects if it's running under win32s and turns calls to - GC_enable_incremental() into noops. - - James Clark has contributed the necessary code to support win32 threads. - This code is known to exhibit some problems with incremental collection - enabled. Use NT_THREADS_MAKEFILE (a.k.a gc.mak) instead of NT_MAKEFILE - to build this version. Note that this requires some files whose names - are more than 8 + 3 characters long. Thus you should unpack the tar file - so that long file names are preserved. To build the garbage collector - test with VC++ from the command line, use - - nmake /F ".\gc.mak" CFG="gctest - Win32 Release" - - This requires that the subdirectory gctest\Release exist. - The test program and DLL will reside in the Release directory. - - This version relies on the collector residing in a dll. - - This version currently supports incremental collection only if it is - enabled before any additional threads are created. - Version 4.13 attempts to fix some of the earlier problems, but there - may be other issues. If you need solid support for win32 threads, you - might check with Geodesic Systems. Their collector must be licensed, - but they have invested far more time in win32-specific issues. - - Hans - - Ivan V. Demakov's README for the Watcom port: - - The collector has been compiled with Watcom C 10.6 and 11.0. - It runs under win32, win32s, and even under msdos with dos4gw - dos-extender. It should also run under OS/2, though this isn't - tested. Under win32 the collector can be built either as dll - or as static library. - - Note that all compilations were done under Windows 95 or NT. - For unknown reason compiling under Windows 3.11 for NT (one - attempt has been made) leads to broken executables. - - Incremental collection is not supported. - - cord is not ported. - - Before compiling you may need to edit WCC_MAKEFILE to set target - platform, library type (dynamic or static), calling conventions, and - optimization options. - - To compile the collector and testing programs use the command: - wmake -f WCC_MAKEFILE - - All programs using gc should be compiled with 4-byte alignment. - For further explanations on this see comments about Borland. - - If gc compiled as dll, the macro ``GC_DLL'' should be defined before - including "gc.h" (for example, with -DGC_DLL compiler option). It's - important, otherwise resulting programs will not run. - - Ivan Demakov (email: ivan@tgrad.nsk.su) - - --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/SCoptions.amiga gcc-3.1/boehm-gc/SCoptions.amiga *** gcc-3.0.4/boehm-gc/SCoptions.amiga Wed Jun 30 12:42:59 1999 --- gcc-3.1/boehm-gc/SCoptions.amiga Thu Jan 1 00:00:00 1970 *************** *** 1,16 **** - CPU=68030 - NOSTACKCHECK - OPTIMIZE - VERBOSE - MAPHUNK - NOVERSION - NOICONS - OPTIMIZERTIME - DEFINE SILENT - DEFINE AMIGA_SKIP_SEG - IGNORE=85 - IGNORE=154 - IGNORE=161 - IGNORE=100 - OPTIMIZERCOMPLEXITY=4 - OPTIMIZERDEPTH=3 --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/SMakefile.amiga gcc-3.1/boehm-gc/SMakefile.amiga *** gcc-3.0.4/boehm-gc/SMakefile.amiga Mon Nov 1 23:15:51 1999 --- gcc-3.1/boehm-gc/SMakefile.amiga Fri Aug 17 18:30:45 2001 *************** *** 1,48 **** - OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o headers.o mark.o obj_map.o blacklst.o finalize.o new_hblk.o real_malloc.o dyn_load.o dbg_mlc.o malloc.o stubborn.o checksums.o typd_mlc.o ptr_chck.o ! INC= gc_private.h gc_hdrs.h gc.h gcconfig.h ! all: gctest setjmp_t alloc.o : alloc.c $(INC) reclaim.o : reclaim.c $(INC) allchblk.o : allchblk.c $(INC) misc.o : misc.c $(INC) ! os_dep.o : os_dep.c $(INC) mark_rts.o : mark_rts.c $(INC) headers.o : headers.c $(INC) mark.o : mark.c $(INC) obj_map.o : obj_map.c $(INC) blacklst.o : blacklst.c $(INC) finalize.o : finalize.c $(INC) ! sc noopt finalize.c # There seems to be a bug in the optimizer (V6.51). ! # gctest won't work if you remove this... new_hblk.o : new_hblk.c $(INC) real_malloc.o : real_malloc.c $(INC) dyn_load.o : dyn_load.c $(INC) dbg_mlc.o : dbg_mlc.c $(INC) malloc.o : malloc.c $(INC) ! mallocx.o : malloc.c $(INC) stubborn.o : stubborn.c $(INC) checksums.o : checksums.c $(INC) typd_mlc.o: typd_mlc.c $(INC) mach_dep.o : mach_dep.c $(INC) ptr_chck.o: ptr_chck.c $(INC) test.o : test.c $(INC) ! gc.lib: $(OBJS) ! oml gc.lib r $(OBJS) - clean: - delete gc.lib gctest setjmp_t \#?.o ! gctest: gc.lib test.o ! slink LIB:c.o test.o to $@ lib gc.lib LIB:sc.lib LIB:scm.lib - setjmp_t: setjmp_t.c gc.h - sc setjmp_t.c - slink LIB:c.o $@.o to $@ lib LIB:sc.lib - test: setjmp_t gctest - setjmp_t - gctest --- 1,178 ---- ! # Rewritten smakefile for amiga / sas/c. -Kjetil M. ! # Dont use the cord-package if you define parm=both or parm=reg. ! ! #----------------TOOLS-------------------------------- ! CC=sc ! LINKER=slink ! LIBER=oml ! ! #----------------CPU OPTIONS-------------------------- ! ! CPU=68060 ! ! #----------------FPU OPTIONS-------------------------- ! ! MATH=8 ! MATHLIB=LIB:scm881.lib ! ! #----------------COMPILER OPTIONS--------------------- ! ! IGNORE= IGNORE=85 IGNORE=154 IGNORE=161 IGNORE=100 ! ! OPTIMIZE=optimize optimizetime optglobal optimizerdepth=100 optimizerpeephole optloop OPTSCHED optimizerinlocal optimizerrecurdepth=100 ! # optimizerinline optimizercomplexity=100 ! ! OPT= $(OPTIMIZE) CPU=$(CPU) math=$(MATH) NOSTACKCHECK VERBOSE \ ! MAPHUNK NOVERSION NOICONS nodebug \ ! DEFINE SILENT \ ! parm=reg \ ! DEFINE __USE_SYSBASE ! ! ! SOPT= $(OPT) $(IGNORE) \ ! DEFINE AMIGA_SKIP_SEG \ ! DEFINE ATOMIC_UNCOLLECTABLE \ ! DEFINE GC_AMIGA_FASTALLOC \ ! DEFINE GC_AMIGA_RETRY \ ! DEFINE GC_AMIGA_PRINTSTATS \ ! DEFINE GC_AMIGA_GC ! ! ! #DEFINE ALL_INTERIOR_POINTERS \ ! ! ! SCOPT= $(SOPT) define GC_AMIGA_MAKINGLIB ! ! CSCOPT= $(OPT) DEFINE AMIGA IGNORE=100 IGNORE=161 ! ! #------------------LINKING---------------------------- ! ! ! all: gctest setjmp_t cord/cordtest ! ! clean: ! delete *.lib gctest setjmp_t *.o *.lnk cord/*.o cord/*.lib cord/*.lnk cord/cordtest ! smake ! ! test: setjmp_t gctest cord/cordtest ! setjmp_t ! gctest ! cord/cordtest ! ! gctest: gc$(CPU).lib GCAmigaOS$(CPU).lib test.o ! $(LINKER) LIB:c.o test.o TO gctest LIB gc$(CPU).lib LIB:sc.lib $(MATHLIB) ! ! setjmp_t: setjmp_t.o gc.h ! $(LINKER) LIB:c.o setjmp_t.o to setjmp_t lib LIB:sc.lib ! ! cord/cordtest: cord/cordtest.o cord/cord$(CPU).lib gc$(CPU).lib ! slink LIB:c.o cord/cordtest.o LIB $(MATHLIB) gc$(CPU).lib cord/cord$(CPU).lib LIB:sc.lib TO cord/cordtest ! ! ! #------------------LIBBING---------------------------- ! ! OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o headers.o mark.o obj_map.o blacklst.o finalize.o new_hblk.o real_malloc.o dyn_load.o dbg_mlc.o malloc.o stubborn.o checksums.o typd_mlc.o ptr_chck.o mallocx.o ! ! gc$(CPU).lib: $(OBJS) ! $(LIBER) gc$(CPU).lib r $(OBJS) ! ! ! COBJS = cord/cordbscs.o cord/cordprnt.o cord/cordxtra.o ! ! cord/cord$(CPU).lib: $(COBJS) ! oml cord/cord$(CPU).lib r $(COBJS) ! ! #------------------COMPILING-------------------------- ! ! INC= gc_private.h gc_hdrs.h gc.h gcconfig.h alloc.o : alloc.c $(INC) + $(CC) alloc.c $(SCOPT) ignore=7 + reclaim.o : reclaim.c $(INC) + $(CC) reclaim.c $(SCOPT) + allchblk.o : allchblk.c $(INC) + $(CC) allchblk.c $(SCOPT) + misc.o : misc.c $(INC) ! $(CC) misc.c $(SCOPT) ! ! os_dep.o : os_dep.c $(INC) AmigaOS.c ! $(CC) os_dep.c $(SCOPT) ! mark_rts.o : mark_rts.c $(INC) + $(CC) mark_rts.c $(SCOPT) + headers.o : headers.c $(INC) + $(CC) headers.c $(SCOPT) + mark.o : mark.c $(INC) + $(CC) mark.c $(SCOPT) + obj_map.o : obj_map.c $(INC) + $(CC) obj_map.c $(SCOPT) + blacklst.o : blacklst.c $(INC) + $(CC) blacklst.c $(SCOPT) + finalize.o : finalize.c $(INC) ! $(CC) finalize.c $(SCOPT) noopt #Could sas/c still have problems with this one? Gctest sometimes fails to finalize all. ! new_hblk.o : new_hblk.c $(INC) + $(CC) new_hblk.c $(SCOPT) + real_malloc.o : real_malloc.c $(INC) + $(CC) real_malloc.c $(SCOPT) + dyn_load.o : dyn_load.c $(INC) + $(CC) dyn_load.c $(SCOPT) + dbg_mlc.o : dbg_mlc.c $(INC) + $(CC) dbg_mlc.c $(SCOPT) + malloc.o : malloc.c $(INC) ! $(CC) malloc.c $(SCOPT) ! ! mallocx.o : mallocx.c $(INC) ! $(CC) mallocx.c $(SCOPT) ! stubborn.o : stubborn.c $(INC) + $(CC) stubborn.c $(SCOPT) + checksums.o : checksums.c $(INC) + $(CC) checksums.c $(SCOPT) + typd_mlc.o: typd_mlc.c $(INC) + $(CC) typd_mlc.c $(SCOPT) + mach_dep.o : mach_dep.c $(INC) + $(CC) mach_dep.c $(SCOPT) + ptr_chck.o: ptr_chck.c $(INC) + $(CC) ptr_chck.c $(SCOPT) + test.o : test.c $(INC) + $(CC) test.c $(SOPT) ! setjmp_t: setjmp_t.c gc.h ! $(CC) setjmp_t.c $(SOPT) ! # cords: ! ! cord/cordbscs.o: cord/cordbscs.c ! sc cord/cordbscs.c $(CSCOPT) ! ! cord/cordprnt.o: cord/cordprnt.c ! sc cord/cordprnt.c $(CSCOPT) ! ! cord/cordxtra.o: cord/cordxtra.c ! sc cord/cordxtra.c $(CSCOPT) ! ! cord/cordtest.o: cord/cordtest.c ! sc cord/cordtest.c $(CSCOPT) diff -Nrc3pad gcc-3.0.4/boehm-gc/WCC_MAKEFILE gcc-3.1/boehm-gc/WCC_MAKEFILE *** gcc-3.0.4/boehm-gc/WCC_MAKEFILE Mon Nov 1 23:15:51 1999 --- gcc-3.1/boehm-gc/WCC_MAKEFILE Fri Aug 17 18:30:45 2001 *************** test_cpp.exe: test_cpp.obj gc.lib *** 169,177 **** gc_cpp.obj: gc_cpp.cc .AUTODEPEND $(CXX) $(TEST_CXXFLAGS) -iinclude $*.cc ! test.obj: test.c .AUTODEPEND $(CC) $(TEST_CFLAGS) $*.c ! test_cpp.obj: test_cpp.cc .AUTODEPEND $(CXX) $(TEST_CXXFLAGS) -iinclude $*.cc --- 169,177 ---- gc_cpp.obj: gc_cpp.cc .AUTODEPEND $(CXX) $(TEST_CXXFLAGS) -iinclude $*.cc ! test.obj: tests\test.c .AUTODEPEND $(CC) $(TEST_CFLAGS) $*.c ! test_cpp.obj: tests\test_cpp.cc .AUTODEPEND $(CXX) $(TEST_CXXFLAGS) -iinclude $*.cc diff -Nrc3pad gcc-3.0.4/boehm-gc/acinclude.m4 gcc-3.1/boehm-gc/acinclude.m4 *** gcc-3.0.4/boehm-gc/acinclude.m4 Tue Jul 3 22:29:46 2001 --- gcc-3.1/boehm-gc/acinclude.m4 Tue Oct 16 09:01:35 2001 *************** *** 1,10 **** # FIXME: We temporarily define our own version of AC_PROG_CC. This is # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We # are probably using a cross compiler, which will not be able to fully # link an executable. This should really be fixed in autoconf # itself. ! AC_DEFUN(BOEHM_CONFIGURE, [ dnl Default to --enable-multilib AC_ARG_ENABLE(multilib, --- 1,23 ---- + # Copyright (c) 1999-2001 by Red Hat, Inc. All rights reserved. + # + # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED + # OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + # + # Permission is hereby granted to use or copy this program + # for any purpose, provided the above notices are retained on all copies. + # Permission to modify the code and to distribute modified code is granted, + # provided the above notices are retained, and a notice that the code was + # modified is included with the above copyright notice. + # + # Original author: Tom Tromey + # FIXME: We temporarily define our own version of AC_PROG_CC. This is # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We # are probably using a cross compiler, which will not be able to fully # link an executable. This should really be fixed in autoconf # itself. ! AC_DEFUN(GC_CONFIGURE, [ dnl Default to --enable-multilib AC_ARG_ENABLE(multilib, *************** AC_ARG_ENABLE(multilib, *** 18,34 **** dnl We may get other options which we don't document: dnl --with-target-subdir, --with-multisrctop, --with-multisubdir if test "[$]{srcdir}" = "."; then ! if test "[$]{with_target_subdir}" != "."; then ! boehm_gc_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" else ! boehm_gc_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" fi else ! boehm_gc_basedir="[$]{srcdir}/$1" fi ! AC_SUBST(boehm_gc_basedir) ! AC_CONFIG_AUX_DIR($boehm_gc_basedir/..) if :; then :; else # This overrides the previous occurrence for automake, but not for # autoconf, which is exactly what we want. --- 31,48 ---- dnl We may get other options which we don't document: dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + dnl I needed to add the -n test to allow configuration in src directory - HB if test "[$]{srcdir}" = "."; then ! if test "[$]{with_target_subdir}" != "." -a -n "[$]{with_target_subdir}"; then ! gc_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" else ! gc_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" fi else ! gc_basedir="[$]{srcdir}/$1" fi ! AC_SUBST(gc_basedir) ! AC_CONFIG_AUX_DIR($gc_basedir/..) if :; then :; else # This overrides the previous occurrence for automake, but not for # autoconf, which is exactly what we want. *************** AC_CANONICAL_SYSTEM *** 41,47 **** mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs" AC_SUBST(mkinstalldirs) ! AM_INIT_AUTOMAKE(boehm-gc, 5.1, no-define) # FIXME: We temporarily define our own version of AC_PROG_CC. This is # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We --- 55,61 ---- mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs" AC_SUBST(mkinstalldirs) ! AM_INIT_AUTOMAKE(gc, 6.1a1, no-define) # FIXME: We temporarily define our own version of AC_PROG_CC. This is # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We *************** AM_MAINTAINER_MODE *** 141,167 **** # automake happy, but we don't execute it, since we don't care about # the result. if false; then AC_EXEEXT fi . [$]{srcdir}/configure.host ! case [$]{boehm_gc_basedir} in ! /* | [A-Za-z]:[/\\]*) boehm_gc_flagbasedir=[$]{boehm_gc_basedir} ;; ! *) boehm_gc_flagbasedir='[$](top_builddir)/'[$]{boehm_gc_basedir} ;; esac ! boehm_gc_cflags="[$]{boehm_gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{boehm_gc_flagbasedir}/libc/include" case "${host}" in *-*-cygwin32*) ! boehm_gc_cflags="[$]{boehm_gc_cflags} -I[$]{boehm_gc_flagbasedir}/../winsup/include" ;; esac ! boehm_gc_cflags="[$]{boehm_gc_cflags} -fno-builtin" ! BOEHM_GC_CFLAGS=${boehm_gc_cflags} ! AC_SUBST(BOEHM_GC_CFLAGS) ])) )))) --- 155,185 ---- # automake happy, but we don't execute it, since we don't care about # the result. if false; then + # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands + # to nothing, so nothing would remain between `then' and `fi' if it + # were not for the `:' below. + : AC_EXEEXT fi . [$]{srcdir}/configure.host ! case [$]{gc_basedir} in ! /* | [A-Za-z]:[/\\]*) gc_flagbasedir=[$]{gc_basedir} ;; ! *) gc_flagbasedir='[$](top_builddir)/'[$]{gc_basedir} ;; esac ! gc_cflags="[$]{gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{gc_flagbasedir}/libc/include" case "${host}" in *-*-cygwin32*) ! gc_cflags="[$]{gc_cflags} -I[$]{gc_flagbasedir}/../winsup/include" ;; esac ! dnl gc_cflags="[$]{gc_cflags} -fno-builtin" ! GC_CFLAGS=${gc_cflags} ! AC_SUBST(GC_CFLAGS) ])) )))) diff -Nrc3pad gcc-3.0.4/boehm-gc/aclocal.m4 gcc-3.1/boehm-gc/aclocal.m4 *** gcc-3.0.4/boehm-gc/aclocal.m4 Wed Feb 20 19:40:48 2002 --- gcc-3.1/boehm-gc/aclocal.m4 Wed May 15 02:40:18 2002 *************** dnl but WITHOUT ANY WARRANTY, to the ext *** 10,22 **** dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. # FIXME: We temporarily define our own version of AC_PROG_CC. This is # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We # are probably using a cross compiler, which will not be able to fully # link an executable. This should really be fixed in autoconf # itself. ! AC_DEFUN(BOEHM_CONFIGURE, [ dnl Default to --enable-multilib AC_ARG_ENABLE(multilib, --- 10,35 ---- dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. + # Copyright (c) 1999-2001 by Red Hat, Inc. All rights reserved. + # + # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED + # OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + # + # Permission is hereby granted to use or copy this program + # for any purpose, provided the above notices are retained on all copies. + # Permission to modify the code and to distribute modified code is granted, + # provided the above notices are retained, and a notice that the code was + # modified is included with the above copyright notice. + # + # Original author: Tom Tromey + # FIXME: We temporarily define our own version of AC_PROG_CC. This is # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We # are probably using a cross compiler, which will not be able to fully # link an executable. This should really be fixed in autoconf # itself. ! AC_DEFUN(GC_CONFIGURE, [ dnl Default to --enable-multilib AC_ARG_ENABLE(multilib, *************** AC_ARG_ENABLE(multilib, *** 30,46 **** dnl We may get other options which we don't document: dnl --with-target-subdir, --with-multisrctop, --with-multisubdir if test "[$]{srcdir}" = "."; then ! if test "[$]{with_target_subdir}" != "."; then ! boehm_gc_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" else ! boehm_gc_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" fi else ! boehm_gc_basedir="[$]{srcdir}/$1" fi ! AC_SUBST(boehm_gc_basedir) ! AC_CONFIG_AUX_DIR($boehm_gc_basedir/..) if :; then :; else # This overrides the previous occurrence for automake, but not for # autoconf, which is exactly what we want. --- 43,60 ---- dnl We may get other options which we don't document: dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + dnl I needed to add the -n test to allow configuration in src directory - HB if test "[$]{srcdir}" = "."; then ! if test "[$]{with_target_subdir}" != "." -a -n "[$]{with_target_subdir}"; then ! gc_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" else ! gc_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" fi else ! gc_basedir="[$]{srcdir}/$1" fi ! AC_SUBST(gc_basedir) ! AC_CONFIG_AUX_DIR($gc_basedir/..) if :; then :; else # This overrides the previous occurrence for automake, but not for # autoconf, which is exactly what we want. *************** AC_CANONICAL_SYSTEM *** 53,59 **** mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs" AC_SUBST(mkinstalldirs) ! AM_INIT_AUTOMAKE(boehm-gc, 5.1, no-define) # FIXME: We temporarily define our own version of AC_PROG_CC. This is # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We --- 67,73 ---- mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs" AC_SUBST(mkinstalldirs) ! AM_INIT_AUTOMAKE(gc, 6.0, no-define) # FIXME: We temporarily define our own version of AC_PROG_CC. This is # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We *************** AM_MAINTAINER_MODE *** 153,179 **** # automake happy, but we don't execute it, since we don't care about # the result. if false; then AC_EXEEXT fi . [$]{srcdir}/configure.host ! case [$]{boehm_gc_basedir} in ! /* | [A-Za-z]:[/\\]*) boehm_gc_flagbasedir=[$]{boehm_gc_basedir} ;; ! *) boehm_gc_flagbasedir='[$](top_builddir)/'[$]{boehm_gc_basedir} ;; esac ! boehm_gc_cflags="[$]{boehm_gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{boehm_gc_flagbasedir}/libc/include" case "${host}" in *-*-cygwin32*) ! boehm_gc_cflags="[$]{boehm_gc_cflags} -I[$]{boehm_gc_flagbasedir}/../winsup/include" ;; esac ! boehm_gc_cflags="[$]{boehm_gc_cflags} -fno-builtin" ! BOEHM_GC_CFLAGS=${boehm_gc_cflags} ! AC_SUBST(BOEHM_GC_CFLAGS) ])) )))) --- 167,197 ---- # automake happy, but we don't execute it, since we don't care about # the result. if false; then + # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands + # to nothing, so nothing would remain between `then' and `fi' if it + # were not for the `:' below. + : AC_EXEEXT fi . [$]{srcdir}/configure.host ! case [$]{gc_basedir} in ! /* | [A-Za-z]:[/\\]*) gc_flagbasedir=[$]{gc_basedir} ;; ! *) gc_flagbasedir='[$](top_builddir)/'[$]{gc_basedir} ;; esac ! gc_cflags="[$]{gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{gc_flagbasedir}/libc/include" case "${host}" in *-*-cygwin32*) ! gc_cflags="[$]{gc_cflags} -I[$]{gc_flagbasedir}/../winsup/include" ;; esac ! dnl gc_cflags="[$]{gc_cflags} -fno-builtin" ! GC_CFLAGS=${gc_cflags} ! AC_SUBST(GC_CFLAGS) ])) )))) diff -Nrc3pad gcc-3.0.4/boehm-gc/add_gc_prefix.c gcc-3.1/boehm-gc/add_gc_prefix.c *** gcc-3.0.4/boehm-gc/add_gc_prefix.c Wed Jun 30 12:43:06 1999 --- gcc-3.1/boehm-gc/add_gc_prefix.c Sat Aug 18 01:04:42 2001 *************** *** 1,4 **** --- 1,5 ---- # include + # include "version.h" int main(argc, argv, envp) int argc; *************** char ** envp; *** 8,14 **** int i; for (i = 1; i < argc; i++) { ! printf("gc/%s ", argv[i]); } return(0); } --- 9,20 ---- int i; for (i = 1; i < argc; i++) { ! if (GC_ALPHA_VERSION == GC_NOT_ALPHA) { ! printf("gc%d.%d/%s ", GC_VERSION_MAJOR, GC_VERSION_MINOR, argv[i]); ! } else { ! printf("gc%d.%dalpha%d/%s ", GC_VERSION_MAJOR, ! GC_VERSION_MINOR, GC_ALPHA_VERSION, argv[i]); ! } } return(0); } diff -Nrc3pad gcc-3.0.4/boehm-gc/allchblk.c gcc-3.1/boehm-gc/allchblk.c *** gcc-3.0.4/boehm-gc/allchblk.c Wed Apr 19 10:09:57 2000 --- gcc-3.1/boehm-gc/allchblk.c Tue Apr 9 00:03:24 2002 *************** *** 14,23 **** * modified is included with the above copyright notice. */ ! #define DEBUG ! #undef DEBUG #include ! #include "gc_priv.h" GC_bool GC_use_entire_heap = 0; --- 14,22 ---- * modified is included with the above copyright notice. */ ! /* #define DEBUG */ #include ! #include "private/gc_priv.h" GC_bool GC_use_entire_heap = 0; *************** GC_bool GC_use_entire_heap = 0; *** 47,52 **** --- 46,80 ---- struct hblk * GC_hblkfreelist[N_HBLK_FLS+1] = { 0 }; + #ifndef USE_MUNMAP + word GC_free_bytes[N_HBLK_FLS+1] = { 0 }; + /* Number of free bytes on each list. */ + + /* Is bytes + the number of free bytes on lists n .. N_HBLK_FLS */ + /* > GC_max_large_allocd_bytes? */ + GC_bool GC_enough_large_bytes_left(bytes,n) + word bytes; + int n; + { + int i; + for (i = N_HBLK_FLS; i >= n; --i) { + bytes += GC_free_bytes[i]; + if (bytes > GC_max_large_allocd_bytes) return TRUE; + } + return FALSE; + } + + # define INCR_FREE_BYTES(n, b) GC_free_bytes[n] += (b); + + # define FREE_ASSERT(e) GC_ASSERT(e) + + #else /* USE_MUNMAP */ + + # define INCR_FREE_BYTES(n, b) + # define FREE_ASSERT(e) + + #endif /* USE_MUNMAP */ + /* Map a number of blocks to the appropriate large block free list index. */ int GC_hblk_fl_from_blocks(blocks_needed) word blocks_needed; *************** word blocks_needed; *** 58,64 **** } - # define HBLK_IS_FREE(hdr) ((hdr) -> hb_map == GC_invalid_map) # define PHDR(hhdr) HDR(hhdr -> hb_prev) # define NHDR(hhdr) HDR(hhdr -> hb_next) --- 86,91 ---- *************** void GC_print_hblkfreelist() *** 79,85 **** for (i = 0; i <= N_HBLK_FLS; ++i) { h = GC_hblkfreelist[i]; ! if (0 != h) GC_printf1("Free list %ld:\n", (unsigned long)i); while (h != 0) { hhdr = HDR(h); sz = hhdr -> hb_sz; --- 106,119 ---- for (i = 0; i <= N_HBLK_FLS; ++i) { h = GC_hblkfreelist[i]; ! # ifdef USE_MUNMAP ! if (0 != h) GC_printf1("Free list %ld (Total size %ld):\n", ! (unsigned long)i); ! # else ! if (0 != h) GC_printf2("Free list %ld (Total size %ld):\n", ! (unsigned long)i, ! (unsigned long)GC_free_bytes[i]); ! # endif while (h != 0) { hhdr = HDR(h); sz = hhdr -> hb_sz; *************** void GC_remove_from_fl(hhdr, n) *** 219,232 **** hdr * hhdr; int n; { GC_ASSERT(((hhdr -> hb_sz) & (HBLKSIZE-1)) == 0); if (hhdr -> hb_prev == 0) { ! int index; ! if (FL_UNKNOWN == n) { index = GC_hblk_fl_from_blocks(divHBLKSZ(hhdr -> hb_sz)); ! } else { index = n; ! } GC_ASSERT(HDR(GC_hblkfreelist[index]) == hhdr); GC_hblkfreelist[index] = hhdr -> hb_next; } else { --- 253,277 ---- hdr * hhdr; int n; { + int index; + GC_ASSERT(((hhdr -> hb_sz) & (HBLKSIZE-1)) == 0); + # ifndef USE_MUNMAP + /* We always need index to mainatin free counts. */ + if (FL_UNKNOWN == n) { + index = GC_hblk_fl_from_blocks(divHBLKSZ(hhdr -> hb_sz)); + } else { + index = n; + } + # endif if (hhdr -> hb_prev == 0) { ! # ifdef USE_MUNMAP ! if (FL_UNKNOWN == n) { index = GC_hblk_fl_from_blocks(divHBLKSZ(hhdr -> hb_sz)); ! } else { index = n; ! } ! # endif GC_ASSERT(HDR(GC_hblkfreelist[index]) == hhdr); GC_hblkfreelist[index] = hhdr -> hb_next; } else { *************** int n; *** 234,239 **** --- 279,286 ---- GET_HDR(hhdr -> hb_prev, phdr); phdr -> hb_next = hhdr -> hb_next; } + INCR_FREE_BYTES(index, - (signed_word)(hhdr -> hb_sz)); + FREE_ASSERT(GC_free_bytes[index] >= 0); if (0 != hhdr -> hb_next) { hdr * nhdr; GC_ASSERT(!IS_FORWARDING_ADDR_OR_NIL(NHDR(hhdr))); *************** hdr * hhdr; *** 294,299 **** --- 341,348 ---- # endif GC_ASSERT(((hhdr -> hb_sz) & (HBLKSIZE-1)) == 0); GC_hblkfreelist[index] = h; + INCR_FREE_BYTES(index, hhdr -> hb_sz); + FREE_ASSERT(GC_free_bytes[index] <= GC_large_free_bytes) hhdr -> hb_next = second; hhdr -> hb_prev = 0; if (0 != second) { *************** int index; *** 419,425 **** rest_hdr -> hb_sz = total_size - bytes; rest_hdr -> hb_flags = 0; # ifdef GC_ASSERTIONS ! // Mark h not free, to avoid assertion about adjacent free blocks. hhdr -> hb_map = 0; # endif GC_add_to_fl(rest, rest_hdr); --- 468,474 ---- rest_hdr -> hb_sz = total_size - bytes; rest_hdr -> hb_flags = 0; # ifdef GC_ASSERTIONS ! /* Mark h not free, to avoid assertion about adjacent free blocks. */ hhdr -> hb_map = 0; # endif GC_add_to_fl(rest, rest_hdr); *************** int index; /* Index of free list */ *** 463,468 **** --- 512,519 ---- if (0 != next) { HDR(next) -> hb_prev = n; } + INCR_FREE_BYTES(index, -(signed_word)h_size); + FREE_ASSERT(GC_free_bytes[index] > 0); # ifdef GC_ASSERTIONS nhdr -> hb_map = 0; /* Don't fail test for consecutive */ /* free blocks in GC_add_to_fl. */ *************** struct hblk * GC_allochblk_nth(); *** 484,503 **** * NOTE: We set obj_map field in header correctly. * Caller is responsible for building an object freelist in block. * ! * We clear the block if it is destined for large objects, and if ! * kind requires that newly allocated objects be cleared. */ struct hblk * GC_allochblk(sz, kind, flags) word sz; int kind; ! unsigned char flags; /* IGNORE_OFF_PAGE or 0 */ { ! int start_list = GC_hblk_fl_from_blocks(OBJ_SZ_TO_BLOCKS(sz)); int i; for (i = start_list; i <= N_HBLK_FLS; ++i) { struct hblk * result = GC_allochblk_nth(sz, kind, flags, i); ! if (0 != result) return result; } return 0; } --- 535,557 ---- * NOTE: We set obj_map field in header correctly. * Caller is responsible for building an object freelist in block. * ! * Unlike older versions of the collectors, the client is responsible ! * for clearing the block, if necessary. */ struct hblk * GC_allochblk(sz, kind, flags) word sz; int kind; ! unsigned flags; /* IGNORE_OFF_PAGE or 0 */ { ! word blocks = OBJ_SZ_TO_BLOCKS(sz); ! int start_list = GC_hblk_fl_from_blocks(blocks); int i; for (i = start_list; i <= N_HBLK_FLS; ++i) { struct hblk * result = GC_allochblk_nth(sz, kind, flags, i); ! if (0 != result) { ! return result; ! } } return 0; } *************** int n; *** 526,537 **** GET_HDR(hbp, hhdr); size_avail = hhdr->hb_sz; if (size_avail < size_needed) continue; ! if (!GC_use_entire_heap) { ! if (size_avail != size_needed ! && USED_HEAP_SIZE >= GC_requested_heapsize ! && !GC_incremental && GC_should_collect()) { continue; ! } } /* If the next heap block is obviously better, go on. */ /* This prevents us from disassembling a single large block */ --- 580,601 ---- GET_HDR(hbp, hhdr); size_avail = hhdr->hb_sz; if (size_avail < size_needed) continue; ! if (!GC_use_entire_heap ! && size_avail != size_needed ! && USED_HEAP_SIZE >= GC_requested_heapsize ! && !GC_incremental && GC_should_collect()) { ! # ifdef USE_MUNMAP continue; ! # else ! /* If we enough large blocks left to cover any */ ! /* previous request for large blocks, we go ahead */ ! /* and split. Assuming a steady state, that should */ ! /* be safe. It means that we can use the full */ ! /* heap if we allocate only small objects. */ ! if (!GC_enough_large_bytes_left(GC_large_allocd_bytes, n)) { ! continue; ! } ! # endif /* !USE_MUNMAP */ } /* If the next heap block is obviously better, go on. */ /* This prevents us from disassembling a single large block */ *************** int n; *** 562,568 **** while ((ptr_t)lasthbp <= search_end && (thishbp = GC_is_black_listed(lasthbp, ! (word)eff_size_needed))) { lasthbp = thishbp; } size_avail -= (ptr_t)lasthbp - (ptr_t)hbp; --- 626,633 ---- while ((ptr_t)lasthbp <= search_end && (thishbp = GC_is_black_listed(lasthbp, ! (word)eff_size_needed)) ! != 0) { lasthbp = thishbp; } size_avail -= (ptr_t)lasthbp - (ptr_t)hbp; *************** int n; *** 573,579 **** /* Make sure it's mapped before we mangle it. */ # ifdef USE_MUNMAP if (!IS_MAPPED(hhdr)) { ! GC_remap((ptr_t)hbp, size_avail); hhdr -> hb_flags &= ~WAS_UNMAPPED; } # endif --- 638,644 ---- /* Make sure it's mapped before we mangle it. */ # ifdef USE_MUNMAP if (!IS_MAPPED(hhdr)) { ! GC_remap((ptr_t)hbp, hhdr -> hb_sz); hhdr -> hb_flags &= ~WAS_UNMAPPED; } # endif *************** int n; *** 589,596 **** && orig_avail - size_needed > (signed_word)BL_LIMIT) { /* Punt, since anything else risks unreasonable heap growth. */ ! WARN("Needed to allocate blacklisted block at 0x%lx\n", ! (word)hbp); size_avail = orig_avail; } else if (size_avail == 0 && size_needed == HBLKSIZE && IS_MAPPED(hhdr)) { --- 654,667 ---- && orig_avail - size_needed > (signed_word)BL_LIMIT) { /* Punt, since anything else risks unreasonable heap growth. */ ! if (++GC_large_alloc_warn_suppressed ! >= GC_large_alloc_warn_interval) { ! WARN("Repeated allocation of very large block " ! "(appr. size %ld):\n" ! "\tMay lead to memory leak and poor performance.\n", ! size_needed); ! GC_large_alloc_warn_suppressed = 0; ! } size_avail = orig_avail; } else if (size_avail == 0 && size_needed == HBLKSIZE && IS_MAPPED(hhdr)) { *************** int n; *** 618,627 **** if (h == hbp || 0 != (hhdr = GC_install_header(h))) { (void) setup_header( hhdr, ! BYTES_TO_WORDS(HBLKSIZE - HDR_BYTES), PTRFREE, 0); /* Cant fail */ if (GC_debugging_started) { ! BZERO(h + HDR_BYTES, HBLKSIZE - HDR_BYTES); } } } --- 689,698 ---- if (h == hbp || 0 != (hhdr = GC_install_header(h))) { (void) setup_header( hhdr, ! BYTES_TO_WORDS(HBLKSIZE), PTRFREE, 0); /* Cant fail */ if (GC_debugging_started) { ! BZERO(h, HBLKSIZE); } } } *************** int n; *** 638,644 **** if( size_avail >= size_needed ) { # ifdef USE_MUNMAP if (!IS_MAPPED(hhdr)) { ! GC_remap((ptr_t)hbp, size_avail); hhdr -> hb_flags &= ~WAS_UNMAPPED; } # endif --- 709,715 ---- if( size_avail >= size_needed ) { # ifdef USE_MUNMAP if (!IS_MAPPED(hhdr)) { ! GC_remap((ptr_t)hbp, hhdr -> hb_sz); hhdr -> hb_flags &= ~WAS_UNMAPPED; } # endif *************** int n; *** 651,659 **** if (0 == hbp) return 0; - /* Notify virtual dirty bit implementation that we are about to write. */ - GC_write_hint(hbp); - /* Add it to map of valid blocks */ if (!GC_install_counts(hbp, (word)size_needed)) return(0); /* This leaks memory under very rare conditions. */ --- 722,727 ---- *************** int n; *** 663,675 **** GC_remove_counts(hbp, (word)size_needed); return(0); /* ditto */ } - - /* Clear block if necessary */ - if (GC_debugging_started - || sz > MAXOBJSZ && GC_obj_kinds[kind].ok_init) { - BZERO(hbp + HDR_BYTES, size_needed - HDR_BYTES); - } /* We just successfully allocated a block. Restart count of */ /* consecutive failures. */ { --- 731,742 ---- GC_remove_counts(hbp, (word)size_needed); return(0); /* ditto */ } + /* Notify virtual dirty bit implementation that we are about to write. */ + /* Ensure that pointerfree objects are not protected if it's avoidable. */ + GC_remove_protection(hbp, divHBLKSZ(size_needed), + (hhdr -> hb_descr == 0) /* pointer-free */); + /* We just successfully allocated a block. Restart count of */ /* consecutive failures. */ { *************** signed_word size; *** 712,717 **** --- 779,785 ---- if (HBLK_IS_FREE(hhdr)) { GC_printf1("Duplicate large block deallocation of 0x%lx\n", (unsigned long) hbp); + ABORT("Duplicate large block deallocation"); } GC_ASSERT(IS_MAPPED(hhdr)); diff -Nrc3pad gcc-3.0.4/boehm-gc/alloc.c gcc-3.1/boehm-gc/alloc.c *** gcc-3.0.4/boehm-gc/alloc.c Wed Apr 19 10:09:57 2000 --- gcc-3.1/boehm-gc/alloc.c Tue Feb 12 04:37:53 2002 *************** *** 16,25 **** */ ! # include "gc_priv.h" # include ! # ifndef MACOS # include # include # endif --- 16,25 ---- */ ! # include "private/gc_priv.h" # include ! # if !defined(MACOS) && !defined(MSWINCE) # include # include # endif *************** word GC_non_gc_bytes = 0; /* Number of *** 60,68 **** word GC_gc_no = 0; #ifndef SMALL_CONFIG ! int GC_incremental = 0; /* By default, stop the world. */ #endif int GC_full_freq = 19; /* Every 20th collection is a full */ /* collection, whether we need it */ /* or not. */ --- 60,70 ---- word GC_gc_no = 0; #ifndef SMALL_CONFIG ! int GC_incremental = 0; /* By default, stop the world. */ #endif + int GC_parallel = FALSE; /* By default, parallel GC is off. */ + int GC_full_freq = 19; /* Every 20th collection is a full */ /* collection, whether we need it */ /* or not. */ *************** char * GC_copyright[] = *** 76,81 **** --- 78,84 ---- {"Copyright 1988,1989 Hans-J. Boehm and Alan J. Demers ", "Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved. ", "Copyright (c) 1996-1998 by Silicon Graphics. All rights reserved. ", + "Copyright (c) 1999-2001 by Hewlett-Packard Company. All rights reserved. ", "THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY", " EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.", "See source code for details." }; *************** word GC_free_space_divisor = 3; *** 94,108 **** extern GC_bool GC_collection_in_progress(); /* Collection is in progress, or was abandoned. */ int GC_never_stop_func GC_PROTO((void)) { return(0); } CLOCK_TYPE GC_start_time; /* Time at which we stopped world. */ /* used only in GC_timeout_stop_func. */ int GC_n_attempts = 0; /* Number of attempts at finishing */ ! /* collection within TIME_LIMIT */ ! #ifdef SMALL_CONFIG # define GC_timeout_stop_func GC_never_stop_func #else int GC_timeout_stop_func GC_PROTO((void)) --- 97,115 ---- extern GC_bool GC_collection_in_progress(); /* Collection is in progress, or was abandoned. */ + extern GC_bool GC_print_back_height; + int GC_never_stop_func GC_PROTO((void)) { return(0); } + unsigned long GC_time_limit = TIME_LIMIT; + CLOCK_TYPE GC_start_time; /* Time at which we stopped world. */ /* used only in GC_timeout_stop_func. */ int GC_n_attempts = 0; /* Number of attempts at finishing */ ! /* collection within GC_time_limit. */ ! #if defined(SMALL_CONFIG) || defined(NO_CLOCK) # define GC_timeout_stop_func GC_never_stop_func #else int GC_timeout_stop_func GC_PROTO((void)) *************** int GC_n_attempts = 0; /* Number of att *** 115,125 **** #ifndef NO_CLOCK GET_TIME(current_time); time_diff = MS_TIME_DIFF(current_time,GC_start_time); ! if (time_diff >= TIME_LIMIT) { ! # ifdef PRINTSTATS GC_printf0("Abandoning stopped marking after "); GC_printf1("%lu msecs", (unsigned long)time_diff); GC_printf1("(attempt %d)\n", (unsigned long) GC_n_attempts); # endif return(1); } --- 122,134 ---- #ifndef NO_CLOCK GET_TIME(current_time); time_diff = MS_TIME_DIFF(current_time,GC_start_time); ! if (time_diff >= GC_time_limit) { ! # ifdef CONDPRINT ! if (GC_print_stats) { GC_printf0("Abandoning stopped marking after "); GC_printf1("%lu msecs", (unsigned long)time_diff); GC_printf1("(attempt %d)\n", (unsigned long) GC_n_attempts); + } # endif return(1); } *************** GC_bool GC_should_collect() *** 222,228 **** void GC_notify_full_gc() { ! if (GC_start_call_back != (void (*)())0) { (*GC_start_call_back)(); } } --- 231,237 ---- void GC_notify_full_gc() { ! if (GC_start_call_back != (void (*) GC_PROTO((void)))0) { (*GC_start_call_back)(); } } *************** void GC_maybe_gc() *** 245,256 **** GC_gcollect_inner(); n_partial_gcs = 0; return; ! } else if (GC_need_full_gc || n_partial_gcs >= GC_full_freq) { ! # ifdef PRINTSTATS ! GC_printf2( ! "***>Full mark for collection %lu after %ld allocd bytes\n", ! (unsigned long) GC_gc_no+1, ! (long)WORDS_TO_BYTES(GC_words_allocd)); # endif GC_promote_black_lists(); (void)GC_reclaim_all((GC_stop_func)0, TRUE); --- 254,271 ---- GC_gcollect_inner(); n_partial_gcs = 0; return; ! } else { ! # ifdef PARALLEL_MARK ! GC_wait_for_reclaim(); ! # endif ! if (GC_need_full_gc || n_partial_gcs >= GC_full_freq) { ! # ifdef CONDPRINT ! if (GC_print_stats) { ! GC_printf2( ! "***>Full mark for collection %lu after %ld allocd bytes\n", ! (unsigned long) GC_gc_no+1, ! (long)WORDS_TO_BYTES(GC_words_allocd)); ! } # endif GC_promote_black_lists(); (void)GC_reclaim_all((GC_stop_func)0, TRUE); *************** void GC_maybe_gc() *** 258,273 **** n_partial_gcs = 0; GC_notify_full_gc(); GC_is_full_gc = TRUE; ! } else { n_partial_gcs++; ! } /* We try to mark with the world stopped. */ /* If we run out of time, this turns into */ /* incremental marking. */ ! #ifndef NO_CLOCK ! GET_TIME(GC_start_time); ! #endif ! if (GC_stopped_mark(GC_timeout_stop_func)) { # ifdef SAVE_CALL_CHAIN GC_save_callers(GC_last_stack); # endif --- 273,290 ---- n_partial_gcs = 0; GC_notify_full_gc(); GC_is_full_gc = TRUE; ! } else { n_partial_gcs++; ! } ! } /* We try to mark with the world stopped. */ /* If we run out of time, this turns into */ /* incremental marking. */ ! # ifndef NO_CLOCK ! if (GC_time_limit != GC_TIME_UNLIMITED) { GET_TIME(GC_start_time); } ! # endif ! if (GC_stopped_mark(GC_time_limit == GC_TIME_UNLIMITED? ! GC_never_stop_func : GC_timeout_stop_func)) { # ifdef SAVE_CALL_CHAIN GC_save_callers(GC_last_stack); # endif *************** GC_bool GC_try_to_collect_inner(stop_fun *** 290,316 **** GC_stop_func stop_func; { if (GC_incremental && GC_collection_in_progress()) { ! # ifdef PRINTSTATS GC_printf0( "GC_try_to_collect_inner: finishing collection in progress\n"); ! # endif /* PRINTSTATS */ /* Just finish collection already in progress. */ while(GC_collection_in_progress()) { if (stop_func()) return(FALSE); GC_collect_a_little_inner(1); } } ! # ifdef PRINTSTATS GC_printf2( "Initiating full world-stop collection %lu after %ld allocd bytes\n", (unsigned long) GC_gc_no+1, (long)WORDS_TO_BYTES(GC_words_allocd)); # endif GC_promote_black_lists(); /* Make sure all blocks have been reclaimed, so sweep routines */ /* don't see cleared mark bits. */ /* If we're guaranteed to finish, then this is unnecessary. */ ! if (stop_func != GC_never_stop_func && !GC_reclaim_all(stop_func, FALSE)) { /* Aborted. So far everything is still consistent. */ return(FALSE); --- 307,342 ---- GC_stop_func stop_func; { if (GC_incremental && GC_collection_in_progress()) { ! # ifdef CONDPRINT ! if (GC_print_stats) { GC_printf0( "GC_try_to_collect_inner: finishing collection in progress\n"); ! } ! # endif /* CONDPRINT */ /* Just finish collection already in progress. */ while(GC_collection_in_progress()) { if (stop_func()) return(FALSE); GC_collect_a_little_inner(1); } } ! # ifdef CONDPRINT ! if (GC_print_stats) { GC_printf2( "Initiating full world-stop collection %lu after %ld allocd bytes\n", (unsigned long) GC_gc_no+1, (long)WORDS_TO_BYTES(GC_words_allocd)); + } # endif GC_promote_black_lists(); /* Make sure all blocks have been reclaimed, so sweep routines */ /* don't see cleared mark bits. */ /* If we're guaranteed to finish, then this is unnecessary. */ ! /* In the find_leak case, we have to finish to guarantee that */ ! /* previously unmarked objects are not reported as leaks. */ ! # ifdef PARALLEL_MARK ! GC_wait_for_reclaim(); ! # endif ! if ((GC_find_leak || stop_func != GC_never_stop_func) && !GC_reclaim_all(stop_func, FALSE)) { /* Aborted. So far everything is still consistent. */ return(FALSE); *************** GC_stop_func stop_func; *** 348,354 **** # define GC_RATE 10 # define MAX_PRIOR_ATTEMPTS 1 /* Maximum number of prior attempts at world stop marking */ ! /* A value of 1 means that we finish the seconf time, no matter */ /* how long it takes. Doesn't count the initial root scan */ /* for a full GC. */ --- 374,380 ---- # define GC_RATE 10 # define MAX_PRIOR_ATTEMPTS 1 /* Maximum number of prior attempts at world stop marking */ ! /* A value of 1 means that we finish the second time, no matter */ /* how long it takes. Doesn't count the initial root scan */ /* for a full GC. */ *************** int n; *** 367,373 **** # ifdef SAVE_CALL_CHAIN GC_save_callers(GC_last_stack); # endif ! if (GC_n_attempts < MAX_PRIOR_ATTEMPTS) { GET_TIME(GC_start_time); if (!GC_stopped_mark(GC_timeout_stop_func)) { GC_n_attempts++; --- 393,403 ---- # ifdef SAVE_CALL_CHAIN GC_save_callers(GC_last_stack); # endif ! # ifdef PARALLEL_MARK ! GC_wait_for_reclaim(); ! # endif ! if (GC_n_attempts < MAX_PRIOR_ATTEMPTS ! && GC_time_limit != GC_TIME_UNLIMITED) { GET_TIME(GC_start_time); if (!GC_stopped_mark(GC_timeout_stop_func)) { GC_n_attempts++; *************** GC_stop_func stop_func; *** 412,429 **** { register int i; int dummy; ! # ifdef PRINTSTATS CLOCK_TYPE start_time, current_time; # endif STOP_WORLD(); ! # ifdef PRINTSTATS GET_TIME(start_time); GC_printf1("--> Marking for collection %lu ", (unsigned long) GC_gc_no + 1); GC_printf2("after %lu allocd bytes + %lu wasted bytes\n", (unsigned long) WORDS_TO_BYTES(GC_words_allocd), (unsigned long) WORDS_TO_BYTES(GC_words_wasted)); # endif /* Mark from all roots. */ --- 442,471 ---- { register int i; int dummy; ! # if defined(PRINTTIMES) || defined(CONDPRINT) CLOCK_TYPE start_time, current_time; # endif STOP_WORLD(); ! # ifdef PRINTTIMES GET_TIME(start_time); + # endif + # if defined(CONDPRINT) && !defined(PRINTTIMES) + if (GC_print_stats) GET_TIME(start_time); + # endif + # ifdef CONDPRINT + if (GC_print_stats) { GC_printf1("--> Marking for collection %lu ", (unsigned long) GC_gc_no + 1); GC_printf2("after %lu allocd bytes + %lu wasted bytes\n", (unsigned long) WORDS_TO_BYTES(GC_words_allocd), (unsigned long) WORDS_TO_BYTES(GC_words_wasted)); + } + # endif + # ifdef MAKE_BACK_GRAPH + if (GC_print_back_height) { + GC_build_back_graph(); + } # endif /* Mark from all roots. */ *************** GC_stop_func stop_func; *** 433,442 **** GC_initiate_gc(); for(i = 0;;i++) { if ((*stop_func)()) { ! # ifdef PRINTSTATS GC_printf0("Abandoned stopped marking after "); GC_printf1("%lu iterations\n", (unsigned long)i); # endif GC_deficit = i; /* Give the mutator a chance. */ START_WORLD(); --- 475,486 ---- GC_initiate_gc(); for(i = 0;;i++) { if ((*stop_func)()) { ! # ifdef CONDPRINT ! if (GC_print_stats) { GC_printf0("Abandoned stopped marking after "); GC_printf1("%lu iterations\n", (unsigned long)i); + } # endif GC_deficit = i; /* Give the mutator a chance. */ START_WORLD(); *************** GC_stop_func stop_func; *** 450,461 **** GC_printf2("Collection %lu reclaimed %ld bytes", (unsigned long) GC_gc_no - 1, (long)WORDS_TO_BYTES(GC_mem_found)); ! GC_printf1(" ---> heapsize = %lu bytes\n", ! (unsigned long) GC_heapsize); ! /* Printf arguments may be pushed in funny places. Clear the */ ! /* space. */ ! GC_printf0(""); ! # endif /* Check all debugged objects for consistency */ if (GC_debugging_started) { --- 494,515 ---- GC_printf2("Collection %lu reclaimed %ld bytes", (unsigned long) GC_gc_no - 1, (long)WORDS_TO_BYTES(GC_mem_found)); ! # else ! # ifdef CONDPRINT ! if (GC_print_stats) { ! GC_printf1("Collection %lu finished", (unsigned long) GC_gc_no - 1); ! } ! # endif ! # endif /* !PRINTSTATS */ ! # ifdef CONDPRINT ! if (GC_print_stats) { ! GC_printf1(" ---> heapsize = %lu bytes\n", ! (unsigned long) GC_heapsize); ! /* Printf arguments may be pushed in funny places. Clear the */ ! /* space. */ ! GC_printf0(""); ! } ! # endif /* CONDPRINT */ /* Check all debugged objects for consistency */ if (GC_debugging_started) { *************** GC_stop_func stop_func; *** 466,476 **** --- 520,589 ---- GET_TIME(current_time); GC_printf1("World-stopped marking took %lu msecs\n", MS_TIME_DIFF(current_time,start_time)); + # else + # ifdef CONDPRINT + if (GC_print_stats) { + GET_TIME(current_time); + GC_printf1("World-stopped marking took %lu msecs\n", + MS_TIME_DIFF(current_time,start_time)); + } + # endif # endif START_WORLD(); return(TRUE); } + /* Set all mark bits for the free list whose first entry is q */ + #ifdef __STDC__ + void GC_set_fl_marks(ptr_t q) + #else + void GC_set_fl_marks(q) + ptr_t q; + #endif + { + ptr_t p; + struct hblk * h, * last_h = 0; + hdr *hhdr; + int word_no; + + for (p = q; p != 0; p = obj_link(p)){ + h = HBLKPTR(p); + if (h != last_h) { + last_h = h; + hhdr = HDR(h); + } + word_no = (((word *)p) - ((word *)h)); + set_mark_bit_from_hdr(hhdr, word_no); + } + } + + /* Clear all mark bits for the free list whose first entry is q */ + /* Decrement GC_mem_found by number of words on free list. */ + #ifdef __STDC__ + void GC_clear_fl_marks(ptr_t q) + #else + void GC_clear_fl_marks(q) + ptr_t q; + #endif + { + ptr_t p; + struct hblk * h, * last_h = 0; + hdr *hhdr; + int word_no; + + for (p = q; p != 0; p = obj_link(p)){ + h = HBLKPTR(p); + if (h != last_h) { + last_h = h; + hhdr = HDR(h); + } + word_no = (((word *)p) - ((word *)h)); + clear_mark_bit_from_hdr(hhdr, word_no); + # ifdef GATHERSTATS + GC_mem_found -= hhdr -> hb_sz; + # endif + } + } /* Finish up a collection. Assumes lock is held, signals are disabled, */ /* but the world is otherwise running. */ *************** void GC_finish_collection() *** 488,513 **** # ifdef GATHERSTATS GC_mem_found = 0; # endif if (GC_find_leak) { /* Mark all objects on the free list. All objects should be */ /* marked when we're done. */ { register word size; /* current object size */ - register ptr_t p; /* pointer to current object */ - register struct hblk * h; /* pointer to block containing *p */ - register hdr * hhdr; - register int word_no; /* "index" of *p in *q */ int kind; for (kind = 0; kind < GC_n_kinds; kind++) { for (size = 1; size <= MAXOBJSZ; size++) { ! for (p= GC_obj_kinds[kind].ok_freelist[size]; ! p != 0; p=obj_link(p)){ ! h = HBLKPTR(p); ! hhdr = HDR(h); ! word_no = (((word *)p) - ((word *)h)); ! set_mark_bit_from_hdr(hhdr, word_no); ! } } } } --- 601,623 ---- # ifdef GATHERSTATS GC_mem_found = 0; # endif + # if defined(LINUX) && defined(__ELF__) && !defined(SMALL_CONFIG) + if (getenv("GC_PRINT_ADDRESS_MAP") != 0) { + GC_print_address_map(); + } + # endif if (GC_find_leak) { /* Mark all objects on the free list. All objects should be */ /* marked when we're done. */ { register word size; /* current object size */ int kind; + ptr_t q; for (kind = 0; kind < GC_n_kinds; kind++) { for (size = 1; size <= MAXOBJSZ; size++) { ! q = GC_obj_kinds[kind].ok_freelist[size]; ! if (q != 0) GC_set_fl_marks(q); } } } *************** void GC_finish_collection() *** 524,556 **** GET_TIME(finalize_time); # endif /* Clear free list mark bits, in case they got accidentally marked */ ! /* Note: HBLKPTR(p) == pointer to head of block containing *p */ ! /* (or GC_find_leak is set and they were intentionally marked.) */ /* Also subtract memory remaining from GC_mem_found count. */ /* Note that composite objects on free list are cleared. */ /* Thus accidentally marking a free list is not a problem; only */ /* objects on the list itself will be marked, and that's fixed here. */ { register word size; /* current object size */ ! register ptr_t p; /* pointer to current object */ ! register struct hblk * h; /* pointer to block containing *p */ ! register hdr * hhdr; ! register int word_no; /* "index" of *p in *q */ int kind; for (kind = 0; kind < GC_n_kinds; kind++) { for (size = 1; size <= MAXOBJSZ; size++) { ! for (p= GC_obj_kinds[kind].ok_freelist[size]; ! p != 0; p=obj_link(p)){ ! h = HBLKPTR(p); ! hhdr = HDR(h); ! word_no = (((word *)p) - ((word *)h)); ! clear_mark_bit_from_hdr(hhdr, word_no); ! # ifdef GATHERSTATS ! GC_mem_found -= size; ! # endif ! } } } } --- 634,665 ---- GET_TIME(finalize_time); # endif + if (GC_print_back_height) { + # ifdef MAKE_BACK_GRAPH + GC_traverse_back_graph(); + # else + # ifndef SMALL_CONFIG + GC_err_printf0("Back height not available: " + "Rebuild collector with -DMAKE_BACK_GRAPH\n"); + # endif + # endif + } + /* Clear free list mark bits, in case they got accidentally marked */ ! /* (or GC_find_leak is set and they were intentionally marked). */ /* Also subtract memory remaining from GC_mem_found count. */ /* Note that composite objects on free list are cleared. */ /* Thus accidentally marking a free list is not a problem; only */ /* objects on the list itself will be marked, and that's fixed here. */ { register word size; /* current object size */ ! register ptr_t q; /* pointer to current object */ int kind; for (kind = 0; kind < GC_n_kinds; kind++) { for (size = 1; size <= MAXOBJSZ; size++) { ! q = GC_obj_kinds[kind].ok_freelist[size]; ! if (q != 0) GC_clear_fl_marks(q); } } } *************** word bytes; *** 663,684 **** GC_heap_sects[GC_n_heap_sects].hs_start = (ptr_t)p; GC_heap_sects[GC_n_heap_sects].hs_bytes = bytes; GC_n_heap_sects++; ! words = BYTES_TO_WORDS(bytes - HDR_BYTES); phdr -> hb_sz = words; ! phdr -> hb_map = (char *)1; /* A value != GC_invalid_map */ phdr -> hb_flags = 0; GC_freehblk(p); GC_heapsize += bytes; ! if ((ptr_t)p <= GC_least_plausible_heap_addr || GC_least_plausible_heap_addr == 0) { ! GC_least_plausible_heap_addr = (ptr_t)p - sizeof(word); /* Making it a little smaller than necessary prevents */ /* us from getting a false hit from the variable */ /* itself. There's some unintentional reflection */ /* here. */ } ! if ((ptr_t)p + bytes >= GC_greatest_plausible_heap_addr) { ! GC_greatest_plausible_heap_addr = (ptr_t)p + bytes; } } --- 772,793 ---- GC_heap_sects[GC_n_heap_sects].hs_start = (ptr_t)p; GC_heap_sects[GC_n_heap_sects].hs_bytes = bytes; GC_n_heap_sects++; ! words = BYTES_TO_WORDS(bytes); phdr -> hb_sz = words; ! phdr -> hb_map = (unsigned char *)1; /* A value != GC_invalid_map */ phdr -> hb_flags = 0; GC_freehblk(p); GC_heapsize += bytes; ! if ((ptr_t)p <= (ptr_t)GC_least_plausible_heap_addr || GC_least_plausible_heap_addr == 0) { ! GC_least_plausible_heap_addr = (GC_PTR)((ptr_t)p - sizeof(word)); /* Making it a little smaller than necessary prevents */ /* us from getting a false hit from the variable */ /* itself. There's some unintentional reflection */ /* here. */ } ! if ((ptr_t)p + bytes >= (ptr_t)GC_greatest_plausible_heap_addr) { ! GC_greatest_plausible_heap_addr = (GC_PTR)((ptr_t)p + bytes); } } *************** void GC_print_heap_sects() *** 705,712 **** } # endif ! ptr_t GC_least_plausible_heap_addr = (ptr_t)ONES; ! ptr_t GC_greatest_plausible_heap_addr = 0; ptr_t GC_max(x,y) ptr_t x, y; --- 814,821 ---- } # endif ! GC_PTR GC_least_plausible_heap_addr = (GC_PTR)ONES; ! GC_PTR GC_greatest_plausible_heap_addr = 0; ptr_t GC_max(x,y) ptr_t x, y; *************** word n; *** 762,770 **** } space = GET_MEM(bytes); if( space == 0 ) { return(FALSE); } ! # ifdef PRINTSTATS GC_printf2("Increasing heap size by %lu after %lu allocated bytes\n", (unsigned long)bytes, (unsigned long)WORDS_TO_BYTES(GC_words_allocd)); --- 871,886 ---- } space = GET_MEM(bytes); if( space == 0 ) { + # ifdef CONDPRINT + if (GC_print_stats) { + GC_printf1("Failed to expand heap by %ld bytes\n", + (unsigned long)bytes); + } + # endif return(FALSE); } ! # ifdef CONDPRINT ! if (GC_print_stats) { GC_printf2("Increasing heap size by %lu after %lu allocated bytes\n", (unsigned long)bytes, (unsigned long)WORDS_TO_BYTES(GC_words_allocd)); *************** word n; *** 773,778 **** --- 889,895 ---- GC_print_block_list(); GC_print_hblkfreelist(); GC_printf0("\n"); # endif + } # endif expansion_slop = 8 * WORDS_TO_BYTES(min_words_allocd()); if (5 * HBLKSIZE * MAXHINCR > expansion_slop) { *************** GC_bool ignore_off_page; *** 856,867 **** GC_notify_full_gc(); GC_gcollect_inner(); } else { ! WARN("Out of Memory! Returning NIL!\n", 0); return(FALSE); } } else { ! # ifdef PRINTSTATS ! if (GC_fail_count) { GC_printf0("Memory available again ...\n"); } # endif --- 973,986 ---- GC_notify_full_gc(); GC_gcollect_inner(); } else { ! # if !defined(AMIGA) || !defined(GC_AMIGA_FASTALLOC) ! WARN("Out of Memory! Returning NIL!\n", 0); ! # endif return(FALSE); } } else { ! # ifdef CONDPRINT ! if (GC_fail_count && GC_print_stats) { GC_printf0("Memory available again ...\n"); } # endif diff -Nrc3pad gcc-3.0.4/boehm-gc/alpha_mach_dep.s gcc-3.1/boehm-gc/alpha_mach_dep.s *** gcc-3.0.4/boehm-gc/alpha_mach_dep.s Wed Apr 19 10:09:57 2000 --- gcc-3.1/boehm-gc/alpha_mach_dep.s Fri Aug 17 18:30:45 2001 *************** *** 1,63 **** - # This is BROKEN on a 21264 running gcc, and probably in other cases. - # The compiler may spill pointers to fp registers, and this code doesn't - # scan those. - - # define call_push(x) \ - lda $16, 0(x); /* copy x to first argument register */ \ - jsr $26, GC_push_one; /* call GC_push_one, ret addr in $26 */ \ - ldgp $gp, 0($26) /* restore $gp register from $ra */ - .text .align 4 .globl GC_push_regs .ent GC_push_regs 2 GC_push_regs: ! ldgp $gp, 0($27) # set gp from the procedure value reg ! lda $sp, -32($sp) # make stack frame ! stq $26, 8($sp) # save return address ! .mask 0x04000000, -8 .frame $sp, 16, $26, 0 ! # call_push($0) # expression eval and int func result ! ! # call_push($1) # temp regs - not preserved cross calls ! # call_push($2) ! # call_push($3) ! # call_push($4) ! # call_push($5) ! # call_push($6) ! # call_push($7) ! # call_push($8) ! call_push($9) # Saved regs call_push($10) call_push($11) call_push($12) call_push($13) call_push($14) ! call_push($15) # frame ptr or saved reg ! # call_push($16) # argument regs - not preserved cross calls ! # call_push($17) ! # call_push($18) ! # call_push($19) ! # call_push($20) ! # call_push($21) ! # call_push($22) # temp regs - not preserved cross calls ! # call_push($23) ! # call_push($24) ! # call_push($25) ! # call_push($26) # return address - expression eval ! # call_push($27) # procedure value or temporary reg ! # call_push($28) # assembler temp - not presrved ! call_push($29) # Global Pointer ! # call_push($30) # Stack Pointer - ldq $26, 8($sp) # restore return address - lda $sp, 32($sp) # pop stack frame - ret $31, ($26), 1 # return ($31 == hardwired zero) .end GC_push_regs --- 1,86 ---- + .arch ev6 .text .align 4 .globl GC_push_regs .ent GC_push_regs 2 GC_push_regs: ! ldgp $gp, 0($27) ! lda $sp, -16($sp) ! stq $26, 0($sp) ! .mask 0x04000000, 0 .frame $sp, 16, $26, 0 ! # $0 integer result ! # $1-$8 temp regs - not preserved cross calls ! # $9-$15 call saved regs ! # $16-$21 argument regs - not preserved cross calls ! # $22-$28 temp regs - not preserved cross calls ! # $29 global pointer - not preserved cross calls ! # $30 stack pointer ! # define call_push(x) \ ! mov x, $16; \ ! jsr $26, GC_push_one; \ ! ldgp $gp, 0($26) ! ! call_push($9) call_push($10) call_push($11) call_push($12) call_push($13) call_push($14) + call_push($15) ! # $f0-$f1 floating point results ! # $f2-$f9 call saved regs ! # $f10-$f30 temp regs - not preserved cross calls ! # Use the most efficient transfer method for this hardware. ! # Bit 1 detects the FIX extension, which includes ftoit. ! amask 2, $0 ! bne $0, $use_stack ! #undef call_push ! #define call_push(x) \ ! ftoit x, $16; \ ! jsr $26, GC_push_one; \ ! ldgp $gp, 0($26) ! call_push($f2) ! call_push($f3) ! call_push($f4) ! call_push($f5) ! call_push($f6) ! call_push($f7) ! call_push($f8) ! call_push($f9) ! ! ldq $26, 0($sp) ! lda $sp, 16($sp) ! ret $31, ($26), 1 ! ! .align 4 ! $use_stack: ! ! #undef call_push ! #define call_push(x) \ ! stt x, 8($sp); \ ! ldq $16, 8($sp); \ ! jsr $26, GC_push_one; \ ! ldgp $gp, 0($26) ! ! call_push($f2) ! call_push($f3) ! call_push($f4) ! call_push($f5) ! call_push($f6) ! call_push($f7) ! call_push($f8) ! call_push($f9) ! ! ldq $26, 0($sp) ! lda $sp, 16($sp) ! ret $31, ($26), 1 .end GC_push_regs diff -Nrc3pad gcc-3.0.4/boehm-gc/backgraph.c gcc-3.1/boehm-gc/backgraph.c *** gcc-3.0.4/boehm-gc/backgraph.c Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/backgraph.c Thu Jan 31 02:48:45 2002 *************** *** 0 **** --- 1,447 ---- + /* + * Copyright (c) 2001 by Hewlett-Packard Company. All rights reserved. + * + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED + * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * + * Permission is hereby granted to use or copy this program + * for any purpose, provided the above notices are retained on all copies. + * Permission to modify the code and to distribute modified code is granted, + * provided the above notices are retained, and a notice that the code was + * modified is included with the above copyright notice. + * + */ + + /* + * This implements a full, though not well-tuned, representation of the + * backwards points-to graph. This is used to test for non-GC-robust + * data structures; the code is not used during normal garbage collection. + * + * One restriction is that we drop all back-edges from nodes with very + * high in-degree, and simply add them add them to a list of such + * nodes. They are then treated as permanent roots. Id this by itself + * doesn't introduce a space leak, then such nodes can't contribute to + * a growing space leak. + */ + + #ifdef MAKE_BACK_GRAPH + + #define MAX_IN 10 /* Maximum in-degree we handle directly */ + + #include "private/dbg_mlc.h" + #include + + #if !defined(DBG_HDRS_ALL) || (ALIGNMENT != CPP_WORDSZ/8) || !defined(UNIX_LIKE) + # error Configuration doesnt support MAKE_BACK_GRAPH + #endif + + /* We store single back pointers directly in the object's oh_bg_ptr field. */ + /* If there is more than one ptr to an object, we store q | FLAG_MANY, */ + /* where q is a pointer to a back_edges object. */ + /* Every once in a while we use a back_edges object even for a single */ + /* pointer, since we need the other fields in the back_edges structure to */ + /* be present in some fraction of the objects. Otherwise we get serious */ + /* performance issues. */ + #define FLAG_MANY 2 + + typedef struct back_edges_struct { + word n_edges; /* Number of edges, including those in continuation */ + /* structures. */ + unsigned short flags; + # define RETAIN 1 /* Directly points to a reachable object; */ + /* retain for next GC. */ + unsigned short height_gc_no; + /* If height > 0, then the GC_gc_no value when it */ + /* was computed. If it was computed this cycle, then */ + /* it is current. If it was computed during the */ + /* last cycle, then it represents the old height, */ + /* which is only saved for live objects referenced by */ + /* dead ones. This may grow due to refs from newly */ + /* dead objects. */ + signed_word height; + /* Longest path through unreachable nodes to this node */ + /* that we found using depth first search. */ + + # define HEIGHT_UNKNOWN ((signed_word)(-2)) + # define HEIGHT_IN_PROGRESS ((signed_word)(-1)) + ptr_t edges[MAX_IN]; + struct back_edges_struct *cont; + /* Pointer to continuation structure; we use only the */ + /* edges field in the continuation. */ + /* also used as free list link. */ + } back_edges; + + /* Allocate a new back edge structure. Should be more sophisticated */ + /* if this were production code. */ + #define MAX_BACK_EDGE_STRUCTS 100000 + static back_edges *back_edge_space = 0; + int GC_n_back_edge_structs = 0; /* Serves as pointer to never used */ + /* back_edges space. */ + static back_edges *avail_back_edges = 0; + /* Pointer to free list of deallocated */ + /* back_edges structures. */ + + static back_edges * new_back_edges(void) + { + if (0 == back_edge_space) { + back_edge_space = (back_edges *) + sbrk(MAX_BACK_EDGE_STRUCTS*sizeof(back_edges)); + } + if (0 != avail_back_edges) { + back_edges * result = avail_back_edges; + avail_back_edges = result -> cont; + result -> cont = 0; + return result; + } + if (GC_n_back_edge_structs >= MAX_BACK_EDGE_STRUCTS - 1) { + ABORT("needed too much space for back edges: adjust " + "MAX_BACK_EDGE_STRUCTS"); + } + return back_edge_space + (GC_n_back_edge_structs++); + } + + /* Deallocate p and its associated continuation structures. */ + static void deallocate_back_edges(back_edges *p) + { + back_edges *last = p; + + while (0 != last -> cont) last = last -> cont; + last -> cont = avail_back_edges; + avail_back_edges = p; + } + + /* Table of objects that are currently on the depth-first search */ + /* stack. Only objects with in-degree one are in this table. */ + /* Other objects are identified using HEIGHT_IN_PROGRESS. */ + /* This data structure NEEDS IMPROVEMENT. */ + #define MAX_IN_PROGRESS 10000 + static ptr_t * in_progress_space = 0; + static int n_in_progress = 0; + + static void push_in_progress(ptr_t p) + { + if (in_progress_space == 0) + in_progress_space = sbrk(MAX_IN_PROGRESS * sizeof(ptr_t)); + if (n_in_progress == MAX_IN_PROGRESS) + ABORT("Exceeded MAX_IN_PROGRESS"); + in_progress_space[n_in_progress++] = p; + } + + static GC_bool is_in_progress(ptr_t p) + { + int i; + for (i = 0; i < n_in_progress; ++i) { + if (in_progress_space[i] == p) return TRUE; + } + return FALSE; + } + + static void pop_in_progress(ptr_t p) + { + --n_in_progress; + GC_ASSERT(in_progress_space[n_in_progress] == p); + } + + #define GET_OH_BG_PTR(p) \ + (ptr_t)REVEAL_POINTER(((oh *)(p)) -> oh_bg_ptr) + #define SET_OH_BG_PTR(p,q) (((oh *)(p)) -> oh_bg_ptr) = HIDE_POINTER(q) + + /* Execute s once for each predecessor q of p in the points-to graph. */ + /* s should be a bracketed statement. We declare q. */ + #define FOR_EACH_PRED(q, p, s) \ + { \ + ptr_t q = GET_OH_BG_PTR(p); \ + if (!((word)q & FLAG_MANY)) { \ + if (q && !((word)q & 1)) s \ + /* !((word)q & 1) checks for a misnterpreted freelist link */ \ + } else { \ + back_edges *orig_be_ = (back_edges *)((word)q & ~FLAG_MANY); \ + back_edges *be_ = orig_be_; \ + int total_, local_; \ + int n_edges_ = be_ -> n_edges; \ + for (total_ = 0, local_ = 0; total_ < n_edges_; ++local_, ++total_) { \ + if (local_ == MAX_IN) { \ + be_ = be_ -> cont; \ + local_ = 0; \ + } \ + q = be_ -> edges[local_]; s \ + } \ + } \ + } + + /* Ensure that p has a back_edges structure associated with it. */ + static void ensure_struct(ptr_t p) + { + ptr_t old_back_ptr = GET_OH_BG_PTR(p); + + if (!((word)old_back_ptr & FLAG_MANY)) { + back_edges *be = new_back_edges(); + be -> flags = 0; + if (0 == old_back_ptr) { + be -> n_edges = 0; + } else { + be -> n_edges = 1; + be -> edges[0] = old_back_ptr; + } + be -> height = HEIGHT_UNKNOWN; + be -> height_gc_no = GC_gc_no - 1; + GC_ASSERT(be >= back_edge_space); + SET_OH_BG_PTR(p, (word)be | FLAG_MANY); + } + } + + /* Add the (forward) edge from p to q to the backward graph. Both p */ + /* q are pointers to the object base, i.e. pointers to an oh. */ + static void add_edge(ptr_t p, ptr_t q) + { + ptr_t old_back_ptr = GET_OH_BG_PTR(q); + back_edges * be, *be_cont; + word i; + static unsigned random_number = 13; + # define GOT_LUCKY_NUMBER (((++random_number) & 0x7f) == 0) + /* A not very random number we use to occasionally allocate a */ + /* back_edges structure even for a single backward edge. This */ + /* prevents us from repeatedly tracing back through very long */ + /* chains, since we will have some place to store height and */ + /* in_progress flags along the way. */ + + GC_ASSERT(p == GC_base(p) && q == GC_base(q)); + if (!GC_HAS_DEBUG_INFO(q) || !GC_HAS_DEBUG_INFO(p)) { + /* This is really a misinterpreted free list link, since we saw */ + /* a pointer to a free list. Dont overwrite it! */ + return; + } + if (0 == old_back_ptr) { + SET_OH_BG_PTR(q, p); + if (GOT_LUCKY_NUMBER) ensure_struct(q); + return; + } + /* Check whether it was already in the list of predecessors. */ + FOR_EACH_PRED(pred, q, { if (p == pred) return; }); + ensure_struct(q); + old_back_ptr = GET_OH_BG_PTR(q); + be = (back_edges *)((word)old_back_ptr & ~FLAG_MANY); + for (i = be -> n_edges, be_cont = be; i > MAX_IN; + be_cont = be_cont -> cont, i -= MAX_IN) {} + if (i == MAX_IN) { + be_cont -> cont = new_back_edges(); + be_cont = be_cont -> cont; + i = 0; + } + be_cont -> edges[i] = p; + be -> n_edges++; + if (be -> n_edges == 100) { + # if 0 + if (GC_print_stats) { + GC_err_printf0("The following object has in-degree >= 100:\n"); + GC_print_heap_obj(q); + } + # endif + } + } + + typedef void (*per_object_func)(ptr_t p, word n_words, word gc_descr); + + static void per_object_helper(struct hblk *h, word fn) + { + hdr * hhdr = HDR(h); + word sz = hhdr -> hb_sz; + word descr = hhdr -> hb_descr; + per_object_func f = (per_object_func)fn; + int i = 0; + + do { + f((ptr_t)(h -> hb_body + i), sz, descr); + i += sz; + } while (i + sz <= BYTES_TO_WORDS(HBLKSIZE)); + } + + void GC_apply_to_each_object(per_object_func f) + { + GC_apply_to_all_blocks(per_object_helper, (word)f); + } + + static void reset_back_edge(ptr_t p, word n_words, word gc_descr) + { + /* Skip any free list links, or dropped blocks */ + if (GC_HAS_DEBUG_INFO(p)) { + ptr_t old_back_ptr = GET_OH_BG_PTR(p); + if ((word)old_back_ptr & FLAG_MANY) { + back_edges *be = (back_edges *)((word)old_back_ptr & ~FLAG_MANY); + if (!(be -> flags & RETAIN)) { + deallocate_back_edges(be); + SET_OH_BG_PTR(p, 0); + } else { + word *currentp; + + GC_ASSERT(GC_is_marked(p)); + + /* Back edges may point to objects that will not be retained. */ + /* Delete them for now, but remember the height. */ + /* Some will be added back at next GC. */ + be -> n_edges = 0; + if (0 != be -> cont) { + deallocate_back_edges(be -> cont); + be -> cont = 0; + } + + GC_ASSERT(GC_is_marked(p)); + + /* We only retain things for one GC cycle at a time. */ + be -> flags &= ~RETAIN; + } + } else /* Simple back pointer */ { + /* Clear to avoid dangling pointer. */ + SET_OH_BG_PTR(p, 0); + } + } + } + + static void add_back_edges(ptr_t p, word n_words, word gc_descr) + { + word *currentp = (word *)(p + sizeof(oh)); + + /* For now, fix up non-length descriptors conservatively. */ + if((gc_descr & GC_DS_TAGS) != GC_DS_LENGTH) { + gc_descr = WORDS_TO_BYTES(n_words); + } + while (currentp < (word *)(p + gc_descr)) { + word current = *currentp++; + if (current >= (word)GC_least_plausible_heap_addr && + current <= (word)GC_greatest_plausible_heap_addr) { + ptr_t target = GC_base((GC_PTR)current); + if (0 != target) { + add_edge(p, target); + } + } + } + } + + /* Rebuild the reprentation of the backward reachability graph. */ + /* Does not examine mark bits. Can be called before GC. */ + void GC_build_back_graph(void) + { + GC_apply_to_each_object(add_back_edges); + } + + /* Return an approximation to the length of the longest simple path */ + /* through unreachable objects to p. We refer to this as the height */ + /* of p. */ + static word backwards_height(ptr_t p) + { + word result; + ptr_t back_ptr = GET_OH_BG_PTR(p); + back_edges *be; + + if (0 == back_ptr) return 1; + if (!((word)back_ptr & FLAG_MANY)) { + if (is_in_progress(p)) return 0; /* DFS back edge, i.e. we followed */ + /* an edge to an object already */ + /* on our stack: ignore */ + push_in_progress(p); + result = backwards_height(back_ptr)+1; + pop_in_progress(p); + return result; + } + be = (back_edges *)((word)back_ptr & ~FLAG_MANY); + if (be -> height >= 0 && be -> height_gc_no == GC_gc_no) + return be -> height; + /* Ignore back edges in DFS */ + if (be -> height == HEIGHT_IN_PROGRESS) return 0; + result = (be -> height > 0? be -> height : 1); + be -> height = HEIGHT_IN_PROGRESS; + FOR_EACH_PRED(q, p, { + word this_height; + if (GC_is_marked(q) && !(FLAG_MANY & (word)GET_OH_BG_PTR(p))) { + if (GC_print_stats) + GC_printf2("Found bogus pointer from 0x%lx to 0x%lx\n", q, p); + /* Reachable object "points to" unreachable one. */ + /* Could be caused by our lax treatment of GC descriptors. */ + this_height = 1; + } else { + this_height = backwards_height(q); + } + if (this_height >= result) result = this_height + 1; + }); + be -> height = result; + be -> height_gc_no = GC_gc_no; + return result; + } + + word GC_max_height; + ptr_t GC_deepest_obj; + + /* Compute the maximum height of every unreachable predecessor p of a */ + /* reachable object. Arrange to save the heights of all such objects p */ + /* so that they can be used in calculating the height of objects in the */ + /* next GC. */ + /* Set GC_max_height to be the maximum height we encounter, and */ + /* GC_deepest_obj to be the corresponding object. */ + static void update_max_height(ptr_t p, word n_words, word gc_descr) + { + if (GC_is_marked(p) && GC_HAS_DEBUG_INFO(p)) { + int i; + word p_height = 0; + ptr_t p_deepest_obj = 0; + ptr_t back_ptr; + back_edges *be = 0; + + /* If we remembered a height last time, use it as a minimum. */ + /* It may have increased due to newly unreachable chains pointing */ + /* to p, but it can't have decreased. */ + back_ptr = GET_OH_BG_PTR(p); + if (0 != back_ptr && ((word)back_ptr & FLAG_MANY)) { + be = (back_edges *)((word)back_ptr & ~FLAG_MANY); + if (be -> height != HEIGHT_UNKNOWN) p_height = be -> height; + } + FOR_EACH_PRED(q, p, { + if (!GC_is_marked(q) && GC_HAS_DEBUG_INFO(q)) { + word q_height; + + q_height = backwards_height(q); + if (q_height > p_height) { + p_height = q_height; + p_deepest_obj = q; + } + } + }); + if (p_height > 0) { + /* Remember the height for next time. */ + if (be == 0) { + ensure_struct(p); + back_ptr = GET_OH_BG_PTR(p); + be = (back_edges *)((word)back_ptr & ~FLAG_MANY); + } + be -> flags |= RETAIN; + be -> height = p_height; + be -> height_gc_no = GC_gc_no; + } + if (p_height > GC_max_height) { + GC_max_height = p_height; + GC_deepest_obj = p_deepest_obj; + } + } + } + + void GC_traverse_back_graph(void) + { + static word max_max_height = 0; + GC_max_height = 0; + GC_apply_to_each_object(update_max_height); + GC_printf2("Maximum backwards height of reachable objects at GC %lu is %ld\n", + (unsigned long) GC_gc_no, GC_max_height); + if (GC_max_height > max_max_height) { + max_max_height = GC_max_height; + GC_printf0("The following unreachable object is last in a longest chain " + "of unreachable objects:\n"); + GC_print_heap_obj(GC_deepest_obj); + } + if (GC_print_stats) { + GC_printf1("Needed max total of %ld back-edge structs\n", + GC_n_back_edge_structs); + } + GC_apply_to_each_object(reset_back_edge); + GC_deepest_obj = 0; + } + + #endif /* MAKE_BACK_GRAPH */ diff -Nrc3pad gcc-3.0.4/boehm-gc/backptr.h gcc-3.1/boehm-gc/backptr.h *** gcc-3.0.4/boehm-gc/backptr.h Wed Apr 19 02:29:15 2000 --- gcc-3.1/boehm-gc/backptr.h Thu Jan 1 00:00:00 1970 *************** *** 1,63 **** - /* - * This is a simple API to implement pointer back tracing, i.e. - * to answer questions such as "who is pointing to this" or - * "why is this object being retained by the collector" - * - * This API assumes that we have an ANSI C compiler. - * - * Most of these calls yield useful information on only after - * a garbage collection. Usually the client will first force - * a full collection and then gather information, preferably - * before much intervening allocation. - * - * The implementation of the interface is only about 99.9999% - * correct. It is intended to be good enough for profiling, - * but is not intended to be used with production code. - * - * Results are likely to be much more useful if all allocation is - * accomplished through the debugging allocators. - * - * The implementation idea is due to A. Demers. - */ - - /* Store information about the object referencing dest in *base_p */ - /* and *offset_p. */ - /* If multiple objects or roots point to dest, the one reported */ - /* will be the last on used by the garbage collector to trace the */ - /* object. */ - /* source is root ==> *base_p = address, *offset_p = 0 */ - /* source is heap object ==> *base_p != 0, *offset_p = offset */ - /* Returns 1 on success, 0 if source couldn't be determined. */ - /* Dest can be any address within a heap object. */ - typedef enum { GC_UNREFERENCED, /* No reference info available. */ - GC_NO_SPACE, /* Dest not allocated with debug alloc */ - GC_REFD_FROM_ROOT, /* Referenced directly by root *base_p */ - GC_REFD_FROM_REG, /* Referenced from a register, i.e. */ - /* a root without an address. */ - GC_REFD_FROM_HEAP, /* Referenced from another heap obj. */ - GC_FINALIZER_REFD /* Finalizable and hence accessible. */ - } GC_ref_kind; - - GC_ref_kind GC_get_back_ptr_info(void *dest, void **base_p, size_t *offset_p); - - /* Generate a random heap address. */ - /* The resulting address is in the heap, but */ - /* not necessarily inside a valid object. */ - void * GC_generate_random_heap_address(void); - - /* Generate a random address inside a valid marked heap object. */ - void * GC_generate_random_valid_address(void); - - /* Force a garbage collection and generate a backtrace from a */ - /* random heap address. */ - /* This uses the GC logging mechanism (GC_printf) to produce */ - /* output. It can often be called from a debugger. The */ - /* source in dbg_mlc.c also serves as a sample client. */ - void GC_generate_random_backtrace(void); - - /* Print a backtrace from a specific address. Used by the */ - /* above. The client should call GC_gcollect() immediately */ - /* before invocation. */ - void GC_print_backtrace(void *); - - --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/barrett_diagram gcc-3.1/boehm-gc/barrett_diagram *** gcc-3.0.4/boehm-gc/barrett_diagram Wed Jun 30 12:43:12 1999 --- gcc-3.1/boehm-gc/barrett_diagram Thu Jan 1 00:00:00 1970 *************** *** 1,106 **** - This is an ASCII diagram of the data structure used to check pointer - validity. It was provided by Dave Barrett , - and should be of use to others attempting to understand the code. - The data structure in GC4.X is essentially the same. -HB - - - - - Data Structure used by GC_base in gc3.7: - 21-Apr-94 - - - - - 63 LOG_TOP_SZ[11] LOG_BOTTOM_SZ[10] LOG_HBLKSIZE[13] - +------------------+----------------+------------------+------------------+ - p:| | TL_HASH(hi) | | HBLKDISPL(p) | - +------------------+----------------+------------------+------------------+ - \-----------------------HBLKPTR(p)-------------------/ - \------------hi-------------------/ - \______ ________/ \________ _______/ \________ _______/ - V V V - | | | - GC_top_index[] | | | - --- +--------------+ | | | - ^ | | | | | - | | | | | | - TOP +--------------+<--+ | | - _SZ +-<| [] | * | | - (items)| +--------------+ if 0 < bi< HBLKSIZE | | - | | | | then large object | | - | | | | starts at the bi'th | | - v | | | HBLK before p. | i | - --- | +--------------+ | (word- | - v | aligned) | - bi= |GET_BI(p){->hash_link}->key==hi | | - v | | - | (bottom_index) \ scratch_alloc'd | | - | ( struct bi ) / by get_index() | | - --- +->+--------------+ | | - ^ | | | | - ^ | | | | - BOTTOM | | ha=GET_HDR_ADDR(p) | | - _SZ(items)+--------------+<----------------------+ +-------+ - | +--<| index[] | | - | | +--------------+ GC_obj_map: v - | | | | from / +-+-+-----+-+-+-+-+ --- - v | | | GC_add < 0| | | | | | | | ^ - --- | +--------------+ _map_entry \ +-+-+-----+-+-+-+-+ | - | | asc_link | +-+-+-----+-+-+-+-+ MAXOBJSZ - | +--------------+ +-->| | | j | | | | | +1 - | | key | | +-+-+-----+-+-+-+-+ | - | +--------------+ | +-+-+-----+-+-+-+-+ | - | | hash_link | | | | | | | | | | v - | +--------------+ | +-+-+-----+-+-+-+-+ --- - | | |<--MAX_OFFSET--->| - | | (bytes) - HDR(p)| GC_find_header(p) | |<--MAP_ENTRIES-->| - | \ from | =HBLKSIZE/WORDSZ - | (hdr) (struct hblkhdr) / alloc_hdr() | (1024 on Alpha) - +-->+----------------------+ | (8/16 bits each) - GET_HDR(p)| word hb_sz (words) | | - +----------------------+ | - | struct hblk *hb_next | | - +----------------------+ | - |mark_proc hb_mark_proc| | - +----------------------+ | - | char * hb_map |>-------------+ - +----------------------+ - | ushort hb_obj_kind | - +----------------------+ - | hb_last_reclaimed | - --- +----------------------+ - ^ | | - MARK_BITS| hb_marks[] | *if hdr is free, hb_sz + DISCARD_WORDS - _SZ(words)| | is the size of a heap chunk (struct hblk) - v | | of at least MININCR*HBLKSIZE bytes (below), - --- +----------------------+ otherwise, size of each object in chunk. - - Dynamic data structures above are interleaved throughout the heap in blocks of - size MININCR * HBLKSIZE bytes as done by gc_scratch_alloc which cannot be - freed; free lists are used (e.g. alloc_hdr). HBLKs's below are collected. - - (struct hblk) - --- +----------------------+ < HBLKSIZE --- --- DISCARD_ - ^ |garbage[DISCARD_WORDS]| aligned ^ ^ HDR_BYTES WORDS - | | | | v (bytes) (words) - | +-----hb_body----------+ < WORDSZ | --- --- - | | | aligned | ^ ^ - | | Object 0 | | hb_sz | - | | | i |(word- (words)| - | | | (bytes)|aligned) v | - | + - - - - - - - - - - -+ --- | --- | - | | | ^ | ^ | - n * | | j (words) | hb_sz BODY_SZ - HBLKSIZE | Object 1 | v v | (words) - (bytes) | |--------------- v MAX_OFFSET - | + - - - - - - - - - - -+ --- (bytes) - | | | !All_INTERIOR_PTRS ^ | - | | | sets j only for hb_sz | - | | Object N | valid object offsets. | | - v | | All objects WORDSZ v v - --- +----------------------+ aligned. --- --- - - DISCARD_WORDS is normally zero. Indeed the collector has not been tested - with another value in ages. --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/blacklst.c gcc-3.1/boehm-gc/blacklst.c *** gcc-3.0.4/boehm-gc/blacklst.c Mon Nov 1 23:15:51 1999 --- gcc-3.1/boehm-gc/blacklst.c Fri Aug 17 18:30:45 2001 *************** *** 12,18 **** * modified is included with the above copyright notice. */ /* Boehm, August 9, 1995 6:09 pm PDT */ ! # include "gc_priv.h" /* * We maintain several hash tables of hblks that have had false hits. --- 12,18 ---- * modified is included with the above copyright notice. */ /* Boehm, August 9, 1995 6:09 pm PDT */ ! # include "private/gc_priv.h" /* * We maintain several hash tables of hblks that have had false hits. *************** word GC_black_list_spacing = MINHINCR*HB *** 52,66 **** void GC_clear_bl(); ! void GC_default_print_heap_obj_proc(p) ! ptr_t p; { ptr_t base = GC_base(p); GC_err_printf2("start: 0x%lx, appr. length: %ld", base, GC_size(base)); } ! void (*GC_print_heap_obj)(/* char * s, ptr_t p */) = GC_default_print_heap_obj_proc; void GC_print_source_ptr(p) --- 52,70 ---- void GC_clear_bl(); ! # if defined(__STDC__) || defined(__cplusplus) ! void GC_default_print_heap_obj_proc(ptr_t p) ! # else ! void GC_default_print_heap_obj_proc(p) ! ptr_t p; ! # endif { ptr_t base = GC_base(p); GC_err_printf2("start: 0x%lx, appr. length: %ld", base, GC_size(base)); } ! void (*GC_print_heap_obj) GC_PROTO((ptr_t p)) = GC_default_print_heap_obj_proc; void GC_print_source_ptr(p) *************** ptr_t p; *** 81,98 **** void GC_bl_init() { ! # ifndef ALL_INTERIOR_POINTERS ! GC_old_normal_bl = (word *) GC_scratch_alloc((word)(sizeof (page_hash_table))); ! GC_incomplete_normal_bl = (word *)GC_scratch_alloc ((word)(sizeof(page_hash_table))); ! if (GC_old_normal_bl == 0 || GC_incomplete_normal_bl == 0) { GC_err_printf0("Insufficient memory for black list\n"); EXIT(); } - GC_clear_bl(GC_old_normal_bl); - GC_clear_bl(GC_incomplete_normal_bl); - # endif GC_old_stack_bl = (word *)GC_scratch_alloc((word)(sizeof(page_hash_table))); GC_incomplete_stack_bl = (word *)GC_scratch_alloc ((word)(sizeof(page_hash_table))); --- 85,102 ---- void GC_bl_init() { ! if (!GC_all_interior_pointers) { ! GC_old_normal_bl = (word *) GC_scratch_alloc((word)(sizeof (page_hash_table))); ! GC_incomplete_normal_bl = (word *)GC_scratch_alloc ((word)(sizeof(page_hash_table))); ! if (GC_old_normal_bl == 0 || GC_incomplete_normal_bl == 0) { GC_err_printf0("Insufficient memory for black list\n"); EXIT(); + } + GC_clear_bl(GC_old_normal_bl); + GC_clear_bl(GC_incomplete_normal_bl); } GC_old_stack_bl = (word *)GC_scratch_alloc((word)(sizeof(page_hash_table))); GC_incomplete_stack_bl = (word *)GC_scratch_alloc ((word)(sizeof(page_hash_table))); *************** void GC_promote_black_lists() *** 127,135 **** GC_old_normal_bl = GC_incomplete_normal_bl; GC_old_stack_bl = GC_incomplete_stack_bl; ! # ifndef ALL_INTERIOR_POINTERS GC_clear_bl(very_old_normal_bl); ! # endif GC_clear_bl(very_old_stack_bl); GC_incomplete_normal_bl = very_old_normal_bl; GC_incomplete_stack_bl = very_old_stack_bl; --- 131,139 ---- GC_old_normal_bl = GC_incomplete_normal_bl; GC_old_stack_bl = GC_incomplete_stack_bl; ! if (!GC_all_interior_pointers) { GC_clear_bl(very_old_normal_bl); ! } GC_clear_bl(very_old_stack_bl); GC_incomplete_normal_bl = very_old_normal_bl; GC_incomplete_stack_bl = very_old_stack_bl; *************** void GC_promote_black_lists() *** 156,168 **** void GC_unpromote_black_lists() { ! # ifndef ALL_INTERIOR_POINTERS GC_copy_bl(GC_old_normal_bl, GC_incomplete_normal_bl); ! # endif GC_copy_bl(GC_old_stack_bl, GC_incomplete_stack_bl); } - # ifndef ALL_INTERIOR_POINTERS /* P is not a valid pointer reference, but it falls inside */ /* the plausible heap bounds. */ /* Add it to the normal incomplete black list if appropriate. */ --- 160,171 ---- void GC_unpromote_black_lists() { ! if (!GC_all_interior_pointers) { GC_copy_bl(GC_old_normal_bl, GC_incomplete_normal_bl); ! } GC_copy_bl(GC_old_stack_bl, GC_incomplete_stack_bl); } /* P is not a valid pointer reference, but it falls inside */ /* the plausible heap bounds. */ /* Add it to the normal incomplete black list if appropriate. */ *************** word p; *** 193,199 **** /* object, and isn't worth black listing. */ } } - # endif /* And the same for false pointers from the stack. */ #ifdef PRINT_BLACK_LIST --- 196,201 ---- *************** word len; *** 236,247 **** register word i; word nblocks = divHBLKSZ(len); ! # ifndef ALL_INTERIOR_POINTERS if (get_pht_entry_from_index(GC_old_normal_bl, index) || get_pht_entry_from_index(GC_incomplete_normal_bl, index)) { return(h+1); } ! # endif for (i = 0; ; ) { if (GC_old_stack_bl[divWORDSZ(index)] == 0 --- 238,249 ---- register word i; word nblocks = divHBLKSZ(len); ! if (!GC_all_interior_pointers) { if (get_pht_entry_from_index(GC_old_normal_bl, index) || get_pht_entry_from_index(GC_incomplete_normal_bl, index)) { return(h+1); } ! } for (i = 0; ; ) { if (GC_old_stack_bl[divWORDSZ(index)] == 0 diff -Nrc3pad gcc-3.0.4/boehm-gc/checksums.c gcc-3.1/boehm-gc/checksums.c *** gcc-3.0.4/boehm-gc/checksums.c Wed Jun 30 12:43:17 1999 --- gcc-3.1/boehm-gc/checksums.c Fri Aug 17 18:30:45 2001 *************** int index; *** 80,86 **** if (pe -> block != 0 && pe -> block != h + OFFSET) ABORT("goofed"); pe -> old_sum = pe -> new_sum; pe -> new_sum = GC_checksum(h); ! # ifndef MSWIN32 if (pe -> new_sum != 0 && !GC_page_was_ever_dirty(h)) { GC_printf1("GC_page_was_ever_dirty(0x%lx) is wrong\n", (unsigned long)h); --- 80,86 ---- if (pe -> block != 0 && pe -> block != h + OFFSET) ABORT("goofed"); pe -> old_sum = pe -> new_sum; pe -> new_sum = GC_checksum(h); ! # if !defined(MSWIN32) && !defined(MSWINCE) if (pe -> new_sum != 0 && !GC_page_was_ever_dirty(h)) { GC_printf1("GC_page_was_ever_dirty(0x%lx) is wrong\n", (unsigned long)h); diff -Nrc3pad gcc-3.0.4/boehm-gc/config.guess gcc-3.1/boehm-gc/config.guess *** gcc-3.0.4/boehm-gc/config.guess Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/config.guess Tue Feb 12 04:37:53 2002 *************** *** 0 **** --- 1,1319 ---- + #! /bin/sh + # Attempt to guess a canonical system name. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + # 2000, 2001, 2002 Free Software Foundation, Inc. + + timestamp='2002-01-10' + + # This file is free software; you can redistribute it and/or modify it + # under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, but + # WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + # General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + # + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under + # the same distribution terms that you use for the rest of that program. + + # Originally written by Per Bothner . + # Please send patches to . Submit a context + # diff and a properly formatted ChangeLog entry. + # + # This script attempts to guess a canonical system name similar to + # config.sub. If it succeeds, it prints the system name on stdout, and + # exits with 0. Otherwise, it exits with 1. + # + # The plan is that this can be called by configure scripts if you + # don't specify an explicit build system type. + + me=`echo "$0" | sed -e 's,.*/,,'` + + usage="\ + Usage: $0 [OPTION] + + Output the configuration name of the system \`$me' is run on. + + Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + + Report bugs and patches to ." + + version="\ + GNU config.guess ($timestamp) + + Originally written by Per Bothner. + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + + help=" + Try \`$me --help' for more information." + + # Parse command line + while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac + done + + if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 + fi + + + dummy=dummy-$$ + trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 + + # CC_FOR_BUILD -- compiler used by this script. + # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still + # use `HOST_CC' if defined, but it is deprecated. + + set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c ; + for c in cc gcc c89 ; do + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; + if test $? = 0 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $dummy.c $dummy.o $dummy.rel ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac' + + # This is needed to find uname on a Pyramid OSx when run in the BSD universe. + # (ghazi@noc.rutgers.edu 1994-08-24) + if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH + fi + + UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown + UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown + UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown + UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + + # Note: order is significant - the case branches are not exclusive. + + case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + UNAME_MACHINE_ARCH=`(uname -p) 2>/dev/null` || \ + UNAME_MACHINE_ARCH=unknown + case "${UNAME_MACHINE_ARCH}" in + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <$dummy.s + .data + \$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main + main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main + EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __cplusplus + #include /* for printf() prototype */ + int main (int argc, char *argv[]) { + #else + int main (argc, argv) int argc; char *argv[]; { + #endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } + EOF + $CC_FOR_BUILD $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } + EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } + EOF + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy + fi ;; + esac + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } + EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_supported_targets=`cd /; ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + LIBC=gnuaout + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + esac + + #echo '(No uname command or uname output not recognized.)' 1>&2 + #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + + eval $set_cc_for_build + cat >$dummy.c < + # include + #endif + main () + { + #if defined (sony) + #if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); + #else + #include + printf ("m68k-sony-newsos%s\n", + #ifdef NEWSOS4 + "4" + #else + "" + #endif + ); exit (0); + #endif + #endif + + #if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); + #endif + + #if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); + #endif + + #if defined (NeXT) + #if !defined (__ARCHITECTURE__) + #define __ARCHITECTURE__ "m68k" + #endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); + #endif + + #if defined (MULTIMAX) || defined (n16) + #if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); + #else + #if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); + #else + printf ("ns32k-encore-bsd\n"); exit (0); + #endif + #endif + #endif + + #if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); + #endif + + #if defined (sequent) + #if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); + #endif + #if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); + #endif + #endif + + #if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + + #endif + + #if defined (vax) + # if !defined (ultrix) + # include + # if defined (BSD) + # if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); + # else + # if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); + # else + printf ("vax-dec-bsd\n"); exit (0); + # endif + # endif + # else + printf ("vax-dec-bsd\n"); exit (0); + # endif + # else + printf ("vax-dec-ultrix\n"); exit (0); + # endif + #endif + + #if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); + #endif + + exit (1); + } + EOF + + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + + # Apollos put the system type in the environment. + + test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + + # Convex versions that predate uname can use getsysinfo(1) + + if [ -x /usr/convex/getsysinfo ] + then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac + fi + + cat >&2 < in order to provide the needed + information to handle your system. + + config.guess timestamp = $timestamp + + uname -m = `(uname -m) 2>/dev/null || echo unknown` + uname -r = `(uname -r) 2>/dev/null || echo unknown` + uname -s = `(uname -s) 2>/dev/null || echo unknown` + uname -v = `(uname -v) 2>/dev/null || echo unknown` + + /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` + /bin/uname -X = `(/bin/uname -X) 2>/dev/null` + + hostinfo = `(hostinfo) 2>/dev/null` + /bin/universe = `(/bin/universe) 2>/dev/null` + /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` + /bin/arch = `(/bin/arch) 2>/dev/null` + /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` + /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + + UNAME_MACHINE = ${UNAME_MACHINE} + UNAME_RELEASE = ${UNAME_RELEASE} + UNAME_SYSTEM = ${UNAME_SYSTEM} + UNAME_VERSION = ${UNAME_VERSION} + EOF + + exit 1 + + # Local variables: + # eval: (add-hook 'write-file-hooks 'time-stamp) + # time-stamp-start: "timestamp='" + # time-stamp-format: "%:y-%02m-%02d" + # time-stamp-end: "'" + # End: diff -Nrc3pad gcc-3.0.4/boehm-gc/config.sub gcc-3.1/boehm-gc/config.sub *** gcc-3.0.4/boehm-gc/config.sub Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/config.sub Tue Feb 12 04:37:53 2002 *************** *** 0 **** --- 1,1440 ---- + #! /bin/sh + # Configuration validation subroutine script. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + # 2000, 2001, 2002 Free Software Foundation, Inc. + + timestamp='2002-01-02' + + # This file is (in principle) common to ALL GNU software. + # The presence of a machine in this file suggests that SOME GNU software + # can handle that machine. It does not imply ALL GNU software can. + # + # This file is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, + # Boston, MA 02111-1307, USA. + + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under + # the same distribution terms that you use for the rest of that program. + + # Please send patches to . Submit a context + # diff and a properly formatted ChangeLog entry. + # + # Configuration subroutine to validate and canonicalize a configuration type. + # Supply the specified configuration type as an argument. + # If it is invalid, we print an error message on stderr and exit with code 1. + # Otherwise, we print the canonical config type on stdout and succeed. + + # This file is supposed to be the same for all GNU packages + # and recognize all the CPU types, system types and aliases + # that are meaningful with *any* GNU software. + # Each package is responsible for reporting which valid configurations + # it does not support. The user should be able to distinguish + # a failure to support a valid configuration from a meaningless + # configuration. + + # The goal of this file is to map all the various variations of a given + # machine specification into a single specification in the form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM + # or in some cases, the newer four-part form: + # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM + # It is wrong to echo any other type of specification. + + me=`echo "$0" | sed -e 's,.*/,,'` + + usage="\ + Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + + Canonicalize a configuration name. + + Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + + Report bugs and patches to ." + + version="\ + GNU config.sub ($timestamp) + + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + + help=" + Try \`$me --help' for more information." + + # Parse command line + while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac + done + + case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; + esac + + # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). + # Here we must recognize all the valid KERNEL-OS combinations. + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in + nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; + esac + + ### Let's recognize common machines as not being operating systems so + ### that things like config.sub decstation-3100 work. We also + ### recognize some manufacturers as not being operating systems, so we + ### can provide default operating systems below. + case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + esac + + # Decode aliases for certain CPU-COMPANY combinations. + case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dsp16xx \ + | fr30 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el | mips64vr4300 \ + | mips64vr4300el | mips64vr5000 | mips64vr5000el \ + | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ + | mipsisa32 \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[34] | sh[34]eb | shbe | shle \ + | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cray2-* | cydra-* \ + | d10v-* | d30v-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | m32r-* \ + | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ + | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ + | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \ + | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + [cjt]90) + basic_machine=${basic_machine}-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + # I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i686-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=t3e-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + mips) + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh3eb | sh4eb) + basic_machine=sh-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + esac + + # Here we canonicalize certain aliases for manufacturers. + case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; + esac + + # Decode manufacturer-specific aliases for certain operating systems. + + if [ x"$os" != x"" ] + then + case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* | -morphos*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; + esac + else + + # Here we handle the default operating systems that come with various machines. + # The value should be what the vendor currently ships out the door with their + # machine or put another way, the most popular os provided with the machine. + + # Note that if you're going to try to match "-MANUFACTURER" here (say, + # "-sun"), then you have to tell the case statement up towards the top + # that MANUFACTURER isn't an operating system. Otherwise, code above + # will signal an error saying that MANUFACTURER isn't an operating + # system, and we'll never get to this point. + + case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; + esac + fi + + # Here we handle the case where we know the os, and the CPU type, but not the + # manufacturer. We pick the logical manufacturer. + vendor=unknown + case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; + esac + + echo $basic_machine$os + exit 0 + + # Local variables: + # eval: (add-hook 'write-file-hooks 'time-stamp) + # time-stamp-start: "timestamp='" + # time-stamp-format: "%:y-%02m-%02d" + # time-stamp-end: "'" + # End: diff -Nrc3pad gcc-3.0.4/boehm-gc/configure gcc-3.1/boehm-gc/configure *** gcc-3.0.4/boehm-gc/configure Wed Feb 20 19:40:48 2002 --- gcc-3.1/boehm-gc/configure Wed May 15 02:40:18 2002 *************** ac_help="$ac_help *** 37,45 **** --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer" ac_help="$ac_help ! --enable-java-gc=TYPE choose garbage collector [boehm]" ac_help="$ac_help --with-ecos enable runtime eCos target support" # Initialize some variables set by options. # The variables have the same names as the options, with --- 37,49 ---- --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer" ac_help="$ac_help ! --enable-parallel-mark parallelize marking and free list construction" ac_help="$ac_help --with-ecos enable runtime eCos target support" + ac_help="$ac_help + --enable-shared[=PKGS] build shared libraries [default=no]" + ac_help="$ac_help + --enable-full-debug include full support for pointer backtracing etc." # Initialize some variables set by options. # The variables have the same names as the options, with *************** program_suffix=NONE *** 57,62 **** --- 61,67 ---- program_transform_name=s,x,x, silent= site= + sitefile= srcdir= target=NONE verbose= *************** Configuration: *** 171,176 **** --- 176,182 ---- --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX *************** EOF *** 341,346 **** --- 347,357 ---- -site=* | --site=* | --sit=*) site="$ac_optarg" ;; + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) *************** echo > confdefs.h *** 480,486 **** # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ! ac_unique_file=gc_mark.h # Find the source files, if location was not specified. if test -z "$srcdir"; then --- 491,497 ---- # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ! ac_unique_file=gcj_mlc.c # Find the source files, if location was not specified. if test -z "$srcdir"; then *************** fi *** 506,517 **** srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. ! if test -z "$CONFIG_SITE"; then ! if test "x$prefix" != xNONE; then ! CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" ! else ! CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then --- 517,532 ---- srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. ! if test -z "$sitefile"; then ! if test -z "$CONFIG_SITE"; then ! if test "x$prefix" != xNONE; then ! CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" ! else ! CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" ! fi fi + else + CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then *************** fi *** 551,556 **** --- 566,597 ---- + # This works around the fact that libtool configuration may change LD + # for this particular configuration, but some shells, instead of + # keeping the changes in LD private, export them just because LD is + # exported. + ORIGINAL_LD_FOR_MULTILIBS=$LD + + ac_aux_dir= + for ac_dir in . $srcdir/.; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi + done + if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in . $srcdir/." 1>&2; exit 1; } + fi + ac_config_guess=$ac_aux_dir/config.guess + ac_config_sub=$ac_aux_dir/config.sub + ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: *************** fi *** 563,569 **** # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:567: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 604,610 ---- # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:608: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** test -z "$INSTALL_SCRIPT" && INSTALL_SCR *** 616,622 **** test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 ! echo "configure:620: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile --- 657,663 ---- test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 ! echo "configure:661: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile *************** test "$program_suffix" != NONE && *** 673,679 **** test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ! echo "configure:677: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 714,720 ---- test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ! echo "configure:718: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 706,717 **** fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 ! echo "configure:710: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:751: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else --- 763,769 ---- return __CYGWIN__; ; return 0; } EOF ! if { (eval echo configure:767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else *************** echo "$ac_t""$ac_cv_cygwin" 1>&6 *** 739,757 **** CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 ! echo "configure:743: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else --- 780,798 ---- CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 ! echo "configure:784: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else *************** fi *** 782,798 **** if test "${srcdir}" = "."; then ! if test "${with_target_subdir}" != "."; then ! boehm_gc_basedir="${srcdir}/${with_multisrctop}../." else ! boehm_gc_basedir="${srcdir}/${with_multisrctop}." fi else ! boehm_gc_basedir="${srcdir}/." fi ac_aux_dir= ! for ac_dir in $boehm_gc_basedir/.. $srcdir/$boehm_gc_basedir/..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" --- 823,839 ---- if test "${srcdir}" = "."; then ! if test "${with_target_subdir}" != "." -a -n "${with_target_subdir}"; then ! gc_basedir="${srcdir}/${with_multisrctop}../." else ! gc_basedir="${srcdir}/${with_multisrctop}." fi else ! gc_basedir="${srcdir}/." fi ac_aux_dir= ! for ac_dir in $gc_basedir/.. $srcdir/$gc_basedir/..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" *************** for ac_dir in $boehm_gc_basedir/.. $srcd *** 804,810 **** fi done if test -z "$ac_aux_dir"; then ! { echo "configure: error: can not find install-sh or install.sh in $boehm_gc_basedir/.. $srcdir/$boehm_gc_basedir/.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub --- 845,851 ---- fi done if test -z "$ac_aux_dir"; then ! { echo "configure: error: can not find install-sh or install.sh in $gc_basedir/.. $srcdir/$gc_basedir/.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub *************** else { echo "configure: error: can not r *** 862,868 **** fi echo $ac_n "checking host system type""... $ac_c" 1>&6 ! echo "configure:866: checking host system type" >&5 host_alias=$host case "$host_alias" in --- 903,909 ---- fi echo $ac_n "checking host system type""... $ac_c" 1>&6 ! echo "configure:907: checking host system type" >&5 host_alias=$host case "$host_alias" in *************** host_os=`echo $host | sed 's/^\([^-]*\)- *** 883,889 **** echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 ! echo "configure:887: checking target system type" >&5 target_alias=$target case "$target_alias" in --- 924,930 ---- echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 ! echo "configure:928: checking target system type" >&5 target_alias=$target case "$target_alias" in *************** target_os=`echo $target | sed 's/^\([^-] *** 901,907 **** echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 ! echo "configure:905: checking build system type" >&5 build_alias=$build case "$build_alias" in --- 942,948 ---- echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 ! echo "configure:946: checking build system type" >&5 build_alias=$build case "$build_alias" in *************** mkinstalldirs="`cd $ac_aux_dir && pwd`/m *** 929,937 **** ! PACKAGE=boehm-gc ! VERSION=5.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } --- 970,978 ---- ! PACKAGE=gc ! VERSION=6.0 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } *************** fi *** 941,947 **** missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 ! echo "configure:945: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 982,988 ---- missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 ! echo "configure:986: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 954,960 **** fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 ! echo "configure:958: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 995,1001 ---- fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 ! echo "configure:999: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 967,973 **** fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 ! echo "configure:971: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 1008,1014 ---- fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 ! echo "configure:1012: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 980,986 **** fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 ! echo "configure:984: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 1021,1027 ---- fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 ! echo "configure:1025: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 993,999 **** fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 ! echo "configure:997: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 1034,1040 ---- fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 ! echo "configure:1038: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** fi *** 1019,1025 **** # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1023: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1060,1066 ---- # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1064: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -z "$CC"; then *** 1049,1055 **** # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1053: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1090,1096 ---- # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1094: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1098,1104 **** fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1102: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1139,1145 ---- fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1143: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 1107,1113 **** yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no --- 1148,1154 ---- yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no *************** if test $ac_cv_prog_gcc = yes; then *** 1122,1128 **** ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1126: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1163,1169 ---- ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1167: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** do *** 1159,1165 **** # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1163: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1200,1206 ---- # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1204: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** test -n "$CXX" || CXX="gcc" *** 1192,1198 **** test -z "$CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 ! echo "configure:1196: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1233,1239 ---- test -z "$CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 ! echo "configure:1237: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 1201,1207 **** yes; #endif EOF ! if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no --- 1242,1248 ---- yes; #endif EOF ! if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no *************** if test $ac_cv_prog_gxx = yes; then *** 1216,1222 **** ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 ! echo "configure:1220: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1257,1263 ---- ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 ! echo "configure:1261: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1249,1255 **** # NEWLIB_CONFIGURE, which doesn't work because that means that it will # be run before AC_CANONICAL_HOST. echo $ac_n "checking build system type""... $ac_c" 1>&6 ! echo "configure:1253: checking build system type" >&5 build_alias=$build case "$build_alias" in --- 1290,1296 ---- # NEWLIB_CONFIGURE, which doesn't work because that means that it will # be run before AC_CANONICAL_HOST. echo $ac_n "checking build system type""... $ac_c" 1>&6 ! echo "configure:1294: checking build system type" >&5 build_alias=$build case "$build_alias" in *************** echo "$ac_t""$build" 1>&6 *** 1270,1276 **** # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1274: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1311,1317 ---- # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1315: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1302,1308 **** # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1306: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1343,1349 ---- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1347: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1334,1340 **** # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1338: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1375,1381 ---- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1379: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -n "$ac_tool_prefix"; then *** 1366,1372 **** # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1370: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1407,1413 ---- # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1411: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1411,1417 **** # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:1415: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1452,1458 ---- # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:1456: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** test -z "$INSTALL_DATA" && INSTALL_DATA= *** 1465,1471 **** echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 ! echo "configure:1469: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" --- 1506,1512 ---- echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 ! echo "configure:1510: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" *************** fi *** 1496,1505 **** # automake happy, but we don't execute it, since we don't care about # the result. if false; then echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:1503: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1537,1550 ---- # automake happy, but we don't execute it, since we don't care about # the result. if false; then + # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands + # to nothing, so nothing would remain between `then' and `fi' if it + # were not for the `:' below. + : echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:1548: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 1509,1518 **** rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:1513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in ! *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done --- 1554,1563 ---- rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:1558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in ! *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done *************** fi *** 1533,1553 **** . ${srcdir}/configure.host ! case ${boehm_gc_basedir} in ! /* | A-Za-z:/\\*) boehm_gc_flagbasedir=${boehm_gc_basedir} ;; ! *) boehm_gc_flagbasedir='$(top_builddir)/'${boehm_gc_basedir} ;; esac ! boehm_gc_cflags="${boehm_gc_cflags} -I"'$(top_builddir)'"/./targ-include -I${boehm_gc_flagbasedir}/libc/include" case "${host}" in *-*-cygwin32*) ! boehm_gc_cflags="${boehm_gc_cflags} -I${boehm_gc_flagbasedir}/../winsup/include" ;; esac - boehm_gc_cflags="${boehm_gc_cflags} -fno-builtin" ! BOEHM_GC_CFLAGS=${boehm_gc_cflags} --- 1578,1597 ---- . ${srcdir}/configure.host ! case ${gc_basedir} in ! /* | A-Za-z:/\\*) gc_flagbasedir=${gc_basedir} ;; ! *) gc_flagbasedir='$(top_builddir)/'${gc_basedir} ;; esac ! gc_cflags="${gc_cflags} -I"'$(top_builddir)'"/./targ-include -I${gc_flagbasedir}/libc/include" case "${host}" in *-*-cygwin32*) ! gc_cflags="${gc_cflags} -I${gc_flagbasedir}/../winsup/include" ;; esac ! GC_CFLAGS=${gc_cflags} *************** ac_prog=ld *** 1632,1638 **** if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 ! echo "configure:1636: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw --- 1676,1682 ---- if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 ! echo "configure:1680: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw *************** echo "configure:1636: checking for ld us *** 1662,1671 **** esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 ! echo "configure:1666: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 ! echo "configure:1669: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1706,1715 ---- esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 ! echo "configure:1710: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 ! echo "configure:1713: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 1700,1706 **** fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 ! echo "configure:1704: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1744,1750 ---- fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 ! echo "configure:1748: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** with_gnu_ld=$lt_cv_prog_gnu_ld *** 1717,1723 **** echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 ! echo "configure:1721: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1761,1767 ---- echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 ! echo "configure:1765: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** reload_flag=$lt_cv_ld_reload_flag *** 1729,1735 **** test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 ! echo "configure:1733: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1773,1779 ---- test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 ! echo "configure:1777: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** NM="$lt_cv_path_NM" *** 1767,1773 **** echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 ! echo "configure:1771: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1811,1817 ---- echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 ! echo "configure:1815: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 1788,1794 **** fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 ! echo "configure:1792: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1832,1838 ---- fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 ! echo "configure:1836: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** file_magic_cmd=$lt_cv_file_magic_cmd *** 1952,1964 **** deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 ! echo "configure:1956: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext ! if { (eval echo configure:1962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; --- 1996,2008 ---- deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 ! echo "configure:2000: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext ! if { (eval echo configure:2006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; *************** case $deplibs_check_method in *** 1982,1988 **** file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 ! echo "configure:1986: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2026,2032 ---- file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 ! echo "configure:2030: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 2044,2050 **** if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 ! echo "configure:2048: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2088,2094 ---- if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 ! echo "configure:2092: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** esac *** 2115,2121 **** # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2119: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2159,2165 ---- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2163: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -n "$ac_tool_prefix"; then *** 2147,2153 **** # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2151: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2191,2197 ---- # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2195: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 2182,2188 **** # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2186: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2226,2232 ---- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2230: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -n "$ac_tool_prefix"; then *** 2214,2220 **** # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2218: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2258,2264 ---- # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2262: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** test x"$pic_mode" = xno && libtool_flags *** 2281,2288 **** case $host in *-*-irix6*) # Find out which ABI we are using. ! echo '#line 2285 "configure"' > conftest.$ac_ext ! if { (eval echo configure:2286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" --- 2325,2332 ---- case $host in *-*-irix6*) # Find out which ABI we are using. ! echo '#line 2329 "configure"' > conftest.$ac_ext ! if { (eval echo configure:2330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" *************** case $host in *** 2303,2309 **** SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 ! echo "configure:2307: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2347,2353 ---- SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 ! echo "configure:2351: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** ac_link='${CC-cc} -o conftest${ac_exeext *** 2316,2329 **** cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else --- 2360,2373 ---- cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else *************** echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 *** 2353,2359 **** esac echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 ! echo "configure:2357: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2397,2403 ---- esac echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 ! echo "configure:2401: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** ac_link='${CXX-g++} -o conftest${ac_exee *** 2366,2377 **** cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2375: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : --- 2410,2421 ---- cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2419: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : *************** fi *** 2518,2524 **** echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 ! echo "configure:2522: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" --- 2562,2568 ---- echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 ! echo "configure:2566: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" *************** fi *** 2543,2553 **** # automake wants to see AC_EXEEXT. But we don't need it. And having # it is actually a problem, because the compiler we're passed can't # necessarily do a full link. So we fool automake here. ! if test "x" = "y"; then ! echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:2551: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2587,2601 ---- # automake wants to see AC_EXEEXT. But we don't need it. And having # it is actually a problem, because the compiler we're passed can't # necessarily do a full link. So we fool automake here. ! if false; then ! # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands ! # to nothing, so nothing would remain between `then' and `fi' if it ! # were not for the `:' below. ! : ! echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:2599: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 2557,2566 **** rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:2561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in ! *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done --- 2605,2614 ---- rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:2609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in ! *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done *************** ac_exeext=$EXEEXT *** 2580,2590 **** fi echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6 ! echo "configure:2584: checking for thread model used by GCC" >&5 THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` echo "$ac_t""$THREADS" 1>&6 ! INCLUDES= THREADLIBS= case "$THREADS" in no | none | single) --- 2628,2653 ---- fi echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6 ! echo "configure:2632: checking for thread model used by GCC" >&5 THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` + if test -z "$THREADS"; then + THREADS=no + fi echo "$ac_t""$THREADS" 1>&6 ! # Check whether --enable-parallel-mark or --disable-parallel-mark was given. ! if test "${enable_parallel_mark+set}" = set; then ! enableval="$enable_parallel_mark" ! case "$THREADS" in ! no | none | single) ! { echo "configure: error: Parallel mark requires --enable-threads=x spec" 1>&2; exit 1; } ! ;; ! esac ! ! fi ! ! ! INCLUDES=-I${srcdir}/include THREADLIBS= case "$THREADS" in no | none | single) *************** case "$THREADS" in *** 2592,2601 **** ;; posix | pthreads) THREADS=posix case "$host" in *-*-linux*) cat >> confdefs.h <<\EOF ! #define LINUX_THREADS 1 EOF cat >> confdefs.h <<\EOF --- 2655,2685 ---- ;; posix | pthreads) THREADS=posix + THREADLIBS=-lpthread case "$host" in + x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux*) + cat >> confdefs.h <<\EOF + #define GC_LINUX_THREADS 1 + EOF + + cat >> confdefs.h <<\EOF + #define _REENTRANT 1 + EOF + + if test "${enable_parallel_mark}"; then + cat >> confdefs.h <<\EOF + #define PARALLEL_MARK 1 + EOF + + fi + cat >> confdefs.h <<\EOF + #define THREAD_LOCAL_ALLOC 1 + EOF + + ;; *-*-linux*) cat >> confdefs.h <<\EOF ! #define GC_LINUX_THREADS 1 EOF cat >> confdefs.h <<\EOF *************** EOF *** 2603,2628 **** EOF ;; *-*-solaris*) cat >> confdefs.h <<\EOF ! #define SOLARIS_THREADS 1 EOF cat >> confdefs.h <<\EOF ! #define _SOLARIS_PTHREADS 1 EOF ;; *-*-irix*) cat >> confdefs.h <<\EOF ! #define IRIX_THREADS 1 EOF ;; esac - THREADLIBS=-lpthread ;; ! decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks) { echo "configure: error: thread package $THREADS not yet supported" 1>&2; exit 1; } ;; *) --- 2687,2755 ---- EOF ;; + *-*-hpux*) + echo "configure: warning: "Only HP/UX 11 threads are supported."" 1>&2 + cat >> confdefs.h <<\EOF + #define GC_HPUX_THREADS 1 + EOF + + cat >> confdefs.h <<\EOF + #define _POSIX_C_SOURCE 199506L + EOF + + if test "${enable_parallel_mark}" = yes; then + cat >> confdefs.h <<\EOF + #define PARALLEL_MARK 1 + EOF + + fi + cat >> confdefs.h <<\EOF + #define THREAD_LOCAL_ALLOC 1 + EOF + + THREADLIBS="-lpthread -lrt" + ;; + *-*-freebsd*) + echo "configure: warning: "FreeBSD does not yet fully support threads with Boehm GC."" 1>&2 + cat >> confdefs.h <<\EOF + #define GC_FREEBSD_THREADS 1 + EOF + + INCLUDES="$INCLUDES -pthread" + THREADLIBS=-pthread + ;; *-*-solaris*) cat >> confdefs.h <<\EOF ! #define GC_SOLARIS_THREADS 1 EOF cat >> confdefs.h <<\EOF ! #define GC_SOLARIS_PTHREADS 1 EOF ;; *-*-irix*) cat >> confdefs.h <<\EOF ! #define GC_IRIX_THREADS 1 EOF ;; + *-*-cygwin*) + THREADLIBS= + ;; esac ;; ! win32) ! cat >> confdefs.h <<\EOF ! #define GC_WIN32_THREADS 1 ! EOF ! ! cat >> confdefs.h <<\EOF ! #define NO_GETENV 1 ! EOF ! ! ;; ! decosf1 | irix | mach | os2 | solaris | dce | vxworks) { echo "configure: error: thread package $THREADS not yet supported" 1>&2; exit 1; } ;; *) *************** esac *** 2632,2638 **** echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 ! echo "configure:2636: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2759,2765 ---- echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 ! echo "configure:2763: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 2640,2646 **** ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 2778,2784 ---- dlopen() ; return 0; } EOF ! if { (eval echo configure:2782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** fi *** 2673,2691 **** ! # Check whether --enable-java-gc or --disable-java-gc was given. ! if test "${enable_java_gc+set}" = set; then ! enableval="$enable_java_gc" ! ! GC=$enableval ! else ! GC=boehm ! fi - target_all= - if test "$GC" = "boehm"; then - target_all=libgcjgc.la - fi TARGET_ECOS="no" --- 2800,2807 ---- ! target_all=libgcjgc.la TARGET_ECOS="no" *************** esac *** 2718,2728 **** machdep= case "$host" in ! # alpha_mach_dep.s assumes that pointers are not saved in fp registers. ! # Gcc on a 21264 can spill pointers to fp registers. Oops. ! # alpha*-*-*) ! # machdep="alpha_mach_dep.lo" ! # ;; i?86-*-solaris2.[89]*) cat >> confdefs.h <<\EOF #define SOLARIS25_PROC_VDB_BUG_FIXED 1 --- 2834,2871 ---- machdep= case "$host" in ! alpha*-*-openbsd*) ! machdep="alpha_mach_dep.lo" ! if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then ! echo "configure: warning: OpenBSD/Alpha without dlopen(). Shared library support is disabled" 1>&2 ! # Check whether --enable-shared or --disable-shared was given. ! if test "${enable_shared+set}" = set; then ! enableval="$enable_shared" ! p=${PACKAGE-default} ! case $enableval in ! yes) enable_shared=yes ;; ! no) enable_shared=no ;; ! *) ! enable_shared=no ! # Look at the argument we got. We use all the common list separators. ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," ! for pkg in $enableval; do ! if test "X$pkg" = "X$p"; then ! enable_shared=yes ! fi ! done ! IFS="$ac_save_ifs" ! ;; ! esac ! else ! enable_shared=no ! fi ! ! fi ! ;; ! alpha*-*-*) ! machdep="alpha_mach_dep.lo" ! ;; i?86-*-solaris2.[89]*) cat >> confdefs.h <<\EOF #define SOLARIS25_PROC_VDB_BUG_FIXED 1 *************** EOF *** 2751,2761 **** --- 2894,2911 ---- ;; sparc-sun-solaris2.3*) + machdep="sparc_mach_dep.lo" cat >> confdefs.h <<\EOF #define SUNOS53_SHARED_LIB 1 EOF ;; + sparc-sun-solaris2.*) + machdep="sparc_mach_dep.lo" + ;; + ia64-*-*) + machdep="mach_dep.lo ia64_save_regs_in_stack.lo" + ;; esac if test x"$machdep" = x; then machdep="mach_dep.lo" *************** cat >> confdefs.h <<\EOF *** 2793,2798 **** --- 2943,2957 ---- EOF cat >> confdefs.h <<\EOF + #define NO_EXECUTE_PERMISSION 1 + EOF + + cat >> confdefs.h <<\EOF + #define ALL_INTERIOR_POINTERS 1 + EOF + + + cat >> confdefs.h <<\EOF #define JAVA_FINALIZATION 1 EOF *************** cat >> confdefs.h <<\EOF *** 2800,2805 **** --- 2959,2968 ---- #define GC_GCJ_SUPPORT 1 EOF + cat >> confdefs.h <<\EOF + #define ATOMIC_UNCOLLECTABLE 1 + EOF + if test -n "${with_cross_host}"; then cat >> confdefs.h <<\EOF *************** if test -n "${with_cross_host}"; then *** 2807,2827 **** EOF cat >> confdefs.h <<\EOF ! #define NO_CLOCK 1 EOF ! cat >> confdefs.h <<\EOF ! #define SMALL_CONFIG 1 EOF ! cat >> confdefs.h <<\EOF ! #define NO_DEBUGGING 1 EOF fi if test -z "$with_cross_host"; then USE_LIBDIR_TRUE= USE_LIBDIR_FALSE='#' --- 2970,3018 ---- EOF cat >> confdefs.h <<\EOF ! #define NO_DEBUGGING 1 EOF ! fi ! ! # Check whether --enable-full-debug or --disable-full-debug was given. ! if test "${enable_full_debug+set}" = set; then ! enableval="$enable_full_debug" ! if test "$enable_full_debug" = "yes"; then ! echo "configure: warning: "Must define GC_DEBUG and use debug alloc. in clients."" 1>&2 ! cat >> confdefs.h <<\EOF ! #define KEEP_BACK_PTRS 1 EOF ! cat >> confdefs.h <<\EOF ! #define DBG_HDRS_ALL 1 EOF + case $host in + ia64-*-linux* ) + cat >> confdefs.h <<\EOF + #define MAKE_BACK_GRAPH 1 + EOF + + ;; + x86-*-linux* | i586-*-linux* | i686-*-linux* ) + cat >> confdefs.h <<\EOF + #define MAKE_BACK_GRAPH 1 + EOF + + echo "configure: warning: "Client must not use -fomit-frame-pointer."" 1>&2 + cat >> confdefs.h <<\EOF + #define SAVE_CALL_COUNT 8 + EOF + + ;; + esac + fi fi + if test -z "$with_cross_host"; then USE_LIBDIR_TRUE= USE_LIBDIR_FALSE='#' *************** done *** 2949,2955 **** ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" ! trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then --- 3265,3271 ---- cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then *************** target=${target} *** 3141,3147 **** with_multisubdir=${with_multisubdir} ac_configure_args="${multilib_arg} ${ac_configure_args}" CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} ! boehm_gc_basedir=${boehm_gc_basedir} CC="${CC}" DEFS="$DEFS" --- 3332,3338 ---- with_multisubdir=${with_multisubdir} ac_configure_args="${multilib_arg} ${ac_configure_args}" CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} ! gc_basedir=${gc_basedir} CC="${CC}" DEFS="$DEFS" *************** cat >> $CONFIG_STATUS <<\EOF *** 3151,3157 **** echo "$DEFS" > boehm-cflags if test -n "$CONFIG_FILES"; then ! ac_file=Makefile . ${boehm_gc_basedir}/../config-ml.in fi exit 0 EOF --- 3342,3349 ---- echo "$DEFS" > boehm-cflags if test -n "$CONFIG_FILES"; then ! LD="${ORIGINAL_LD_FOR_MULTILIBS}" ! ac_file=Makefile . ${gc_basedir}/../config-ml.in fi exit 0 EOF diff -Nrc3pad gcc-3.0.4/boehm-gc/configure.host gcc-3.1/boehm-gc/configure.host *** gcc-3.0.4/boehm-gc/configure.host Wed Jun 30 12:43:22 1999 --- gcc-3.1/boehm-gc/configure.host Sat Aug 18 01:04:42 2001 *************** *** 1,6 **** # configure.host ! # This shell script handles all host based configuration for boehm_gc. # It sets various shell variables based on the the host and the # configuration options. You can modify this shell script without # needing to rerun autoconf. --- 1,7 ---- # configure.host ! # This shell script handles all host based configuration for the garbage ! # collector. # It sets various shell variables based on the the host and the # configuration options. You can modify this shell script without # needing to rerun autoconf. *************** *** 15,30 **** # target_optspace --enable-target-optspace ("yes", "no", "") # It sets the following shell variables: ! # boehm_gc_cflags Special CFLAGS to use when building ! boehm_gc_cflags= case "${target_optspace}:${host}" in yes:*) ! boehm_gc_cflags="${boehm_gc_cflags} -Os" ;; :m32r-* | :d10v-* | :d30v-*) ! boehm_gc_cflags="${boehm_gc_cflags} -Os" ;; no:* | :*) # Nothing. --- 16,40 ---- # target_optspace --enable-target-optspace ("yes", "no", "") # It sets the following shell variables: ! # gc_cflags Special CFLAGS to use when building ! # We should set -fexceptions if we are using gcc and might be used ! # inside something like gcj. This is the zeroth approximation: ! case "$host" in ! *-*-linux* ) ! gc_cflags=-fexceptions ! ;; ! *-*-hpux* ) ! gc_cflags=+ESdbgasm ! ;; ! esac case "${target_optspace}:${host}" in yes:*) ! gc_cflags="${gc_cflags} -Os" ;; :m32r-* | :d10v-* | :d30v-*) ! gc_cflags="${gc_cflags} -Os" ;; no:* | :*) # Nothing. diff -Nrc3pad gcc-3.0.4/boehm-gc/configure.in gcc-3.1/boehm-gc/configure.in *** gcc-3.0.4/boehm-gc/configure.in Wed Sep 26 13:10:55 2001 --- gcc-3.1/boehm-gc/configure.in Wed May 8 04:25:22 2002 *************** *** 1,8 **** dnl Process this file with autoconf to produce configure. ! AC_INIT(gc_mark.h) ! BOEHM_CONFIGURE(.) AM_PROG_LIBTOOL --- 1,30 ---- + # Copyright (c) 1999, 2000, 2001, 2002 by Red Hat, Inc. All rights reserved. + # + # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED + # OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + # + # Permission is hereby granted to use or copy this program + # for any purpose, provided the above notices are retained on all copies. + # Permission to modify the code and to distribute modified code is granted, + # provided the above notices are retained, and a notice that the code was + # modified is included with the above copyright notice. + # + # Original author: Tom Tromey + dnl Process this file with autoconf to produce configure. ! AC_INIT(gcj_mlc.c) ! # This works around the fact that libtool configuration may change LD ! # for this particular configuration, but some shells, instead of ! # keeping the changes in LD private, export them just because LD is ! # exported. ! ORIGINAL_LD_FOR_MULTILIBS=$LD ! ! dnl Can't be done in GC_CONFIGURE because that confuses automake. ! AC_CONFIG_AUX_DIR(.) ! ! GC_CONFIGURE(.) AM_PROG_LIBTOOL *************** AM_MAINTAINER_MODE *** 17,31 **** # automake wants to see AC_EXEEXT. But we don't need it. And having # it is actually a problem, because the compiler we're passed can't # necessarily do a full link. So we fool automake here. ! if test "x" = "y"; then ! AC_EXEEXT fi AC_MSG_CHECKING([for thread model used by GCC]) THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` AC_MSG_RESULT([$THREADS]) ! INCLUDES= THREADLIBS= case "$THREADS" in no | none | single) --- 39,69 ---- # automake wants to see AC_EXEEXT. But we don't need it. And having # it is actually a problem, because the compiler we're passed can't # necessarily do a full link. So we fool automake here. ! if false; then ! # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands ! # to nothing, so nothing would remain between `then' and `fi' if it ! # were not for the `:' below. ! : ! AC_EXEEXT fi AC_MSG_CHECKING([for thread model used by GCC]) THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` + if test -z "$THREADS"; then + THREADS=no + fi AC_MSG_RESULT([$THREADS]) ! AC_ARG_ENABLE(parallel-mark, ! [ --enable-parallel-mark parallelize marking and free list construction], ! [case "$THREADS" in ! no | none | single) ! AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec]) ! ;; ! esac] ! ) ! ! INCLUDES=-I${srcdir}/include THREADLIBS= case "$THREADS" in no | none | single) *************** case "$THREADS" in *** 33,54 **** ;; posix | pthreads) THREADS=posix case "$host" in *-*-linux*) ! AC_DEFINE(LINUX_THREADS) AC_DEFINE(_REENTRANT) ;; *-*-solaris*) ! AC_DEFINE(SOLARIS_THREADS) ! AC_DEFINE(_SOLARIS_PTHREADS) ;; *-*-irix*) ! AC_DEFINE(IRIX_THREADS) ;; esac - THREADLIBS=-lpthread ;; ! decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks) AC_MSG_ERROR(thread package $THREADS not yet supported) ;; *) --- 71,123 ---- ;; posix | pthreads) THREADS=posix + THREADLIBS=-lpthread case "$host" in + x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux*) + AC_DEFINE(GC_LINUX_THREADS) + AC_DEFINE(_REENTRANT) + if test "${enable_parallel_mark}"; then + AC_DEFINE(PARALLEL_MARK) + fi + AC_DEFINE(THREAD_LOCAL_ALLOC) + ;; *-*-linux*) ! AC_DEFINE(GC_LINUX_THREADS) AC_DEFINE(_REENTRANT) ;; + *-*-hpux*) + AC_MSG_WARN("Only HP/UX 11 threads are supported.") + AC_DEFINE(GC_HPUX_THREADS) + AC_DEFINE(_POSIX_C_SOURCE,199506L) + if test "${enable_parallel_mark}" = yes; then + AC_DEFINE(PARALLEL_MARK) + fi + AC_DEFINE(THREAD_LOCAL_ALLOC) + THREADLIBS="-lpthread -lrt" + ;; + *-*-freebsd*) + AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.") + AC_DEFINE(GC_FREEBSD_THREADS) + INCLUDES="$INCLUDES -pthread" + THREADLIBS=-pthread + ;; *-*-solaris*) ! AC_DEFINE(GC_SOLARIS_THREADS) ! AC_DEFINE(GC_SOLARIS_PTHREADS) ;; *-*-irix*) ! AC_DEFINE(GC_IRIX_THREADS) ! ;; ! *-*-cygwin*) ! THREADLIBS= ;; esac ;; ! win32) ! AC_DEFINE(GC_WIN32_THREADS) ! AC_DEFINE(NO_GETENV) ! ;; ! decosf1 | irix | mach | os2 | solaris | dce | vxworks) AC_MSG_ERROR(thread package $THREADS not yet supported) ;; *) *************** AC_SUBST(THREADLIBS) *** 60,76 **** AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl") AC_SUBST(EXTRA_TEST_LIBS) ! AC_ARG_ENABLE(java-gc, ! changequote(<<,>>)dnl ! << --enable-java-gc=TYPE choose garbage collector [boehm]>>, ! changequote([,]) ! GC=$enableval, ! GC=boehm) ! target_all= ! if test "$GC" = "boehm"; then ! target_all=libgcjgc.la ! fi AC_SUBST(target_all) dnl If the target is an eCos system, use the appropriate eCos dnl I/O routines. --- 129,137 ---- AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl") AC_SUBST(EXTRA_TEST_LIBS) ! target_all=libgcjgc.la AC_SUBST(target_all) + AC_SUBST(target_alias) dnl If the target is an eCos system, use the appropriate eCos dnl I/O routines. *************** AC_SUBST(CXXINCLUDES) *** 100,110 **** machdep= case "$host" in ! # alpha_mach_dep.s assumes that pointers are not saved in fp registers. ! # Gcc on a 21264 can spill pointers to fp registers. Oops. ! # alpha*-*-*) ! # machdep="alpha_mach_dep.lo" ! # ;; i?86-*-solaris2.[[89]]*) AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED) ;; --- 161,176 ---- machdep= case "$host" in ! alpha*-*-openbsd*) ! machdep="alpha_mach_dep.lo" ! if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then ! AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled) ! AM_DISABLE_SHARED ! fi ! ;; ! alpha*-*-*) ! machdep="alpha_mach_dep.lo" ! ;; i?86-*-solaris2.[[89]]*) AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED) ;; *************** case "$host" in *** 121,128 **** --- 187,201 ---- AC_DEFINE(NO_EXECUTE_PERMISSION) ;; sparc-sun-solaris2.3*) + machdep="sparc_mach_dep.lo" AC_DEFINE(SUNOS53_SHARED_LIB) ;; + sparc-sun-solaris2.*) + machdep="sparc_mach_dep.lo" + ;; + ia64-*-*) + machdep="mach_dep.lo ia64_save_regs_in_stack.lo" + ;; esac if test x"$machdep" = x; then machdep="mach_dep.lo" *************** dnl We need to override the top-level CF *** 154,176 **** MY_CFLAGS="$CFLAGS" AC_SUBST(MY_CFLAGS) ! dnl Define a few things to retarget the library towards ! dnl embedded Java. AC_DEFINE(SILENT) AC_DEFINE(NO_SIGNALS) AC_DEFINE(JAVA_FINALIZATION) AC_DEFINE(GC_GCJ_SUPPORT) dnl This is something of a hack. When cross-compiling we turn off ! dnl some functionality. We also enable the "small" configuration. ! dnl These is only correct when targetting an embedded system. FIXME. if test -n "${with_cross_host}"; then AC_DEFINE(NO_SIGSET) - AC_DEFINE(NO_CLOCK) - AC_DEFINE(SMALL_CONFIG) AC_DEFINE(NO_DEBUGGING) fi AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host") if test "${multilib}" = "yes"; then --- 227,270 ---- MY_CFLAGS="$CFLAGS" AC_SUBST(MY_CFLAGS) ! dnl Include defines that have become de facto standard. ! dnl ALL_INTERIOR_POINTERS can be overridden in startup code. AC_DEFINE(SILENT) AC_DEFINE(NO_SIGNALS) + AC_DEFINE(NO_EXECUTE_PERMISSION) + AC_DEFINE(ALL_INTERIOR_POINTERS) + + dnl By default, make the library as general as possible. AC_DEFINE(JAVA_FINALIZATION) AC_DEFINE(GC_GCJ_SUPPORT) + AC_DEFINE(ATOMIC_UNCOLLECTABLE) dnl This is something of a hack. When cross-compiling we turn off ! dnl some functionality. These is only correct when targetting an ! dnl embedded system. FIXME. if test -n "${with_cross_host}"; then AC_DEFINE(NO_SIGSET) AC_DEFINE(NO_DEBUGGING) fi + AC_ARG_ENABLE(full-debug, + [ --enable-full-debug include full support for pointer backtracing etc.], + [ if test "$enable_full_debug" = "yes"; then + AC_MSG_WARN("Must define GC_DEBUG and use debug alloc. in clients.") + AC_DEFINE(KEEP_BACK_PTRS) + AC_DEFINE(DBG_HDRS_ALL) + case $host in + ia64-*-linux* ) + AC_DEFINE(MAKE_BACK_GRAPH) + ;; + x86-*-linux* | i586-*-linux* | i686-*-linux* ) + AC_DEFINE(MAKE_BACK_GRAPH) + AC_MSG_WARN("Client must not use -fomit-frame-pointer.") + AC_DEFINE(SAVE_CALL_COUNT, 8) + ;; + esac ] + fi) + AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host") if test "${multilib}" = "yes"; then *************** else *** 179,193 **** multilib_arg= fi ! AC_OUTPUT(Makefile, ! [ ! dnl Put all the -D options in a file. These are required before ! dnl boehm-config.h can be included. This is a huge hack brought ! dnl about by overall poor structuring of this entire library. echo "$DEFS" > boehm-cflags if test -n "$CONFIG_FILES"; then ! ac_file=Makefile . ${boehm_gc_basedir}/../config-ml.in fi], srcdir=${srcdir} host=${host} --- 273,285 ---- multilib_arg= fi ! AC_OUTPUT(Makefile include/Makefile, [ ! dnl Put all the -D options in a file. echo "$DEFS" > boehm-cflags if test -n "$CONFIG_FILES"; then ! LD="${ORIGINAL_LD_FOR_MULTILIBS}" ! ac_file=Makefile . ${gc_basedir}/../config-ml.in fi], srcdir=${srcdir} host=${host} *************** target=${target} *** 195,201 **** with_multisubdir=${with_multisubdir} ac_configure_args="${multilib_arg} ${ac_configure_args}" CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} ! boehm_gc_basedir=${boehm_gc_basedir} CC="${CC}" DEFS="$DEFS" ) --- 287,293 ---- with_multisubdir=${with_multisubdir} ac_configure_args="${multilib_arg} ${ac_configure_args}" CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} ! gc_basedir=${gc_basedir} CC="${CC}" DEFS="$DEFS" ) diff -Nrc3pad gcc-3.0.4/boehm-gc/cord/README gcc-3.1/boehm-gc/cord/README *** gcc-3.0.4/boehm-gc/cord/README Wed Apr 7 14:56:06 1999 --- gcc-3.1/boehm-gc/cord/README Thu Jan 1 00:00:00 1970 *************** *** 1,31 **** - Copyright (c) 1993-1994 by Xerox Corporation. All rights reserved. - - THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - - Permission is hereby granted to use or copy this program - for any purpose, provided the above notices are retained on all copies. - Permission to modify the code and to distribute modified code is granted, - provided the above notices are retained, and a notice that the code was - modified is included with the above copyright notice. - - Please send bug reports to Hans-J. Boehm (boehm@sgi.com). - - This is a string packages that uses a tree-based representation. - See cord.h for a description of the functions provided. Ec.h describes - "extensible cords", which are essentially output streams that write - to a cord. These allow for efficient construction of cords without - requiring a bound on the size of a cord. - - de.c is a very dumb text editor that illustrates the use of cords. - It maintains a list of file versions. Each version is simply a - cord representing the file contents. Nonetheless, standard - editing operations are efficient, even on very large files. - (Its 3 line "user manual" can be obtained by invoking it without - arguments. Note that ^R^N and ^R^P move the cursor by - almost a screen. It does not understand tabs, which will show - up as highlighred "I"s. Use the UNIX "expand" program first.) - To build the editor, type "make cord/de" in the gc directory. - - This package assumes an ANSI C compiler such as gcc. It will - not compile with an old-style K&R compiler. --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/cord/SCOPTIONS.amiga gcc-3.1/boehm-gc/cord/SCOPTIONS.amiga *** gcc-3.0.4/boehm-gc/cord/SCOPTIONS.amiga Wed Apr 7 14:56:06 1999 --- gcc-3.1/boehm-gc/cord/SCOPTIONS.amiga Thu Jan 1 00:00:00 1970 *************** *** 1,14 **** - MATH=STANDARD - CPU=68030 - NOSTACKCHECK - OPTIMIZE - VERBOSE - NOVERSION - NOICONS - OPTIMIZERTIME - INCLUDEDIR=/ - DEFINE AMIGA - LIBRARY=cord.lib - LIBRARY=/gc.lib - IGNORE=100 - IGNORE=161 --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/cord/SMakefile.amiga gcc-3.1/boehm-gc/cord/SMakefile.amiga *** gcc-3.0.4/boehm-gc/cord/SMakefile.amiga Wed Apr 7 14:56:06 1999 --- gcc-3.1/boehm-gc/cord/SMakefile.amiga Thu Jan 1 00:00:00 1970 *************** *** 1,20 **** - # Makefile for cord.lib - # Michel Schinz 1994/07/20 - - OBJS = cordbscs.o cordprnt.o cordxtra.o - - all: cord.lib cordtest - - cordbscs.o: cordbscs.c - cordprnt.o: cordprnt.c - cordxtra.o: cordxtra.c - cordtest.o: cordtest.c - - cord.lib: $(OBJS) - oml cord.lib r $(OBJS) - - cordtest: cordtest.o cord.lib - sc cordtest.o link - - clean: - delete cord.lib cordtest \#?.o \#?.lnk --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/cord/cord.h gcc-3.1/boehm-gc/cord/cord.h *** gcc-3.0.4/boehm-gc/cord/cord.h Mon Nov 1 20:48:52 1999 --- gcc-3.1/boehm-gc/cord/cord.h Thu Jan 1 00:00:00 1970 *************** *** 1,327 **** - /* - * Copyright (c) 1993-1994 by Xerox Corporation. All rights reserved. - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - * - * Author: Hans-J. Boehm (boehm@parc.xerox.com) - */ - /* Boehm, October 5, 1995 4:20 pm PDT */ - - /* - * Cords are immutable character strings. A number of operations - * on long cords are much more efficient than their strings.h counterpart. - * In particular, concatenation takes constant time independent of the length - * of the arguments. (Cords are represented as trees, with internal - * nodes representing concatenation and leaves consisting of either C - * strings or a functional description of the string.) - * - * The following are reasonable applications of cords. They would perform - * unacceptably if C strings were used: - * - A compiler that produces assembly language output by repeatedly - * concatenating instructions onto a cord representing the output file. - * - A text editor that converts the input file to a cord, and then - * performs editing operations by producing a new cord representing - * the file after echa character change (and keeping the old ones in an - * edit history) - * - * For optimal performance, cords should be built by - * concatenating short sections. - * This interface is designed for maximum compatibility with C strings. - * ASCII NUL characters may be embedded in cords using CORD_from_fn. - * This is handled correctly, but CORD_to_char_star will produce a string - * with embedded NULs when given such a cord. - * - * This interface is fairly big, largely for performance reasons. - * The most basic constants and functions: - * - * CORD - the type of a cord; - * CORD_EMPTY - empty cord; - * CORD_len(cord) - length of a cord; - * CORD_cat(cord1,cord2) - concatenation of two cords; - * CORD_substr(cord, start, len) - substring (or subcord); - * CORD_pos i; CORD_FOR(i, cord) { ... CORD_pos_fetch(i) ... } - - * examine each character in a cord. CORD_pos_fetch(i) is the char. - * CORD_fetch(int i) - Retrieve i'th character (slowly). - * CORD_cmp(cord1, cord2) - compare two cords. - * CORD_from_file(FILE * f) - turn a read-only file into a cord. - * CORD_to_char_star(cord) - convert to C string. - * (Non-NULL C constant strings are cords.) - * CORD_printf (etc.) - cord version of printf. Use %r for cords. - */ - # ifndef CORD_H - - # define CORD_H - # include - # include - /* Cords have type const char *. This is cheating quite a bit, and not */ - /* 100% portable. But it means that nonempty character string */ - /* constants may be used as cords directly, provided the string is */ - /* never modified in place. The empty cord is represented by, and */ - /* can be written as, 0. */ - - typedef const char * CORD; - - /* An empty cord is always represented as nil */ - # define CORD_EMPTY 0 - - /* Is a nonempty cord represented as a C string? */ - #define CORD_IS_STRING(s) (*(s) != '\0') - - /* Concatenate two cords. If the arguments are C strings, they may */ - /* not be subsequently altered. */ - CORD CORD_cat(CORD x, CORD y); - - /* Concatenate a cord and a C string with known length. Except for the */ - /* empty string case, this is a special case of CORD_cat. Since the */ - /* length is known, it can be faster. */ - /* The string y is shared with the resulting CORD. Hence it should */ - /* not be altered by the caller. */ - CORD CORD_cat_char_star(CORD x, const char * y, size_t leny); - - /* Compute the length of a cord */ - size_t CORD_len(CORD x); - - /* Cords may be represented by functions defining the ith character */ - typedef char (* CORD_fn)(size_t i, void * client_data); - - /* Turn a functional description into a cord. */ - CORD CORD_from_fn(CORD_fn fn, void * client_data, size_t len); - - /* Return the substring (subcord really) of x with length at most n, */ - /* starting at position i. (The initial character has position 0.) */ - CORD CORD_substr(CORD x, size_t i, size_t n); - - /* Return the argument, but rebalanced to allow more efficient */ - /* character retrieval, substring operations, and comparisons. */ - /* This is useful only for cords that were built using repeated */ - /* concatenation. Guarantees log time access to the result, unless */ - /* x was obtained through a large number of repeated substring ops */ - /* or the embedded functional descriptions take longer to evaluate. */ - /* May reallocate significant parts of the cord. The argument is not */ - /* modified; only the result is balanced. */ - CORD CORD_balance(CORD x); - - /* The following traverse a cord by applying a function to each */ - /* character. This is occasionally appropriate, especially where */ - /* speed is crucial. But, since C doesn't have nested functions, */ - /* clients of this sort of traversal are clumsy to write. Consider */ - /* the functions that operate on cord positions instead. */ - - /* Function to iteratively apply to individual characters in cord. */ - typedef int (* CORD_iter_fn)(char c, void * client_data); - - /* Function to apply to substrings of a cord. Each substring is a */ - /* a C character string, not a general cord. */ - typedef int (* CORD_batched_iter_fn)(const char * s, void * client_data); - # define CORD_NO_FN ((CORD_batched_iter_fn)0) - - /* Apply f1 to each character in the cord, in ascending order, */ - /* starting at position i. If */ - /* f2 is not CORD_NO_FN, then multiple calls to f1 may be replaced by */ - /* a single call to f2. The parameter f2 is provided only to allow */ - /* some optimization by the client. This terminates when the right */ - /* end of this string is reached, or when f1 or f2 return != 0. In the */ - /* latter case CORD_iter returns != 0. Otherwise it returns 0. */ - /* The specified value of i must be < CORD_len(x). */ - int CORD_iter5(CORD x, size_t i, CORD_iter_fn f1, - CORD_batched_iter_fn f2, void * client_data); - - /* A simpler version that starts at 0, and without f2: */ - int CORD_iter(CORD x, CORD_iter_fn f1, void * client_data); - # define CORD_iter(x, f1, cd) CORD_iter5(x, 0, f1, CORD_NO_FN, cd) - - /* Similar to CORD_iter5, but end-to-beginning. No provisions for */ - /* CORD_batched_iter_fn. */ - int CORD_riter4(CORD x, size_t i, CORD_iter_fn f1, void * client_data); - - /* A simpler version that starts at the end: */ - int CORD_riter(CORD x, CORD_iter_fn f1, void * client_data); - - /* Functions that operate on cord positions. The easy way to traverse */ - /* cords. A cord position is logically a pair consisting of a cord */ - /* and an index into that cord. But it is much faster to retrieve a */ - /* charcter based on a position than on an index. Unfortunately, */ - /* positions are big (order of a few 100 bytes), so allocate them with */ - /* caution. */ - /* Things in cord_pos.h should be treated as opaque, except as */ - /* described below. Also note that */ - /* CORD_pos_fetch, CORD_next and CORD_prev have both macro and function */ - /* definitions. The former may evaluate their argument more than once. */ - # include "private/cord_pos.h" - - /* - Visible definitions from above: - - typedef CORD_pos[1]; - - * Extract the cord from a position: - CORD CORD_pos_to_cord(CORD_pos p); - - * Extract the current index from a position: - size_t CORD_pos_to_index(CORD_pos p); - - * Fetch the character located at the given position: - char CORD_pos_fetch(CORD_pos p); - - * Initialize the position to refer to the given cord and index. - * Note that this is the most expensive function on positions: - void CORD_set_pos(CORD_pos p, CORD x, size_t i); - - * Advance the position to the next character. - * P must be initialized and valid. - * Invalidates p if past end: - void CORD_next(CORD_pos p); - - * Move the position to the preceding character. - * P must be initialized and valid. - * Invalidates p if past beginning: - void CORD_prev(CORD_pos p); - - * Is the position valid, i.e. inside the cord? - int CORD_pos_valid(CORD_pos p); - */ - # define CORD_FOR(pos, cord) \ - for (CORD_set_pos(pos, cord, 0); CORD_pos_valid(pos); CORD_next(pos)) - - - /* An out of memory handler to call. May be supplied by client. */ - /* Must not return. */ - extern void (* CORD_oom_fn)(void); - - /* Dump the representation of x to stdout in an implementation defined */ - /* manner. Intended for debugging only. */ - void CORD_dump(CORD x); - - /* The following could easily be implemented by the client. They are */ - /* provided in cordxtra.c for convenience. */ - - /* Concatenate a character to the end of a cord. */ - CORD CORD_cat_char(CORD x, char c); - - /* Concatenate n cords. */ - CORD CORD_catn(int n, /* CORD */ ...); - - /* Return the character in CORD_substr(x, i, 1) */ - char CORD_fetch(CORD x, size_t i); - - /* Return < 0, 0, or > 0, depending on whether x < y, x = y, x > y */ - int CORD_cmp(CORD x, CORD y); - - /* A generalization that takes both starting positions for the */ - /* comparison, and a limit on the number of characters to be compared. */ - int CORD_ncmp(CORD x, size_t x_start, CORD y, size_t y_start, size_t len); - - /* Find the first occurrence of s in x at position start or later. */ - /* Return the position of the first character of s in x, or */ - /* CORD_NOT_FOUND if there is none. */ - size_t CORD_str(CORD x, size_t start, CORD s); - - /* Return a cord consisting of i copies of (possibly NUL) c. Dangerous */ - /* in conjunction with CORD_to_char_star. */ - /* The resulting representation takes constant space, independent of i. */ - CORD CORD_chars(char c, size_t i); - # define CORD_nul(i) CORD_chars('\0', (i)) - - /* Turn a file into cord. The file must be seekable. Its contents */ - /* must remain constant. The file may be accessed as an immediate */ - /* result of this call and/or as a result of subsequent accesses to */ - /* the cord. Short files are likely to be immediately read, but */ - /* long files are likely to be read on demand, possibly relying on */ - /* stdio for buffering. */ - /* We must have exclusive access to the descriptor f, i.e. we may */ - /* read it at any time, and expect the file pointer to be */ - /* where we left it. Normally this should be invoked as */ - /* CORD_from_file(fopen(...)) */ - /* CORD_from_file arranges to close the file descriptor when it is no */ - /* longer needed (e.g. when the result becomes inaccessible). */ - /* The file f must be such that ftell reflects the actual character */ - /* position in the file, i.e. the number of characters that can be */ - /* or were read with fread. On UNIX systems this is always true. On */ - /* MS Windows systems, f must be opened in binary mode. */ - CORD CORD_from_file(FILE * f); - - /* Equivalent to the above, except that the entire file will be read */ - /* and the file pointer will be closed immediately. */ - /* The binary mode restriction from above does not apply. */ - CORD CORD_from_file_eager(FILE * f); - - /* Equivalent to the above, except that the file will be read on demand.*/ - /* The binary mode restriction applies. */ - CORD CORD_from_file_lazy(FILE * f); - - /* Turn a cord into a C string. The result shares no structure with */ - /* x, and is thus modifiable. */ - char * CORD_to_char_star(CORD x); - - /* Turn a C string into a CORD. The C string is copied, and so may */ - /* subsequently be modified. */ - CORD CORD_from_char_star(const char *s); - - /* Identical to the above, but the result may share structure with */ - /* the argument and is thus not modifiable. */ - const char * CORD_to_const_char_star(CORD x); - - /* Write a cord to a file, starting at the current position. No */ - /* trailing NULs are newlines are added. */ - /* Returns EOF if a write error occurs, 1 otherwise. */ - int CORD_put(CORD x, FILE * f); - - /* "Not found" result for the following two functions. */ - # define CORD_NOT_FOUND ((size_t)(-1)) - - /* A vague analog of strchr. Returns the position (an integer, not */ - /* a pointer) of the first occurrence of (char) c inside x at position */ - /* i or later. The value i must be < CORD_len(x). */ - size_t CORD_chr(CORD x, size_t i, int c); - - /* A vague analog of strrchr. Returns index of the last occurrence */ - /* of (char) c inside x at position i or earlier. The value i */ - /* must be < CORD_len(x). */ - size_t CORD_rchr(CORD x, size_t i, int c); - - - /* The following are also not primitive, but are implemented in */ - /* cordprnt.c. They provide functionality similar to the ANSI C */ - /* functions with corresponding names, but with the following */ - /* additions and changes: */ - /* 1. A %r conversion specification specifies a CORD argument. Field */ - /* width, precision, etc. have the same semantics as for %s. */ - /* (Note that %c,%C, and %S were already taken.) */ - /* 2. The format string is represented as a CORD. */ - /* 3. CORD_sprintf and CORD_vsprintf assign the result through the 1st */ /* argument. Unlike their ANSI C versions, there is no need to guess */ - /* the correct buffer size. */ - /* 4. Most of the conversions are implement through the native */ - /* vsprintf. Hence they are usually no faster, and */ - /* idiosyncracies of the native printf are preserved. However, */ - /* CORD arguments to CORD_sprintf and CORD_vsprintf are NOT copied; */ - /* the result shares the original structure. This may make them */ - /* very efficient in some unusual applications. */ - /* The format string is copied. */ - /* All functions return the number of characters generated or -1 on */ - /* error. This complies with the ANSI standard, but is inconsistent */ - /* with some older implementations of sprintf. */ - - /* The implementation of these is probably less portable than the rest */ - /* of this package. */ - - #ifndef CORD_NO_IO - - #include - - int CORD_sprintf(CORD * out, CORD format, ...); - int CORD_vsprintf(CORD * out, CORD format, va_list args); - int CORD_fprintf(FILE * f, CORD format, ...); - int CORD_vfprintf(FILE * f, CORD format, va_list args); - int CORD_printf(CORD format, ...); - int CORD_vprintf(CORD format, va_list args); - - #endif /* CORD_NO_IO */ - - # endif /* CORD_H */ --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/cord/cordtest.c gcc-3.1/boehm-gc/cord/cordtest.c *** gcc-3.0.4/boehm-gc/cord/cordtest.c Wed Apr 7 14:56:06 1999 --- gcc-3.1/boehm-gc/cord/cordtest.c Fri Aug 17 18:30:48 2001 *************** *** 14,19 **** --- 14,20 ---- # include "cord.h" # include # include + # include /* This is a very incomplete test of the cord package. It knows about */ /* a few internals of the package (e.g. when C strings are returned) */ /* that real clients shouldn't rely on. */ diff -Nrc3pad gcc-3.0.4/boehm-gc/cord/ec.h gcc-3.1/boehm-gc/cord/ec.h *** gcc-3.0.4/boehm-gc/cord/ec.h Wed Apr 7 14:56:06 1999 --- gcc-3.1/boehm-gc/cord/ec.h Thu Jan 1 00:00:00 1970 *************** *** 1,70 **** - # ifndef EC_H - # define EC_H - - # ifndef CORD_H - # include "cord.h" - # endif - - /* Extensible cords are strings that may be destructively appended to. */ - /* They allow fast construction of cords from characters that are */ - /* being read from a stream. */ - /* - * A client might look like: - * - * { - * CORD_ec x; - * CORD result; - * char c; - * FILE *f; - * - * ... - * CORD_ec_init(x); - * while(...) { - * c = getc(f); - * ... - * CORD_ec_append(x, c); - * } - * result = CORD_balance(CORD_ec_to_cord(x)); - * - * If a C string is desired as the final result, the call to CORD_balance - * may be replaced by a call to CORD_to_char_star. - */ - - # ifndef CORD_BUFSZ - # define CORD_BUFSZ 128 - # endif - - typedef struct CORD_ec_struct { - CORD ec_cord; - char * ec_bufptr; - char ec_buf[CORD_BUFSZ+1]; - } CORD_ec[1]; - - /* This structure represents the concatenation of ec_cord with */ - /* ec_buf[0 ... (ec_bufptr-ec_buf-1)] */ - - /* Flush the buffer part of the extended chord into ec_cord. */ - /* Note that this is almost the only real function, and it is */ - /* implemented in 6 lines in cordxtra.c */ - void CORD_ec_flush_buf(CORD_ec x); - - /* Convert an extensible cord to a cord. */ - # define CORD_ec_to_cord(x) (CORD_ec_flush_buf(x), (x)[0].ec_cord) - - /* Initialize an extensible cord. */ - # define CORD_ec_init(x) ((x)[0].ec_cord = 0, (x)[0].ec_bufptr = (x)[0].ec_buf) - - /* Append a character to an extensible cord. */ - # define CORD_ec_append(x, c) \ - { \ - if ((x)[0].ec_bufptr == (x)[0].ec_buf + CORD_BUFSZ) { \ - CORD_ec_flush_buf(x); \ - } \ - *((x)[0].ec_bufptr)++ = (c); \ - } - - /* Append a cord to an extensible cord. Structure remains shared with */ - /* original. */ - void CORD_ec_append_cord(CORD_ec x, CORD s); - - # endif /* EC_H */ --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/cord/gc.h gcc-3.1/boehm-gc/cord/gc.h *** gcc-3.0.4/boehm-gc/cord/gc.h Mon Jun 19 23:41:59 2000 --- gcc-3.1/boehm-gc/cord/gc.h Thu Jan 1 00:00:00 1970 *************** *** 1,804 **** - /* - * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers - * Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved. - * Copyright 1996-1999 by Silicon Graphics. All rights reserved. - * Copyright 1999 by Hewlett-Packard Company. All rights reserved. - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - */ - - /* - * Note that this defines a large number of tuning hooks, which can - * safely be ignored in nearly all cases. For normal use it suffices - * to call only GC_MALLOC and perhaps GC_REALLOC. - * For better performance, also look at GC_MALLOC_ATOMIC, and - * GC_enable_incremental. If you need an action to be performed - * immediately before an object is collected, look at GC_register_finalizer. - * If you are using Solaris threads, look at the end of this file. - * Everything else is best ignored unless you encounter performance - * problems. - */ - - #ifndef _GC_H - - # define _GC_H - # define __GC - # include - - #if defined(__CYGWIN32__) && defined(GC_USE_DLL) - #include "libgc_globals.h" - #endif - - #if defined(__MINGW32__) && defined(WIN32_THREADS) - # ifdef GC_BUILD - # define GC_API __declspec(dllexport) - # else - # define GC_API __declspec(dllimport) - # endif - #endif - - #if defined(_MSC_VER) && defined(_DLL) - # ifdef GC_BUILD - # define GC_API __declspec(dllexport) - # else - # define GC_API __declspec(dllimport) - # endif - #endif - - #if defined(__WATCOMC__) && defined(GC_DLL) - # ifdef GC_BUILD - # define GC_API extern __declspec(dllexport) - # else - # define GC_API extern __declspec(dllimport) - # endif - #endif - - #ifndef GC_API - #define GC_API extern - #endif - - # if defined(__STDC__) || defined(__cplusplus) - # define GC_PROTO(args) args - typedef void * GC_PTR; - # define GC_CONST const - # else - # define GC_PROTO(args) () - typedef char * GC_PTR; - # define GC_CONST - # endif - - # ifdef __cplusplus - extern "C" { - # endif - - - /* Define word and signed_word to be unsigned and signed types of the */ - /* size as char * or void *. There seems to be no way to do this */ - /* even semi-portably. The following is probably no better/worse */ - /* than almost anything else. */ - /* The ANSI standard suggests that size_t and ptr_diff_t might be */ - /* better choices. But those appear to have incorrect definitions */ - /* on may systems. Notably "typedef int size_t" seems to be both */ - /* frequent and WRONG. */ - typedef unsigned long GC_word; - typedef long GC_signed_word; - - /* Public read-only variables */ - - GC_API GC_word GC_gc_no;/* Counter incremented per collection. */ - /* Includes empty GCs at startup. */ - - - /* Public R/W variables */ - - GC_API GC_PTR (*GC_oom_fn) GC_PROTO((size_t bytes_requested)); - /* When there is insufficient memory to satisfy */ - /* an allocation request, we return */ - /* (*GC_oom_fn)(). By default this just */ - /* returns 0. */ - /* If it returns, it must return 0 or a valid */ - /* pointer to a previously allocated heap */ - /* object. */ - - GC_API int GC_find_leak; - /* Do not actually garbage collect, but simply */ - /* report inaccessible memory that was not */ - /* deallocated with GC_free. Initial value */ - /* is determined by FIND_LEAK macro. */ - - GC_API int GC_quiet; /* Disable statistics output. Only matters if */ - /* collector has been compiled with statistics */ - /* enabled. This involves a performance cost, */ - /* and is thus not the default. */ - - GC_API int GC_finalize_on_demand; - /* If nonzero, finalizers will only be run in */ - /* response to an eplit GC_invoke_finalizers */ - /* call. The default is determined by whether */ - /* the FINALIZE_ON_DEMAND macro is defined */ - /* when the collector is built. */ - - GC_API int GC_java_finalization; - /* Mark objects reachable from finalizable */ - /* objects in a separate postpass. This makes */ - /* it a bit safer to use non-topologically- */ - /* ordered finalization. Default value is */ - /* determined by JAVA_FINALIZATION macro. */ - - GC_API int GC_dont_gc; /* Dont collect unless explicitly requested, e.g. */ - /* because it's not safe. */ - - GC_API int GC_dont_expand; - /* Dont expand heap unless explicitly requested */ - /* or forced to. */ - - GC_API int GC_use_entire_heap; - /* Causes the nonincremental collector to use the */ - /* entire heap before collecting. This was the only */ - /* option for GC versions < 5.0. This sometimes */ - /* results in more large block fragmentation, since */ - /* very larg blocks will tend to get broken up */ - /* during each GC cycle. It is likely to result in a */ - /* larger working set, but lower collection */ - /* frequencies, and hence fewer instructions executed */ - /* in the collector. */ - - GC_API int GC_full_freq; /* Number of partial collections between */ - /* full collections. Matters only if */ - /* GC_incremental is set. */ - /* Full collections are also triggered if */ - /* the collector detects a substantial */ - /* increase in the number of in-use heap */ - /* blocks. Values in the tens are now */ - /* perfectly reasonable, unlike for */ - /* earlier GC versions. */ - - GC_API GC_word GC_non_gc_bytes; - /* Bytes not considered candidates for collection. */ - /* Used only to control scheduling of collections. */ - - GC_API GC_word GC_free_space_divisor; - /* We try to make sure that we allocate at */ - /* least N/GC_free_space_divisor bytes between */ - /* collections, where N is the heap size plus */ - /* a rough estimate of the root set size. */ - /* Initially, GC_free_space_divisor = 4. */ - /* Increasing its value will use less space */ - /* but more collection time. Decreasing it */ - /* will appreciably decrease collection time */ - /* at the expense of space. */ - /* GC_free_space_divisor = 1 will effectively */ - /* disable collections. */ - - GC_API GC_word GC_max_retries; - /* The maximum number of GCs attempted before */ - /* reporting out of memory after heap */ - /* expansion fails. Initially 0. */ - - - GC_API char *GC_stackbottom; /* Cool end of user stack. */ - /* May be set in the client prior to */ - /* calling any GC_ routines. This */ - /* avoids some overhead, and */ - /* potentially some signals that can */ - /* confuse debuggers. Otherwise the */ - /* collector attempts to set it */ - /* automatically. */ - /* For multithreaded code, this is the */ - /* cold end of the stack for the */ - /* primordial thread. */ - - /* Public procedures */ - /* - * general purpose allocation routines, with roughly malloc calling conv. - * The atomic versions promise that no relevant pointers are contained - * in the object. The nonatomic versions guarantee that the new object - * is cleared. GC_malloc_stubborn promises that no changes to the object - * will occur after GC_end_stubborn_change has been called on the - * result of GC_malloc_stubborn. GC_malloc_uncollectable allocates an object - * that is scanned for pointers to collectable objects, but is not itself - * collectable. GC_malloc_uncollectable and GC_free called on the resulting - * object implicitly update GC_non_gc_bytes appropriately. - */ - GC_API GC_PTR GC_malloc GC_PROTO((size_t size_in_bytes)); - GC_API GC_PTR GC_malloc_atomic GC_PROTO((size_t size_in_bytes)); - GC_API GC_PTR GC_malloc_uncollectable GC_PROTO((size_t size_in_bytes)); - GC_API GC_PTR GC_malloc_stubborn GC_PROTO((size_t size_in_bytes)); - - /* The following is only defined if the library has been suitably */ - /* compiled: */ - GC_API GC_PTR GC_malloc_atomic_uncollectable GC_PROTO((size_t size_in_bytes)); - - /* Explicitly deallocate an object. Dangerous if used incorrectly. */ - /* Requires a pointer to the base of an object. */ - /* If the argument is stubborn, it should not be changeable when freed. */ - /* An object should not be enable for finalization when it is */ - /* explicitly deallocated. */ - /* GC_free(0) is a no-op, as required by ANSI C for free. */ - GC_API void GC_free GC_PROTO((GC_PTR object_addr)); - - /* - * Stubborn objects may be changed only if the collector is explicitly informed. - * The collector is implicitly informed of coming change when such - * an object is first allocated. The following routines inform the - * collector that an object will no longer be changed, or that it will - * once again be changed. Only nonNIL pointer stores into the object - * are considered to be changes. The argument to GC_end_stubborn_change - * must be exacly the value returned by GC_malloc_stubborn or passed to - * GC_change_stubborn. (In the second case it may be an interior pointer - * within 512 bytes of the beginning of the objects.) - * There is a performance penalty for allowing more than - * one stubborn object to be changed at once, but it is acceptable to - * do so. The same applies to dropping stubborn objects that are still - * changeable. - */ - GC_API void GC_change_stubborn GC_PROTO((GC_PTR)); - GC_API void GC_end_stubborn_change GC_PROTO((GC_PTR)); - - /* Return a pointer to the base (lowest address) of an object given */ - /* a pointer to a location within the object. */ - /* Return 0 if displaced_pointer doesn't point to within a valid */ - /* object. */ - GC_API GC_PTR GC_base GC_PROTO((GC_PTR displaced_pointer)); - - /* Given a pointer to the base of an object, return its size in bytes. */ - /* The returned size may be slightly larger than what was originally */ - /* requested. */ - GC_API size_t GC_size GC_PROTO((GC_PTR object_addr)); - - /* For compatibility with C library. This is occasionally faster than */ - /* a malloc followed by a bcopy. But if you rely on that, either here */ - /* or with the standard C library, your code is broken. In my */ - /* opinion, it shouldn't have been invented, but now we're stuck. -HB */ - /* The resulting object has the same kind as the original. */ - /* If the argument is stubborn, the result will have changes enabled. */ - /* It is an error to have changes enabled for the original object. */ - /* Follows ANSI comventions for NULL old_object. */ - GC_API GC_PTR GC_realloc - GC_PROTO((GC_PTR old_object, size_t new_size_in_bytes)); - - /* Explicitly increase the heap size. */ - /* Returns 0 on failure, 1 on success. */ - GC_API int GC_expand_hp GC_PROTO((size_t number_of_bytes)); - - /* Limit the heap size to n bytes. Useful when you're debugging, */ - /* especially on systems that don't handle running out of memory well. */ - /* n == 0 ==> unbounded. This is the default. */ - GC_API void GC_set_max_heap_size GC_PROTO((GC_word n)); - - /* Inform the collector that a certain section of statically allocated */ - /* memory contains no pointers to garbage collected memory. Thus it */ - /* need not be scanned. This is sometimes important if the application */ - /* maps large read/write files into the address space, which could be */ - /* mistaken for dynamic library data segments on some systems. */ - GC_API void GC_exclude_static_roots GC_PROTO((GC_PTR start, GC_PTR finish)); - - /* Clear the set of root segments. Wizards only. */ - GC_API void GC_clear_roots GC_PROTO((void)); - - /* Add a root segment. Wizards only. */ - GC_API void GC_add_roots GC_PROTO((char * low_address, - char * high_address_plus_1)); - - /* Add a displacement to the set of those considered valid by the */ - /* collector. GC_register_displacement(n) means that if p was returned */ - /* by GC_malloc, then (char *)p + n will be considered to be a valid */ - /* pointer to n. N must be small and less than the size of p. */ - /* (All pointers to the interior of objects from the stack are */ - /* considered valid in any case. This applies to heap objects and */ - /* static data.) */ - /* Preferably, this should be called before any other GC procedures. */ - /* Calling it later adds to the probability of excess memory */ - /* retention. */ - /* This is a no-op if the collector was compiled with recognition of */ - /* arbitrary interior pointers enabled, which is now the default. */ - GC_API void GC_register_displacement GC_PROTO((GC_word n)); - - /* The following version should be used if any debugging allocation is */ - /* being done. */ - GC_API void GC_debug_register_displacement GC_PROTO((GC_word n)); - - /* Explicitly trigger a full, world-stop collection. */ - GC_API void GC_gcollect GC_PROTO((void)); - - /* Trigger a full world-stopped collection. Abort the collection if */ - /* and when stop_func returns a nonzero value. Stop_func will be */ - /* called frequently, and should be reasonably fast. This works even */ - /* if virtual dirty bits, and hence incremental collection is not */ - /* available for this architecture. Collections can be aborted faster */ - /* than normal pause times for incremental collection. However, */ - /* aborted collections do no useful work; the next collection needs */ - /* to start from the beginning. */ - /* Return 0 if the collection was aborted, 1 if it succeeded. */ - typedef int (* GC_stop_func) GC_PROTO((void)); - GC_API int GC_try_to_collect GC_PROTO((GC_stop_func stop_func)); - - /* Return the number of bytes in the heap. Excludes collector private */ - /* data structures. Includes empty blocks and fragmentation loss. */ - /* Includes some pages that were allocated but never written. */ - GC_API size_t GC_get_heap_size GC_PROTO((void)); - - /* Return a lower bound on the number of free bytes in the heap. */ - GC_API size_t GC_get_free_bytes GC_PROTO((void)); - - /* Return the number of bytes allocated since the last collection. */ - GC_API size_t GC_get_bytes_since_gc GC_PROTO((void)); - - /* Enable incremental/generational collection. */ - /* Not advisable unless dirty bits are */ - /* available or most heap objects are */ - /* pointerfree(atomic) or immutable. */ - /* Don't use in leak finding mode. */ - /* Ignored if GC_dont_gc is true. */ - GC_API void GC_enable_incremental GC_PROTO((void)); - - /* Perform some garbage collection work, if appropriate. */ - /* Return 0 if there is no more work to be done. */ - /* Typically performs an amount of work corresponding roughly */ - /* to marking from one page. May do more work if further */ - /* progress requires it, e.g. if incremental collection is */ - /* disabled. It is reasonable to call this in a wait loop */ - /* until it returns 0. */ - GC_API int GC_collect_a_little GC_PROTO((void)); - - /* Allocate an object of size lb bytes. The client guarantees that */ - /* as long as the object is live, it will be referenced by a pointer */ - /* that points to somewhere within the first 256 bytes of the object. */ - /* (This should normally be declared volatile to prevent the compiler */ - /* from invalidating this assertion.) This routine is only useful */ - /* if a large array is being allocated. It reduces the chance of */ - /* accidentally retaining such an array as a result of scanning an */ - /* integer that happens to be an address inside the array. (Actually, */ - /* it reduces the chance of the allocator not finding space for such */ - /* an array, since it will try hard to avoid introducing such a false */ - /* reference.) On a SunOS 4.X or MS Windows system this is recommended */ - /* for arrays likely to be larger than 100K or so. For other systems, */ - /* or if the collector is not configured to recognize all interior */ - /* pointers, the threshold is normally much higher. */ - GC_API GC_PTR GC_malloc_ignore_off_page GC_PROTO((size_t lb)); - GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb)); - - #if defined(__sgi) && !defined(__GNUC__) && _COMPILER_VERSION >= 720 - # define GC_ADD_CALLER - # define GC_RETURN_ADDR (GC_word)__return_address - #endif - - #ifdef GC_ADD_CALLER - # define GC_EXTRAS GC_RETURN_ADDR, __FILE__, __LINE__ - # define GC_EXTRA_PARAMS GC_word ra, GC_CONST char * s, int i - #else - # define GC_EXTRAS __FILE__, __LINE__ - # define GC_EXTRA_PARAMS GC_CONST char * s, int i - #endif - - /* Debugging (annotated) allocation. GC_gcollect will check */ - /* objects allocated in this way for overwrites, etc. */ - GC_API GC_PTR GC_debug_malloc - GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS)); - GC_API GC_PTR GC_debug_malloc_atomic - GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS)); - GC_API GC_PTR GC_debug_malloc_uncollectable - GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS)); - GC_API GC_PTR GC_debug_malloc_stubborn - GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS)); - GC_API void GC_debug_free GC_PROTO((GC_PTR object_addr)); - GC_API GC_PTR GC_debug_realloc - GC_PROTO((GC_PTR old_object, size_t new_size_in_bytes, - GC_EXTRA_PARAMS)); - - GC_API void GC_debug_change_stubborn GC_PROTO((GC_PTR)); - GC_API void GC_debug_end_stubborn_change GC_PROTO((GC_PTR)); - # ifdef GC_DEBUG - # define GC_MALLOC(sz) GC_debug_malloc(sz, GC_EXTRAS) - # define GC_MALLOC_ATOMIC(sz) GC_debug_malloc_atomic(sz, GC_EXTRAS) - # define GC_MALLOC_UNCOLLECTABLE(sz) GC_debug_malloc_uncollectable(sz, \ - GC_EXTRAS) - # define GC_REALLOC(old, sz) GC_debug_realloc(old, sz, GC_EXTRAS) - # define GC_FREE(p) GC_debug_free(p) - # define GC_REGISTER_FINALIZER(p, f, d, of, od) \ - GC_debug_register_finalizer(p, f, d, of, od) - # define GC_REGISTER_FINALIZER_IGNORE_SELF(p, f, d, of, od) \ - GC_debug_register_finalizer_ignore_self(p, f, d, of, od) - # define GC_REGISTER_FINALIZER_NO_ORDER(p, f, d, of, od) \ - GC_debug_register_finalizer_no_order(p, f, d, of, od) - # define GC_MALLOC_STUBBORN(sz) GC_debug_malloc_stubborn(sz, GC_EXTRAS); - # define GC_CHANGE_STUBBORN(p) GC_debug_change_stubborn(p) - # define GC_END_STUBBORN_CHANGE(p) GC_debug_end_stubborn_change(p) - # define GC_GENERAL_REGISTER_DISAPPEARING_LINK(link, obj) \ - GC_general_register_disappearing_link(link, GC_base(obj)) - # define GC_REGISTER_DISPLACEMENT(n) GC_debug_register_displacement(n) - # else - # define GC_MALLOC(sz) GC_malloc(sz) - # define GC_MALLOC_ATOMIC(sz) GC_malloc_atomic(sz) - # define GC_MALLOC_UNCOLLECTABLE(sz) GC_malloc_uncollectable(sz) - # define GC_REALLOC(old, sz) GC_realloc(old, sz) - # define GC_FREE(p) GC_free(p) - # define GC_REGISTER_FINALIZER(p, f, d, of, od) \ - GC_register_finalizer(p, f, d, of, od) - # define GC_REGISTER_FINALIZER_IGNORE_SELF(p, f, d, of, od) \ - GC_register_finalizer_ignore_self(p, f, d, of, od) - # define GC_REGISTER_FINALIZER_NO_ORDER(p, f, d, of, od) \ - GC_register_finalizer_no_order(p, f, d, of, od) - # define GC_MALLOC_STUBBORN(sz) GC_malloc_stubborn(sz) - # define GC_CHANGE_STUBBORN(p) GC_change_stubborn(p) - # define GC_END_STUBBORN_CHANGE(p) GC_end_stubborn_change(p) - # define GC_GENERAL_REGISTER_DISAPPEARING_LINK(link, obj) \ - GC_general_register_disappearing_link(link, obj) - # define GC_REGISTER_DISPLACEMENT(n) GC_register_displacement(n) - # endif - /* The following are included because they are often convenient, and */ - /* reduce the chance for a misspecifed size argument. But calls may */ - /* expand to something syntactically incorrect if t is a complicated */ - /* type expression. */ - # define GC_NEW(t) (t *)GC_MALLOC(sizeof (t)) - # define GC_NEW_ATOMIC(t) (t *)GC_MALLOC_ATOMIC(sizeof (t)) - # define GC_NEW_STUBBORN(t) (t *)GC_MALLOC_STUBBORN(sizeof (t)) - # define GC_NEW_UNCOLLECTABLE(t) (t *)GC_MALLOC_UNCOLLECTABLE(sizeof (t)) - - /* Finalization. Some of these primitives are grossly unsafe. */ - /* The idea is to make them both cheap, and sufficient to build */ - /* a safer layer, closer to PCedar finalization. */ - /* The interface represents my conclusions from a long discussion */ - /* with Alan Demers, Dan Greene, Carl Hauser, Barry Hayes, */ - /* Christian Jacobi, and Russ Atkinson. It's not perfect, and */ - /* probably nobody else agrees with it. Hans-J. Boehm 3/13/92 */ - typedef void (*GC_finalization_proc) - GC_PROTO((GC_PTR obj, GC_PTR client_data)); - - GC_API void GC_register_finalizer - GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, - GC_finalization_proc *ofn, GC_PTR *ocd)); - GC_API void GC_debug_register_finalizer - GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, - GC_finalization_proc *ofn, GC_PTR *ocd)); - /* When obj is no longer accessible, invoke */ - /* (*fn)(obj, cd). If a and b are inaccessible, and */ - /* a points to b (after disappearing links have been */ - /* made to disappear), then only a will be */ - /* finalized. (If this does not create any new */ - /* pointers to b, then b will be finalized after the */ - /* next collection.) Any finalizable object that */ - /* is reachable from itself by following one or more */ - /* pointers will not be finalized (or collected). */ - /* Thus cycles involving finalizable objects should */ - /* be avoided, or broken by disappearing links. */ - /* All but the last finalizer registered for an object */ - /* is ignored. */ - /* Finalization may be removed by passing 0 as fn. */ - /* Finalizers are implicitly unregistered just before */ - /* they are invoked. */ - /* The old finalizer and client data are stored in */ - /* *ofn and *ocd. */ - /* Fn is never invoked on an accessible object, */ - /* provided hidden pointers are converted to real */ - /* pointers only if the allocation lock is held, and */ - /* such conversions are not performed by finalization */ - /* routines. */ - /* If GC_register_finalizer is aborted as a result of */ - /* a signal, the object may be left with no */ - /* finalization, even if neither the old nor new */ - /* finalizer were NULL. */ - /* Obj should be the nonNULL starting address of an */ - /* object allocated by GC_malloc or friends. */ - /* Note that any garbage collectable object referenced */ - /* by cd will be considered accessible until the */ - /* finalizer is invoked. */ - - /* Another versions of the above follow. It ignores */ - /* self-cycles, i.e. pointers from a finalizable object to */ - /* itself. There is a stylistic argument that this is wrong, */ - /* but it's unavoidable for C++, since the compiler may */ - /* silently introduce these. It's also benign in that specific */ - /* case. */ - GC_API void GC_register_finalizer_ignore_self - GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, - GC_finalization_proc *ofn, GC_PTR *ocd)); - GC_API void GC_debug_register_finalizer_ignore_self - GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, - GC_finalization_proc *ofn, GC_PTR *ocd)); - - /* Another version of the above. It ignores all cycles. */ - /* It should probably only be used by Java implementations. */ - GC_API void GC_register_finalizer_no_order - GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, - GC_finalization_proc *ofn, GC_PTR *ocd)); - GC_API void GC_debug_register_finalizer_no_order - GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, - GC_finalization_proc *ofn, GC_PTR *ocd)); - - - /* The following routine may be used to break cycles between */ - /* finalizable objects, thus causing cyclic finalizable */ - /* objects to be finalized in the correct order. Standard */ - /* use involves calling GC_register_disappearing_link(&p), */ - /* where p is a pointer that is not followed by finalization */ - /* code, and should not be considered in determining */ - /* finalization order. */ - GC_API int GC_register_disappearing_link GC_PROTO((GC_PTR * /* link */)); - /* Link should point to a field of a heap allocated */ - /* object obj. *link will be cleared when obj is */ - /* found to be inaccessible. This happens BEFORE any */ - /* finalization code is invoked, and BEFORE any */ - /* decisions about finalization order are made. */ - /* This is useful in telling the finalizer that */ - /* some pointers are not essential for proper */ - /* finalization. This may avoid finalization cycles. */ - /* Note that obj may be resurrected by another */ - /* finalizer, and thus the clearing of *link may */ - /* be visible to non-finalization code. */ - /* There's an argument that an arbitrary action should */ - /* be allowed here, instead of just clearing a pointer. */ - /* But this causes problems if that action alters, or */ - /* examines connectivity. */ - /* Returns 1 if link was already registered, 0 */ - /* otherwise. */ - /* Only exists for backward compatibility. See below: */ - - GC_API int GC_general_register_disappearing_link - GC_PROTO((GC_PTR * /* link */, GC_PTR obj)); - /* A slight generalization of the above. *link is */ - /* cleared when obj first becomes inaccessible. This */ - /* can be used to implement weak pointers easily and */ - /* safely. Typically link will point to a location */ - /* holding a disguised pointer to obj. (A pointer */ - /* inside an "atomic" object is effectively */ - /* disguised.) In this way soft */ - /* pointers are broken before any object */ - /* reachable from them are finalized. Each link */ - /* May be registered only once, i.e. with one obj */ - /* value. This was added after a long email discussion */ - /* with John Ellis. */ - /* Obj must be a pointer to the first word of an object */ - /* we allocated. It is unsafe to explicitly deallocate */ - /* the object containing link. Explicitly deallocating */ - /* obj may or may not cause link to eventually be */ - /* cleared. */ - GC_API int GC_unregister_disappearing_link GC_PROTO((GC_PTR * /* link */)); - /* Returns 0 if link was not actually registered. */ - /* Undoes a registration by either of the above two */ - /* routines. */ - - /* Auxiliary fns to make finalization work correctly with displaced */ - /* pointers introduced by the debugging allocators. */ - GC_API GC_PTR GC_make_closure GC_PROTO((GC_finalization_proc fn, GC_PTR data)); - GC_API void GC_debug_invoke_finalizer GC_PROTO((GC_PTR obj, GC_PTR data)); - - /* Returns !=0 if GC_invoke_finalizers has something to do. */ - GC_API int GC_should_invoke_finalizers GC_PROTO((void)); - - GC_API int GC_invoke_finalizers GC_PROTO((void)); - /* Run finalizers for all objects that are ready to */ - /* be finalized. Return the number of finalizers */ - /* that were run. Normally this is also called */ - /* implicitly during some allocations. If */ - /* GC-finalize_on_demand is nonzero, it must be called */ - /* explicitly. */ - - /* GC_set_warn_proc can be used to redirect or filter warning messages. */ - /* p may not be a NULL pointer. */ - typedef void (*GC_warn_proc) GC_PROTO((char *msg, GC_word arg)); - GC_API GC_warn_proc GC_set_warn_proc GC_PROTO((GC_warn_proc p)); - /* Returns old warning procedure. */ - - /* The following is intended to be used by a higher level */ - /* (e.g. cedar-like) finalization facility. It is expected */ - /* that finalization code will arrange for hidden pointers to */ - /* disappear. Otherwise objects can be accessed after they */ - /* have been collected. */ - /* Note that putting pointers in atomic objects or in */ - /* nonpointer slots of "typed" objects is equivalent to */ - /* disguising them in this way, and may have other advantages. */ - # if defined(I_HIDE_POINTERS) || defined(GC_I_HIDE_POINTERS) - typedef GC_word GC_hidden_pointer; - # define HIDE_POINTER(p) (~(GC_hidden_pointer)(p)) - # define REVEAL_POINTER(p) ((GC_PTR)(HIDE_POINTER(p))) - /* Converting a hidden pointer to a real pointer requires verifying */ - /* that the object still exists. This involves acquiring the */ - /* allocator lock to avoid a race with the collector. */ - # endif /* I_HIDE_POINTERS */ - - typedef GC_PTR (*GC_fn_type) GC_PROTO((GC_PTR client_data)); - GC_API GC_PTR GC_call_with_alloc_lock - GC_PROTO((GC_fn_type fn, GC_PTR client_data)); - - /* Check that p and q point to the same object. */ - /* Fail conspicuously if they don't. */ - /* Returns the first argument. */ - /* Succeeds if neither p nor q points to the heap. */ - /* May succeed if both p and q point to between heap objects. */ - GC_API GC_PTR GC_same_obj GC_PROTO((GC_PTR p, GC_PTR q)); - - /* Checked pointer pre- and post- increment operations. Note that */ - /* the second argument is in units of bytes, not multiples of the */ - /* object size. This should either be invoked from a macro, or the */ - /* call should be automatically generated. */ - GC_API GC_PTR GC_pre_incr GC_PROTO((GC_PTR *p, size_t how_much)); - GC_API GC_PTR GC_post_incr GC_PROTO((GC_PTR *p, size_t how_much)); - - /* Check that p is visible */ - /* to the collector as a possibly pointer containing location. */ - /* If it isn't fail conspicuously. */ - /* Returns the argument in all cases. May erroneously succeed */ - /* in hard cases. (This is intended for debugging use with */ - /* untyped allocations. The idea is that it should be possible, though */ - /* slow, to add such a call to all indirect pointer stores.) */ - /* Currently useless for multithreaded worlds. */ - GC_API GC_PTR GC_is_visible GC_PROTO((GC_PTR p)); - - /* Check that if p is a pointer to a heap page, then it points to */ - /* a valid displacement within a heap object. */ - /* Fail conspicuously if this property does not hold. */ - /* Uninteresting with ALL_INTERIOR_POINTERS. */ - /* Always returns its argument. */ - GC_API GC_PTR GC_is_valid_displacement GC_PROTO((GC_PTR p)); - - /* Safer, but slow, pointer addition. Probably useful mainly with */ - /* a preprocessor. Useful only for heap pointers. */ - #ifdef GC_DEBUG - # define GC_PTR_ADD3(x, n, type_of_result) \ - ((type_of_result)GC_same_obj((x)+(n), (x))) - # define GC_PRE_INCR3(x, n, type_of_result) \ - ((type_of_result)GC_pre_incr(&(x), (n)*sizeof(*x)) - # define GC_POST_INCR2(x, type_of_result) \ - ((type_of_result)GC_post_incr(&(x), sizeof(*x)) - # ifdef __GNUC__ - # define GC_PTR_ADD(x, n) \ - GC_PTR_ADD3(x, n, typeof(x)) - # define GC_PRE_INCR(x, n) \ - GC_PRE_INCR3(x, n, typeof(x)) - # define GC_POST_INCR(x, n) \ - GC_POST_INCR3(x, typeof(x)) - # else - /* We can't do this right without typeof, which ANSI */ - /* decided was not sufficiently useful. Repeatedly */ - /* mentioning the arguments seems too dangerous to be */ - /* useful. So does not casting the result. */ - # define GC_PTR_ADD(x, n) ((x)+(n)) - # endif - #else /* !GC_DEBUG */ - # define GC_PTR_ADD3(x, n, type_of_result) ((x)+(n)) - # define GC_PTR_ADD(x, n) ((x)+(n)) - # define GC_PRE_INCR3(x, n, type_of_result) ((x) += (n)) - # define GC_PRE_INCR(x, n) ((x) += (n)) - # define GC_POST_INCR2(x, n, type_of_result) ((x)++) - # define GC_POST_INCR(x, n) ((x)++) - #endif - - /* Safer assignment of a pointer to a nonstack location. */ - #ifdef GC_DEBUG - # ifdef __STDC__ - # define GC_PTR_STORE(p, q) \ - (*(void **)GC_is_visible(p) = GC_is_valid_displacement(q)) - # else - # define GC_PTR_STORE(p, q) \ - (*(char **)GC_is_visible(p) = GC_is_valid_displacement(q)) - # endif - #else /* !GC_DEBUG */ - # define GC_PTR_STORE(p, q) *((p) = (q)) - #endif - - /* Fynctions called to report pointer checking errors */ - GC_API void (*GC_same_obj_print_proc) GC_PROTO((GC_PTR p, GC_PTR q)); - - GC_API void (*GC_is_valid_displacement_print_proc) - GC_PROTO((GC_PTR p)); - - GC_API void (*GC_is_visible_print_proc) - GC_PROTO((GC_PTR p)); - - #if defined(_SOLARIS_PTHREADS) && !defined(SOLARIS_THREADS) - # define SOLARIS_THREADS - #endif - - #ifdef SOLARIS_THREADS - /* We need to intercept calls to many of the threads primitives, so */ - /* that we can locate thread stacks and stop the world. */ - /* Note also that the collector cannot see thread specific data. */ - /* Thread specific data should generally consist of pointers to */ - /* uncollectable objects, which are deallocated using the destructor */ - /* facility in thr_keycreate. */ - # include - # include - int GC_thr_create(void *stack_base, size_t stack_size, - void *(*start_routine)(void *), void *arg, long flags, - thread_t *new_thread); - int GC_thr_join(thread_t wait_for, thread_t *departed, void **status); - int GC_thr_suspend(thread_t target_thread); - int GC_thr_continue(thread_t target_thread); - void * GC_dlopen(const char *path, int mode); - - # ifdef _SOLARIS_PTHREADS - # include - extern int GC_pthread_create(pthread_t *new_thread, - const pthread_attr_t *attr, - void * (*thread_execp)(void *), void *arg); - extern int GC_pthread_join(pthread_t wait_for, void **status); - - # undef thread_t - - # define pthread_join GC_pthread_join - # define pthread_create GC_pthread_create - #endif - - # define thr_create GC_thr_create - # define thr_join GC_thr_join - # define thr_suspend GC_thr_suspend - # define thr_continue GC_thr_continue - # define dlopen GC_dlopen - - # endif /* SOLARIS_THREADS */ - - - #if !defined(USE_LD_WRAP) && \ - (defined(IRIX_THREADS) || defined(LINUX_THREADS) || defined(HPUX_THREADS)) - /* We treat these similarly. */ - # include - # include - - int GC_pthread_create(pthread_t *new_thread, - const pthread_attr_t *attr, - void *(*start_routine)(void *), void *arg); - int GC_pthread_sigmask(int how, const sigset_t *set, sigset_t *oset); - int GC_pthread_join(pthread_t thread, void **retval); - - # define pthread_create GC_pthread_create - # define pthread_sigmask GC_pthread_sigmask - # define pthread_join GC_pthread_join - # define dlopen GC_dlopen - - #endif /* xxxxx_THREADS */ - - # if defined(PCR) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || \ - defined(IRIX_THREADS) || defined(LINUX_THREADS) || \ - defined(IRIX_JDK_THREADS) || defined(HPUX_THREADS) - /* Any flavor of threads except SRC_M3. */ - /* This returns a list of objects, linked through their first */ - /* word. Its use can greatly reduce lock contention problems, since */ - /* the allocation lock can be acquired and released many fewer times. */ - /* lb must be large enough to hold the pointer field. */ - GC_PTR GC_malloc_many(size_t lb); - #define GC_NEXT(p) (*(GC_PTR *)(p)) /* Retrieve the next element */ - /* in returned list. */ - extern void GC_thr_init(); /* Needed for Solaris/X86 */ - - #endif /* THREADS && !SRC_M3 */ - - /* - * If you are planning on putting - * the collector in a SunOS 5 dynamic library, you need to call GC_INIT() - * from the statically loaded program section. - * This circumvents a Solaris 2.X (X<=4) linker bug. - */ - #if defined(sparc) || defined(__sparc) - # define GC_INIT() { extern end, etext; \ - GC_noop(&end, &etext); } - #else - # if defined(__CYGWIN32__) && defined(GC_USE_DLL) - /* - * Similarly gnu-win32 DLLs need explicit initialization - */ - # define GC_INIT() { GC_add_roots(DATASTART, DATAEND); } - # else - # define GC_INIT() - # endif - #endif - - #if (defined(_MSDOS) || defined(_MSC_VER)) && (_M_IX86 >= 300) \ - || defined(_WIN32) - /* win32S may not free all resources on process exit. */ - /* This explicitly deallocates the heap. */ - GC_API void GC_win32_free_heap (); - #endif - - #ifdef __cplusplus - } /* end of extern "C" */ - #endif - - #endif /* _GC_H */ --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/cord/private/cord_pos.h gcc-3.1/boehm-gc/cord/private/cord_pos.h *** gcc-3.0.4/boehm-gc/cord/private/cord_pos.h Wed Apr 7 14:56:06 1999 --- gcc-3.1/boehm-gc/cord/private/cord_pos.h Thu Jan 1 00:00:00 1970 *************** *** 1,118 **** - /* - * Copyright (c) 1993-1994 by Xerox Corporation. All rights reserved. - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - */ - /* Boehm, May 19, 1994 2:23 pm PDT */ - # ifndef CORD_POSITION_H - - /* The representation of CORD_position. This is private to the */ - /* implementation, but the size is known to clients. Also */ - /* the implementation of some exported macros relies on it. */ - /* Don't use anything defined here and not in cord.h. */ - - # define MAX_DEPTH 48 - /* The maximum depth of a balanced cord + 1. */ - /* We don't let cords get deeper than MAX_DEPTH. */ - - struct CORD_pe { - CORD pe_cord; - size_t pe_start_pos; - }; - - /* A structure describing an entry on the path from the root */ - /* to current position. */ - typedef struct CORD_Pos { - size_t cur_pos; - int path_len; - # define CORD_POS_INVALID (0x55555555) - /* path_len == INVALID <==> position invalid */ - const char *cur_leaf; /* Current leaf, if it is a string. */ - /* If the current leaf is a function, */ - /* then this may point to function_buf */ - /* containing the next few characters. */ - /* Always points to a valid string */ - /* containing the current character */ - /* unless cur_end is 0. */ - size_t cur_start; /* Start position of cur_leaf */ - size_t cur_end; /* Ending position of cur_leaf */ - /* 0 if cur_leaf is invalid. */ - struct CORD_pe path[MAX_DEPTH + 1]; - /* path[path_len] is the leaf corresponding to cur_pos */ - /* path[0].pe_cord is the cord we point to. */ - # define FUNCTION_BUF_SZ 8 - char function_buf[FUNCTION_BUF_SZ]; /* Space for next few chars */ - /* from function node. */ - } CORD_pos[1]; - - /* Extract the cord from a position: */ - CORD CORD_pos_to_cord(CORD_pos p); - - /* Extract the current index from a position: */ - size_t CORD_pos_to_index(CORD_pos p); - - /* Fetch the character located at the given position: */ - char CORD_pos_fetch(CORD_pos p); - - /* Initialize the position to refer to the give cord and index. */ - /* Note that this is the most expensive function on positions: */ - void CORD_set_pos(CORD_pos p, CORD x, size_t i); - - /* Advance the position to the next character. */ - /* P must be initialized and valid. */ - /* Invalidates p if past end: */ - void CORD_next(CORD_pos p); - - /* Move the position to the preceding character. */ - /* P must be initialized and valid. */ - /* Invalidates p if past beginning: */ - void CORD_prev(CORD_pos p); - - /* Is the position valid, i.e. inside the cord? */ - int CORD_pos_valid(CORD_pos p); - - char CORD__pos_fetch(CORD_pos); - void CORD__next(CORD_pos); - void CORD__prev(CORD_pos); - - #define CORD_pos_fetch(p) \ - (((p)[0].cur_end != 0)? \ - (p)[0].cur_leaf[(p)[0].cur_pos - (p)[0].cur_start] \ - : CORD__pos_fetch(p)) - - #define CORD_next(p) \ - (((p)[0].cur_pos + 1 < (p)[0].cur_end)? \ - (p)[0].cur_pos++ \ - : (CORD__next(p), 0)) - - #define CORD_prev(p) \ - (((p)[0].cur_end != 0 && (p)[0].cur_pos > (p)[0].cur_start)? \ - (p)[0].cur_pos-- \ - : (CORD__prev(p), 0)) - - #define CORD_pos_to_index(p) ((p)[0].cur_pos) - - #define CORD_pos_to_cord(p) ((p)[0].path[0].pe_cord) - - #define CORD_pos_valid(p) ((p)[0].path_len != CORD_POS_INVALID) - - /* Some grubby stuff for performance-critical friends: */ - #define CORD_pos_chars_left(p) ((long)((p)[0].cur_end) - (long)((p)[0].cur_pos)) - /* Number of characters in cache. <= 0 ==> none */ - - #define CORD_pos_advance(p,n) ((p)[0].cur_pos += (n) - 1, CORD_next(p)) - /* Advance position by n characters */ - /* 0 < n < CORD_pos_chars_left(p) */ - - #define CORD_pos_cur_char_addr(p) \ - (p)[0].cur_leaf + ((p)[0].cur_pos - (p)[0].cur_start) - /* address of current character in cache. */ - - #endif --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/dbg_mlc.c gcc-3.1/boehm-gc/dbg_mlc.c *** gcc-3.0.4/boehm-gc/dbg_mlc.c Sun May 7 00:43:49 2000 --- gcc-3.1/boehm-gc/dbg_mlc.c Wed Feb 13 05:38:39 2002 *************** *** 2,8 **** * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers * Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved. * Copyright (c) 1997 by Silicon Graphics. All rights reserved. ! * Copyright (c) 1999 by Hewlett-Packard Company. All rights reserved. * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. --- 2,8 ---- * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers * Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved. * Copyright (c) 1997 by Silicon Graphics. All rights reserved. ! * Copyright (c) 1999-2000 by Hewlett-Packard Company. All rights reserved. * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. *************** *** 14,20 **** * modified is included with the above copyright notice. */ ! #include "dbg_mlc.h" void GC_default_print_heap_obj_proc(); GC_API void GC_register_finalizer_no_order --- 14,20 ---- * modified is included with the above copyright notice. */ ! #include "private/dbg_mlc.h" void GC_default_print_heap_obj_proc(); GC_API void GC_register_finalizer_no_order *************** GC_API void GC_register_finalizer_no_ord *** 22,31 **** GC_finalization_proc *ofn, GC_PTR *ocd)); /* Check whether object with base pointer p has debugging info */ /* p is assumed to point to a legitimate object in our part */ /* of the heap. */ ! GC_bool GC_has_debug_info(p) ptr_t p; { register oh * ohdr = (oh *)p; --- 22,38 ---- GC_finalization_proc *ofn, GC_PTR *ocd)); + #ifndef SHORT_DBG_HDRS /* Check whether object with base pointer p has debugging info */ /* p is assumed to point to a legitimate object in our part */ /* of the heap. */ ! /* This excludes the check as to whether the back pointer is */ ! /* odd, which is added by the GC_HAS_DEBUG_INFO macro. */ ! /* Note that if DBG_HDRS_ALL is set, uncollectable objects */ ! /* on free lists may not have debug information set. Thus it's */ ! /* not always safe to return TRUE, even if the client does */ ! /* its part. */ ! GC_bool GC_has_other_debug_info(p) ptr_t p; { register oh * ohdr = (oh *)p; *************** ptr_t p; *** 33,39 **** register word sz = GC_size((ptr_t) ohdr); if (HBLKPTR((ptr_t)ohdr) != HBLKPTR((ptr_t)body) ! || sz < sizeof (oh)) { return(FALSE); } if (ohdr -> oh_sz == sz) { --- 40,46 ---- register word sz = GC_size((ptr_t) ohdr); if (HBLKPTR((ptr_t)ohdr) != HBLKPTR((ptr_t)body) ! || sz < DEBUG_BYTES + EXTRA_BYTES) { return(FALSE); } if (ohdr -> oh_sz == sz) { *************** ptr_t p; *** 46,53 **** --- 53,71 ---- } return(FALSE); } + #endif #ifdef KEEP_BACK_PTRS + + # include + + # if defined(LINUX) || defined(SUNOS4) || defined(SUNOS5) \ + || defined(HPUX) || defined(IRIX) || defined(OSF1) + # define RANDOM() random() + # else + # define RANDOM() (long)rand() + # endif + /* Store back pointer to source in dest, if that appears to be possible. */ /* This is not completely safe, since we may mistakenly conclude that */ /* dest has a debugging wrapper. But the error probability is very */ *************** ptr_t p; *** 56,63 **** /* be a pointer to the interior of an object. */ void GC_store_back_pointer(ptr_t source, ptr_t dest) { ! if (GC_has_debug_info(dest)) { ! ((oh *)dest) -> oh_back_ptr = (ptr_t)HIDE_POINTER(source); } } --- 74,81 ---- /* be a pointer to the interior of an object. */ void GC_store_back_pointer(ptr_t source, ptr_t dest) { ! if (GC_HAS_DEBUG_INFO(dest)) { ! ((oh *)dest) -> oh_back_ptr = HIDE_BACK_PTR(source); } } *************** ptr_t p; *** 76,94 **** oh * hdr = (oh *)GC_base(dest); ptr_t bp; ptr_t bp_base; ! if (!GC_has_debug_info((ptr_t) hdr)) return GC_NO_SPACE; ! bp = hdr -> oh_back_ptr; if (MARKED_FOR_FINALIZATION == bp) return GC_FINALIZER_REFD; if (MARKED_FROM_REGISTER == bp) return GC_REFD_FROM_REG; ! if (0 == bp) return GC_UNREFERENCED; ! bp = REVEAL_POINTER(bp); bp_base = GC_base(bp); if (0 == bp_base) { *base_p = bp; *offset_p = 0; return GC_REFD_FROM_ROOT; } else { ! if (GC_has_debug_info(bp_base)) bp_base += sizeof(oh); *base_p = bp_base; *offset_p = bp - bp_base; return GC_REFD_FROM_HEAP; --- 94,127 ---- oh * hdr = (oh *)GC_base(dest); ptr_t bp; ptr_t bp_base; ! if (!GC_HAS_DEBUG_INFO((ptr_t) hdr)) return GC_NO_SPACE; ! bp = REVEAL_POINTER(hdr -> oh_back_ptr); if (MARKED_FOR_FINALIZATION == bp) return GC_FINALIZER_REFD; if (MARKED_FROM_REGISTER == bp) return GC_REFD_FROM_REG; ! if (NOT_MARKED == bp) return GC_UNREFERENCED; ! # if ALIGNMENT == 1 ! /* Heuristically try to fix off by 1 errors we introduced by */ ! /* insisting on even addresses. */ ! { ! ptr_t alternate_ptr = bp + 1; ! ptr_t target = *(ptr_t *)bp; ! ptr_t alternate_target = *(ptr_t *)alternate_ptr; ! ! if (alternate_target >= GC_least_plausible_heap_addr ! && alternate_target <= GC_greatest_plausible_heap_addr ! && (target < GC_least_plausible_heap_addr ! || target > GC_greatest_plausible_heap_addr)) { ! bp = alternate_ptr; ! } ! } ! # endif bp_base = GC_base(bp); if (0 == bp_base) { *base_p = bp; *offset_p = 0; return GC_REFD_FROM_ROOT; } else { ! if (GC_HAS_DEBUG_INFO(bp_base)) bp_base += sizeof(oh); *base_p = bp_base; *offset_p = bp - bp_base; return GC_REFD_FROM_HEAP; *************** ptr_t p; *** 101,107 **** void *GC_generate_random_heap_address(void) { int i; ! int heap_offset = random() % GC_heapsize; for (i = 0; i < GC_n_heap_sects; ++ i) { int size = GC_heap_sects[i].hs_bytes; if (heap_offset < size) { --- 134,148 ---- void *GC_generate_random_heap_address(void) { int i; ! long heap_offset = RANDOM(); ! if (GC_heapsize > RAND_MAX) { ! heap_offset *= RAND_MAX; ! heap_offset += RANDOM(); ! } ! heap_offset %= GC_heapsize; ! /* This doesn't yield a uniform distribution, especially if */ ! /* e.g. RAND_MAX = 1.5* GC_heapsize. But for typical cases, */ ! /* it's not too bad. */ for (i = 0; i < GC_n_heap_sects; ++ i) { int size = GC_heap_sects[i].hs_bytes; if (heap_offset < size) { *************** ptr_t p; *** 192,198 **** ptr_t GC_store_debug_info(p, sz, string, integer) register ptr_t p; /* base pointer */ word sz; /* bytes */ ! char * string; word integer; { register word * result = (word *)((oh *)p + 1); --- 233,239 ---- ptr_t GC_store_debug_info(p, sz, string, integer) register ptr_t p; /* base pointer */ word sz; /* bytes */ ! GC_CONST char * string; word integer; { register word * result = (word *)((oh *)p + 1); *************** word integer; *** 203,220 **** /* inconsistent while we're in the handler. */ LOCK(); # ifdef KEEP_BACK_PTRS ! ((oh *)p) -> oh_back_ptr = 0; # endif ((oh *)p) -> oh_string = string; ((oh *)p) -> oh_int = integer; ! ((oh *)p) -> oh_sz = sz; ! ((oh *)p) -> oh_sf = START_FLAG ^ (word)result; ! ((word *)p)[BYTES_TO_WORDS(GC_size(p))-1] = ! result[ROUNDED_UP_WORDS(sz)] = END_FLAG ^ (word)result; UNLOCK(); return((ptr_t)result); } /* Check the object with debugging info at ohdr */ /* return NIL if it's OK. Else return clobbered */ /* address. */ --- 244,299 ---- /* inconsistent while we're in the handler. */ LOCK(); # ifdef KEEP_BACK_PTRS ! ((oh *)p) -> oh_back_ptr = HIDE_BACK_PTR(NOT_MARKED); ! # endif ! # ifdef MAKE_BACK_GRAPH ! ((oh *)p) -> oh_bg_ptr = HIDE_BACK_PTR((ptr_t)0); # endif ((oh *)p) -> oh_string = string; ((oh *)p) -> oh_int = integer; ! # ifndef SHORT_DBG_HDRS ! ((oh *)p) -> oh_sz = sz; ! ((oh *)p) -> oh_sf = START_FLAG ^ (word)result; ! ((word *)p)[BYTES_TO_WORDS(GC_size(p))-1] = ! result[SIMPLE_ROUNDED_UP_WORDS(sz)] = END_FLAG ^ (word)result; ! # endif UNLOCK(); return((ptr_t)result); } + #ifdef DBG_HDRS_ALL + /* Store debugging info into p. Return displaced pointer. */ + /* This version assumes we do hold the allocation lock. */ + ptr_t GC_store_debug_info_inner(p, sz, string, integer) + register ptr_t p; /* base pointer */ + word sz; /* bytes */ + char * string; + word integer; + { + register word * result = (word *)((oh *)p + 1); + + /* There is some argument that we should disable signals here. */ + /* But that's expensive. And this way things should only appear */ + /* inconsistent while we're in the handler. */ + # ifdef KEEP_BACK_PTRS + ((oh *)p) -> oh_back_ptr = HIDE_BACK_PTR(NOT_MARKED); + # endif + # ifdef MAKE_BACK_GRAPH + ((oh *)p) -> oh_bg_ptr = HIDE_BACK_PTR((ptr_t)0); + # endif + ((oh *)p) -> oh_string = string; + ((oh *)p) -> oh_int = integer; + # ifndef SHORT_DBG_HDRS + ((oh *)p) -> oh_sz = sz; + ((oh *)p) -> oh_sf = START_FLAG ^ (word)result; + ((word *)p)[BYTES_TO_WORDS(GC_size(p))-1] = + result[SIMPLE_ROUNDED_UP_WORDS(sz)] = END_FLAG ^ (word)result; + # endif + return((ptr_t)result); + } + #endif + + #ifndef SHORT_DBG_HDRS /* Check the object with debugging info at ohdr */ /* return NIL if it's OK. Else return clobbered */ /* address. */ *************** register oh * ohdr; *** 232,243 **** if (((word *)ohdr)[BYTES_TO_WORDS(gc_sz)-1] != (END_FLAG ^ (word)body)) { return((ptr_t)((word *)ohdr + BYTES_TO_WORDS(gc_sz)-1)); } ! if (((word *)body)[ROUNDED_UP_WORDS(ohdr -> oh_sz)] != (END_FLAG ^ (word)body)) { ! return((ptr_t)((word *)body + ROUNDED_UP_WORDS(ohdr -> oh_sz))); } return(0); } void GC_print_obj(p) ptr_t p; --- 311,323 ---- if (((word *)ohdr)[BYTES_TO_WORDS(gc_sz)-1] != (END_FLAG ^ (word)body)) { return((ptr_t)((word *)ohdr + BYTES_TO_WORDS(gc_sz)-1)); } ! if (((word *)body)[SIMPLE_ROUNDED_UP_WORDS(ohdr -> oh_sz)] != (END_FLAG ^ (word)body)) { ! return((ptr_t)((word *)body + SIMPLE_ROUNDED_UP_WORDS(ohdr -> oh_sz))); } return(0); } + #endif /* !SHORT_DBG_HDRS */ void GC_print_obj(p) ptr_t p; *************** ptr_t p; *** 246,266 **** GC_err_printf1("0x%lx (", ((unsigned long)ohdr + sizeof(oh))); GC_err_puts(ohdr -> oh_string); ! GC_err_printf2(":%ld, sz=%ld)\n", (unsigned long)(ohdr -> oh_int), ! (unsigned long)(ohdr -> oh_sz)); PRINT_CALL_CHAIN(ohdr); } ! void GC_debug_print_heap_obj_proc(p) ! ptr_t p; { ! if (GC_has_debug_info(p)) { GC_print_obj(p); } else { GC_default_print_heap_obj_proc(p); } } void GC_print_smashed_obj(p, clobbered_addr) ptr_t p, clobbered_addr; { --- 326,355 ---- GC_err_printf1("0x%lx (", ((unsigned long)ohdr + sizeof(oh))); GC_err_puts(ohdr -> oh_string); ! # ifdef SHORT_DBG_HDRS ! GC_err_printf1(":%ld, sz=%ld)\n", (unsigned long)(ohdr -> oh_int)); ! # else ! GC_err_printf2(":%ld, sz=%ld)\n", (unsigned long)(ohdr -> oh_int), ! (unsigned long)(ohdr -> oh_sz)); ! # endif PRINT_CALL_CHAIN(ohdr); } ! # if defined(__STDC__) || defined(__cplusplus) ! void GC_debug_print_heap_obj_proc(ptr_t p) ! # else ! void GC_debug_print_heap_obj_proc(p) ! ptr_t p; ! # endif { ! if (GC_HAS_DEBUG_INFO(p)) { GC_print_obj(p); } else { GC_default_print_heap_obj_proc(p); } } + #ifndef SHORT_DBG_HDRS void GC_print_smashed_obj(p, clobbered_addr) ptr_t p, clobbered_addr; { *************** ptr_t p, clobbered_addr; *** 283,294 **** PRINT_CALL_CHAIN(ohdr); } } ! void GC_check_heap_proc(); void GC_start_debugging() { ! GC_check_heap = GC_check_heap_proc; GC_print_heap_obj = GC_debug_print_heap_obj_proc; GC_debugging_started = TRUE; GC_register_displacement((word)sizeof(oh)); --- 372,390 ---- PRINT_CALL_CHAIN(ohdr); } } + #endif ! void GC_check_heap_proc GC_PROTO((void)); ! ! void GC_do_nothing() {} void GC_start_debugging() { ! # ifndef SHORT_DBG_HDRS ! GC_check_heap = GC_check_heap_proc; ! # else ! GC_check_heap = GC_do_nothing; ! # endif GC_print_heap_obj = GC_debug_print_heap_obj_proc; GC_debugging_started = TRUE; GC_register_displacement((word)sizeof(oh)); *************** void GC_start_debugging() *** 333,366 **** return (GC_store_debug_info(result, (word)lb, s, (word)i)); } ! # ifdef __STDC__ ! GC_PTR GC_debug_generic_malloc(size_t lb, int k, GC_EXTRA_PARAMS) ! # else ! GC_PTR GC_debug_malloc(lb, k, s, i) ! size_t lb; ! int k; ! char * s; ! int i; ! # ifdef GC_ADD_CALLER ! --> GC_ADD_CALLER not implemented for K&R C ! # endif ! # endif ! { ! GC_PTR result = GC_generic_malloc(lb + DEBUG_BYTES, k); if (result == 0) { ! GC_err_printf1("GC_debug_malloc(%ld) returning NIL (", (unsigned long) lb); - GC_err_puts(s); - GC_err_printf1(":%ld)\n", (unsigned long)i); return(0); } ! if (!GC_debugging_started) { ! GC_start_debugging(); } ADD_CALL_CHAIN(result, ra); ! return (GC_store_debug_info(result, (word)lb, s, (word)i)); ! } #ifdef STUBBORN_ALLOC # ifdef __STDC__ --- 429,470 ---- return (GC_store_debug_info(result, (word)lb, s, (word)i)); } ! # ifdef DBG_HDRS_ALL ! /* ! * An allocation function for internal use. ! * Normally internally allocated objects do not have debug information. ! * But in this case, we need to make sure that all objects have debug ! * headers. ! * We assume debugging was started in collector initialization, ! * and we already hold the GC lock. ! */ ! GC_PTR GC_debug_generic_malloc_inner(size_t lb, int k) ! { ! GC_PTR result = GC_generic_malloc_inner(lb + DEBUG_BYTES, k); if (result == 0) { ! GC_err_printf1("GC internal allocation (%ld bytes) returning NIL\n", (unsigned long) lb); return(0); } ! ADD_CALL_CHAIN(result, ra); ! return (GC_store_debug_info_inner(result, (word)lb, "INTERNAL", (word)0)); ! } ! ! GC_PTR GC_debug_generic_malloc_inner_ignore_off_page(size_t lb, int k) ! { ! GC_PTR result = GC_generic_malloc_inner_ignore_off_page( ! lb + DEBUG_BYTES, k); ! ! if (result == 0) { ! GC_err_printf1("GC internal allocation (%ld bytes) returning NIL\n", ! (unsigned long) lb); ! return(0); } ADD_CALL_CHAIN(result, ra); ! return (GC_store_debug_info_inner(result, (word)lb, "INTERNAL", (word)0)); ! } ! # endif #ifdef STUBBORN_ALLOC # ifdef __STDC__ *************** GC_PTR p; *** 554,571 **** "GC_debug_free called on pointer %lx wo debugging info\n", (unsigned long)p); } else { ! clobbered = GC_check_annotated_obj((oh *)base); ! if (clobbered != 0) { ! if (((oh *)base) -> oh_sz == GC_size(base)) { GC_err_printf0( "GC_debug_free: found previously deallocated (?) object at "); ! } else { GC_err_printf0("GC_debug_free: found smashed location at "); } ! GC_print_smashed_obj(p, clobbered); ! } ! /* Invalidate size */ ! ((oh *)base) -> oh_sz = GC_size(base); } if (GC_find_leak) { GC_free(base); --- 658,677 ---- "GC_debug_free called on pointer %lx wo debugging info\n", (unsigned long)p); } else { ! # ifndef SHORT_DBG_HDRS ! clobbered = GC_check_annotated_obj((oh *)base); ! if (clobbered != 0) { ! if (((oh *)base) -> oh_sz == GC_size(base)) { GC_err_printf0( "GC_debug_free: found previously deallocated (?) object at "); ! } else { GC_err_printf0("GC_debug_free: found smashed location at "); + } + GC_print_smashed_obj(p, clobbered); } ! /* Invalidate size */ ! ((oh *)base) -> oh_sz = GC_size(base); ! # endif /* SHORT_DBG_HDRS */ } if (GC_find_leak) { GC_free(base); *************** GC_PTR p; *** 585,590 **** --- 691,707 ---- } /* !GC_find_leak */ } + #ifdef THREADS + + extern void GC_free_inner(GC_PTR p); + + /* Used internally; we assume it's called correctly. */ + void GC_debug_free_inner(GC_PTR p) + { + GC_free_inner(GC_base(p)); + } + #endif + # ifdef __STDC__ GC_PTR GC_debug_realloc(GC_PTR p, size_t lb, GC_EXTRA_PARAMS) # else *************** GC_PTR p; *** 639,650 **** GC_err_printf0("GC_debug_realloc: encountered bad kind\n"); ABORT("bad kind"); } ! clobbered = GC_check_annotated_obj((oh *)base); ! if (clobbered != 0) { GC_err_printf0("GC_debug_realloc: found smashed location at "); GC_print_smashed_obj(p, clobbered); ! } ! old_sz = ((oh *)base) -> oh_sz; if (old_sz < copy_sz) copy_sz = old_sz; if (result == 0) return(0); BCOPY(p, result, copy_sz); --- 756,771 ---- GC_err_printf0("GC_debug_realloc: encountered bad kind\n"); ABORT("bad kind"); } ! # ifdef SHORT_DBG_HDRS ! old_sz = GC_size(base) - sizeof(oh); ! # else ! clobbered = GC_check_annotated_obj((oh *)base); ! if (clobbered != 0) { GC_err_printf0("GC_debug_realloc: found smashed location at "); GC_print_smashed_obj(p, clobbered); ! } ! old_sz = ((oh *)base) -> oh_sz; ! # endif if (old_sz < copy_sz) copy_sz = old_sz; if (result == 0) return(0); BCOPY(p, result, copy_sz); *************** GC_PTR p; *** 652,662 **** return(result); } /* Check all marked objects in the given block for validity */ /*ARGSUSED*/ ! void GC_check_heap_block(hbp, dummy) ! register struct hblk *hbp; /* ptr to current heap block */ ! word dummy; { register struct hblkhdr * hhdr = HDR(hbp); register word sz = hhdr -> hb_sz; --- 773,788 ---- return(result); } + #ifndef SHORT_DBG_HDRS /* Check all marked objects in the given block for validity */ /*ARGSUSED*/ ! # if defined(__STDC__) || defined(__cplusplus) ! void GC_check_heap_block(register struct hblk *hbp, word dummy) ! # else ! void GC_check_heap_block(hbp, dummy) ! register struct hblk *hbp; /* ptr to current heap block */ ! word dummy; ! # endif { register struct hblkhdr * hhdr = HDR(hbp); register word sz = hhdr -> hb_sz; *************** word dummy; *** 664,670 **** register word *p, *plim; p = (word *)(hbp->hb_body); ! word_no = HDR_WORDS; if (sz > MAXOBJSZ) { plim = p; } else { --- 790,796 ---- register word *p, *plim; p = (word *)(hbp->hb_body); ! word_no = 0; if (sz > MAXOBJSZ) { plim = p; } else { *************** word dummy; *** 673,679 **** /* go through all words in block */ while( p <= plim ) { if( mark_bit_from_hdr(hhdr, word_no) ! && GC_has_debug_info((ptr_t)p)) { ptr_t clobbered = GC_check_annotated_obj((oh *)p); if (clobbered != 0) { --- 799,805 ---- /* go through all words in block */ while( p <= plim ) { if( mark_bit_from_hdr(hhdr, word_no) ! && GC_HAS_DEBUG_INFO((ptr_t)p)) { ptr_t clobbered = GC_check_annotated_obj((oh *)p); if (clobbered != 0) { *************** void GC_check_heap_proc() *** 700,705 **** --- 826,833 ---- GC_apply_to_all_blocks(GC_check_heap_block, (word)0); } + #endif /* !SHORT_DBG_HDRS */ + struct closure { GC_finalization_proc cl_fn; GC_PTR cl_data; *************** struct closure { *** 714,720 **** # endif { struct closure * result = ! (struct closure *) GC_malloc(sizeof (struct closure)); result -> cl_fn = fn; result -> cl_data = data; --- 842,853 ---- # endif { struct closure * result = ! # ifdef DBG_HDRS_ALL ! (struct closure *) GC_debug_malloc(sizeof (struct closure), ! GC_EXTRAS); ! # else ! (struct closure *) GC_malloc(sizeof (struct closure)); ! # endif result -> cl_fn = fn; result -> cl_data = data; *************** struct closure { *** 734,739 **** --- 867,894 ---- (*(cl -> cl_fn))((GC_PTR)((char *)obj + sizeof(oh)), cl -> cl_data); } + /* Set ofn and ocd to reflect the values we got back. */ + static void store_old (obj, my_old_fn, my_old_cd, ofn, ocd) + GC_PTR obj; + GC_finalization_proc my_old_fn; + struct closure * my_old_cd; + GC_finalization_proc *ofn; + GC_PTR *ocd; + { + if (0 != my_old_fn) { + if (my_old_fn != GC_debug_invoke_finalizer) { + GC_err_printf1("Debuggable object at 0x%lx had non-debug finalizer.\n", + obj); + /* This should probably be fatal. */ + } else { + if (ofn) *ofn = my_old_cd -> cl_fn; + if (ocd) *ocd = my_old_cd -> cl_data; + } + } else { + if (ofn) *ofn = 0; + if (ocd) *ocd = 0; + } + } # ifdef __STDC__ void GC_debug_register_finalizer(GC_PTR obj, GC_finalization_proc fn, *************** struct closure { *** 748,761 **** GC_PTR *ocd; # endif { ptr_t base = GC_base(obj); if (0 == base || (ptr_t)obj - base != sizeof(oh)) { GC_err_printf1( "GC_register_finalizer called with non-base-pointer 0x%lx\n", obj); } ! GC_register_finalizer(base, GC_debug_invoke_finalizer, ! GC_make_closure(fn,cd), ofn, ocd); } # ifdef __STDC__ --- 903,923 ---- GC_PTR *ocd; # endif { + GC_finalization_proc my_old_fn; + GC_PTR my_old_cd; ptr_t base = GC_base(obj); if (0 == base || (ptr_t)obj - base != sizeof(oh)) { GC_err_printf1( "GC_register_finalizer called with non-base-pointer 0x%lx\n", obj); } ! if (0 == fn) { ! GC_register_finalizer(base, 0, 0, &my_old_fn, &my_old_cd); ! } else { ! GC_register_finalizer(base, GC_debug_invoke_finalizer, ! GC_make_closure(fn,cd), &my_old_fn, &my_old_cd); ! } ! store_old(obj, my_old_fn, (struct closure *)my_old_cd, ofn, ocd); } # ifdef __STDC__ *************** struct closure { *** 773,786 **** GC_PTR *ocd; # endif { ptr_t base = GC_base(obj); if (0 == base || (ptr_t)obj - base != sizeof(oh)) { GC_err_printf1( "GC_register_finalizer_no_order called with non-base-pointer 0x%lx\n", obj); } ! GC_register_finalizer_no_order(base, GC_debug_invoke_finalizer, ! GC_make_closure(fn,cd), ofn, ocd); } # ifdef __STDC__ --- 935,956 ---- GC_PTR *ocd; # endif { + GC_finalization_proc my_old_fn; + GC_PTR my_old_cd; ptr_t base = GC_base(obj); if (0 == base || (ptr_t)obj - base != sizeof(oh)) { GC_err_printf1( "GC_register_finalizer_no_order called with non-base-pointer 0x%lx\n", obj); } ! if (0 == fn) { ! GC_register_finalizer_no_order(base, 0, 0, &my_old_fn, &my_old_cd); ! } else { ! GC_register_finalizer_no_order(base, GC_debug_invoke_finalizer, ! GC_make_closure(fn,cd), &my_old_fn, ! &my_old_cd); ! } ! store_old(obj, my_old_fn, (struct closure *)my_old_cd, ofn, ocd); } # ifdef __STDC__ *************** struct closure { *** 798,809 **** GC_PTR *ocd; # endif { ptr_t base = GC_base(obj); if (0 == base || (ptr_t)obj - base != sizeof(oh)) { GC_err_printf1( "GC_register_finalizer_ignore_self called with non-base-pointer 0x%lx\n", obj); } ! GC_register_finalizer_ignore_self(base, GC_debug_invoke_finalizer, ! GC_make_closure(fn,cd), ofn, ocd); } --- 968,1006 ---- GC_PTR *ocd; # endif { + GC_finalization_proc my_old_fn; + GC_PTR my_old_cd; ptr_t base = GC_base(obj); if (0 == base || (ptr_t)obj - base != sizeof(oh)) { GC_err_printf1( "GC_register_finalizer_ignore_self called with non-base-pointer 0x%lx\n", obj); } ! if (0 == fn) { ! GC_register_finalizer_ignore_self(base, 0, 0, &my_old_fn, &my_old_cd); ! } else { ! GC_register_finalizer_ignore_self(base, GC_debug_invoke_finalizer, ! GC_make_closure(fn,cd), &my_old_fn, ! &my_old_cd); ! } ! store_old(obj, my_old_fn, (struct closure *)my_old_cd, ofn, ocd); ! } ! ! #ifdef GC_ADD_CALLER ! # define RA GC_RETURN_ADDR, ! #else ! # define RA ! #endif ! ! GC_PTR GC_debug_malloc_replacement(lb) ! size_t lb; ! { ! return GC_debug_malloc(lb, RA "unknown", 0); ! } ! ! GC_PTR GC_debug_realloc_replacement(p, lb) ! GC_PTR p; ! size_t lb; ! { ! return GC_debug_realloc(p, lb, RA "unknown", 0); } diff -Nrc3pad gcc-3.0.4/boehm-gc/dbg_mlc.h gcc-3.1/boehm-gc/dbg_mlc.h *** gcc-3.0.4/boehm-gc/dbg_mlc.h Wed Apr 19 02:29:15 2000 --- gcc-3.1/boehm-gc/dbg_mlc.h Thu Jan 1 00:00:00 1970 *************** *** 1,102 **** - /* - * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers - * Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved. - * Copyright (c) 1997 by Silicon Graphics. All rights reserved. - * Copyright (c) 1999 by Hewlett-Packard Company. All rights reserved. - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - */ - - /* - * This is mostly an internal header file. Typical clients should - * not use it. Clients that define their own object kinds with - * debugging allocators will probably want to include this, however. - * No attempt is made to keep the namespace clean. This should not be - * included from header filrd that are frequently included by clients. - */ - - #ifndef _DBG_MLC_H - - #define _DBG_MLC_H - - # define I_HIDE_POINTERS - # include "gc_priv.h" - # ifdef KEEP_BACK_PTRS - # include "backptr.h" - # endif - - # define START_FLAG ((word)0xfedcedcb) - # define END_FLAG ((word)0xbcdecdef) - /* Stored both one past the end of user object, and one before */ - /* the end of the object as seen by the allocator. */ - - - /* Object header */ - typedef struct { - # ifdef KEEP_BACK_PTRS - ptr_t oh_back_ptr; - # define MARKED_FOR_FINALIZATION (ptr_t)(-1) - /* Object was marked because it is finalizable. */ - # define MARKED_FROM_REGISTER (ptr_t)(-2) - /* Object was marked from a rgister. Hence the */ - /* source of the reference doesn't have an address. */ - # ifdef ALIGN_DOUBLE - word oh_dummy; - # endif - # endif - char * oh_string; /* object descriptor string */ - word oh_int; /* object descriptor integers */ - # ifdef NEED_CALLINFO - struct callinfo oh_ci[NFRAMES]; - # endif - word oh_sz; /* Original malloc arg. */ - word oh_sf; /* start flag */ - } oh; - /* The size of the above structure is assumed not to dealign things, */ - /* and to be a multiple of the word length. */ - - #define DEBUG_BYTES (sizeof (oh) + sizeof (word)) - #define USR_PTR_FROM_BASE(p) ((ptr_t)(p) + sizeof(oh)) - - /* There is no reason to ever add a byte at the end explicitly, since we */ - /* already add a guard word. */ - #undef ROUNDED_UP_WORDS - #define ROUNDED_UP_WORDS(n) BYTES_TO_WORDS((n) + WORDS_TO_BYTES(1) - 1) - - #ifdef SAVE_CALL_CHAIN - # define ADD_CALL_CHAIN(base, ra) GC_save_callers(((oh *)(base)) -> oh_ci) - # define PRINT_CALL_CHAIN(base) GC_print_callers(((oh *)(base)) -> oh_ci) - #else - # ifdef GC_ADD_CALLER - # define ADD_CALL_CHAIN(base, ra) ((oh *)(base)) -> oh_ci[0].ci_pc = (ra) - # define PRINT_CALL_CHAIN(base) GC_print_callers(((oh *)(base)) -> oh_ci) - # else - # define ADD_CALL_CHAIN(base, ra) - # define PRINT_CALL_CHAIN(base) - # endif - #endif - - # ifdef GC_ADD_CALLER - # define OPT_RA ra, - # else - # define OPT_RA - # endif - - - /* Check whether object with base pointer p has debugging info */ - /* p is assumed to point to a legitimate object in our part */ - /* of the heap. */ - GC_bool GC_has_debug_info(/* p */); - - /* Store debugging info into p. Return displaced pointer. */ - /* Assumes we don't hold allocation lock. */ - ptr_t GC_store_debug_info(/* p, sz, string, integer */); - - #endif /* _DBG_MLC_H */ --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/digimars.mak gcc-3.1/boehm-gc/digimars.mak *** gcc-3.0.4/boehm-gc/digimars.mak Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/digimars.mak Fri Aug 17 18:39:17 2001 *************** *** 0 **** --- 1,90 ---- + # Makefile to build Hans Boehm garbage collector using the Digital Mars + # compiler from www.digitalmars.com + # Written by Walter Bright + + + DEFINES=-DNDEBUG -DSILENT -DGC_BUILD -D_WINDOWS -DGC_DLL -DALL_INTERIOR_POINTERS -D__STDC__ -DWIN32_THREADS + CFLAGS=-Iinclude $(DEFINES) -wx -g + LFLAGS=/ma/implib/co + CC=sc + + .c.obj: + $(CC) -c $(CFLAGS) $* + + .cpp.obj: + $(CC) -c $(CFLAGS) -Aa $* + + OBJS= \ + allchblk.obj\ + alloc.obj\ + blacklst.obj\ + checksums.obj\ + dbg_mlc.obj\ + dyn_load.obj\ + finalize.obj\ + gc_cpp.obj\ + headers.obj\ + mach_dep.obj\ + malloc.obj\ + mallocx.obj\ + mark.obj\ + mark_rts.obj\ + misc.obj\ + new_hblk.obj\ + obj_map.obj\ + os_dep.obj\ + ptr_chck.obj\ + reclaim.obj\ + stubborn.obj\ + typd_mlc.obj\ + win32_threads.obj + + targets: gc.dll gc.lib gctest.exe + + gc.dll: $(OBJS) gc.def digimars.mak + sc -ogc.dll $(OBJS) -L$(LFLAGS) gc.def kernel32.lib user32.lib + + gc.def: digimars.mak + echo LIBRARY GC >gc.def + echo DESCRIPTION "Hans Boehm Garbage Collector" >>gc.def + echo EXETYPE NT >>gc.def + echo EXPORTS >>gc.def + echo GC_is_visible_print_proc >>gc.def + echo GC_is_valid_displacement_print_proc >>gc.def + + clean: + del gc.def + del $(OBJS) + + + gctest.exe : gc.lib tests\test.obj + sc -ogctest.exe tests\test.obj gc.lib + + tests\test.obj : tests\test.c + $(CC) -c -g -DNDEBUG -DSILENT -DGC_BUILD -D_WINDOWS -DGC_DLL \ + -DALL_INTERIOR_POINTERS -DWIN32_THREADS \ + -Iinclude tests\test.c -otests\test.obj + + allchblk.obj: allchblk.c + alloc.obj: alloc.c + blacklst.obj: blacklst.c + checksums.obj: checksums.c + dbg_mlc.obj: dbg_mlc.c + dyn_load.obj: dyn_load.c + finalize.obj: finalize.c + gc_cpp.obj: gc_cpp.cpp + headers.obj: headers.c + mach_dep.obj: mach_dep.c + malloc.obj: malloc.c + mallocx.obj: mallocx.c + mark.obj: mark.c + mark_rts.obj: mark_rts.c + misc.obj: misc.c + new_hblk.obj: new_hblk.c + obj_map.obj: obj_map.c + os_dep.obj: os_dep.c + ptr_chck.obj: ptr_chck.c + reclaim.obj: reclaim.c + stubborn.obj: stubborn.c + typd_mlc.obj: typd_mlc.c + win32_threads.obj: win32_threads.c diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README gcc-3.1/boehm-gc/doc/README *** gcc-3.0.4/boehm-gc/doc/README Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README Tue Feb 12 04:37:55 2002 *************** *** 0 **** --- 1,617 ---- + Copyright (c) 1988, 1989 Hans-J. Boehm, Alan J. Demers + Copyright (c) 1991-1996 by Xerox Corporation. All rights reserved. + Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. + Copyright (c) 1999-2001 by Hewlett-Packard Company. All rights reserved. + + The file linux_threads.c is also + Copyright (c) 1998 by Fergus Henderson. All rights reserved. + + The files Makefile.am, and configure.in are + Copyright (c) 2001 by Red Hat Inc. All rights reserved. + + The files config.guess and a few others are copyrighted by the Free + Software Foundation. + + THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED + OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + + Permission is hereby granted to use or copy this program + for any purpose, provided the above notices are retained on all copies. + Permission to modify the code and to distribute modified code is granted, + provided the above notices are retained, and a notice that the code was + modified is included with the above copyright notice. + + A few of the files needed to use the GNU-style build procedure come with + slightly different licenses, though they are all similar in spirit. A few + are GPL'ed, but with an exception that should cover all uses in the + collector. (If you are concerned about such things, I recommend you look + at the notice in config.guess or ltmain.sh.) + + This is version 6.1alpha3 of a conservative garbage collector for C and C++. + + You might find a more recent version of this at + + http://www.hpl.hp.com/personal/Hans_Boehm/gc + + OVERVIEW + + This is intended to be a general purpose, garbage collecting storage + allocator. The algorithms used are described in: + + Boehm, H., and M. Weiser, "Garbage Collection in an Uncooperative Environment", + Software Practice & Experience, September 1988, pp. 807-820. + + Boehm, H., A. Demers, and S. Shenker, "Mostly Parallel Garbage Collection", + Proceedings of the ACM SIGPLAN '91 Conference on Programming Language Design + and Implementation, SIGPLAN Notices 26, 6 (June 1991), pp. 157-164. + + Boehm, H., "Space Efficient Conservative Garbage Collection", Proceedings + of the ACM SIGPLAN '91 Conference on Programming Language Design and + Implementation, SIGPLAN Notices 28, 6 (June 1993), pp. 197-206. + + Boehm H., "Reducing Garbage Collector Cache Misses", Proceedings of the + 2000 International Symposium on Memory Management. + + Possible interactions between the collector and optimizing compilers are + discussed in + + Boehm, H., and D. Chase, "A Proposal for GC-safe C Compilation", + The Journal of C Language Translation 4, 2 (December 1992). + + and + + Boehm H., "Simple GC-safe Compilation", Proceedings + of the ACM SIGPLAN '96 Conference on Programming Language Design and + Implementation. + + (Some of these are also available from + http://www.hpl.hp.com/personal/Hans_Boehm/papers/, among other places.) + + Unlike the collector described in the second reference, this collector + operates either with the mutator stopped during the entire collection + (default) or incrementally during allocations. (The latter is supported + on only a few machines.) On the most common platforms, it can be built + with or without thread support. On a few platforms, it can take advantage + of a multiprocessor to speed up garbage collection. + + Many of the ideas underlying the collector have previously been explored + by others. Notably, some of the run-time systems developed at Xerox PARC + in the early 1980s conservatively scanned thread stacks to locate possible + pointers (cf. Paul Rovner, "On Adding Garbage Collection and Runtime Types + to a Strongly-Typed Statically Checked, Concurrent Language" Xerox PARC + CSL 84-7). Doug McIlroy wrote a simpler fully conservative collector that + was part of version 8 UNIX (tm), but appears to not have received + widespread use. + + Rudimentary tools for use of the collector as a leak detector are included + (see http://www.hpl.hp.com/personal/Hans_Boehm/gc/leak.html), + as is a fairly sophisticated string package "cord" that makes use of the + collector. (See doc/README.cords and H.-J. Boehm, R. Atkinson, and M. Plass, + "Ropes: An Alternative to Strings", Software Practice and Experience 25, 12 + (December 1995), pp. 1315-1330. This is very similar to the "rope" package + in Xerox Cedar, or the "rope" package in the SGI STL or the g++ distribution.) + + Further collector documantation can be found at + + http://www.hpl.hp.com/personal/Hans_Boehm/gc + + + GENERAL DESCRIPTION + + This is a garbage collecting storage allocator that is intended to be + used as a plug-in replacement for C's malloc. + + Since the collector does not require pointers to be tagged, it does not + attempt to ensure that all inaccessible storage is reclaimed. However, + in our experience, it is typically more successful at reclaiming unused + memory than most C programs using explicit deallocation. Unlike manually + introduced leaks, the amount of unreclaimed memory typically stays + bounded. + + In the following, an "object" is defined to be a region of memory allocated + by the routines described below. + + Any objects not intended to be collected must be pointed to either + from other such accessible objects, or from the registers, + stack, data, or statically allocated bss segments. Pointers from + the stack or registers may point to anywhere inside an object. + The same is true for heap pointers if the collector is compiled with + ALL_INTERIOR_POINTERS defined, as is now the default. + + Compiling without ALL_INTERIOR_POINTERS may reduce accidental retention + of garbage objects, by requiring pointers from the heap to to the beginning + of an object. But this no longer appears to be a significant + issue for most programs. + + There are a number of routines which modify the pointer recognition + algorithm. GC_register_displacement allows certain interior pointers + to be recognized even if ALL_INTERIOR_POINTERS is nor defined. + GC_malloc_ignore_off_page allows some pointers into the middle of large objects + to be disregarded, greatly reducing the probablility of accidental + retention of large objects. For most purposes it seems best to compile + with ALL_INTERIOR_POINTERS and to use GC_malloc_ignore_off_page if + you get collector warnings from allocations of very large objects. + See README.debugging for details. + + WARNING: pointers inside memory allocated by the standard "malloc" are not + seen by the garbage collector. Thus objects pointed to only from such a + region may be prematurely deallocated. It is thus suggested that the + standard "malloc" be used only for memory regions, such as I/O buffers, that + are guaranteed not to contain pointers to garbage collectable memory. + Pointers in C language automatic, static, or register variables, + are correctly recognized. (Note that GC_malloc_uncollectable has semantics + similar to standard malloc, but allocates objects that are traced by the + collector.) + + WARNING: the collector does not always know how to find pointers in data + areas that are associated with dynamic libraries. This is easy to + remedy IF you know how to find those data areas on your operating + system (see GC_add_roots). Code for doing this under SunOS, IRIX 5.X and 6.X, + HP/UX, Alpha OSF/1, Linux, and win32 is included and used by default. (See + README.win32 for win32 details.) On other systems pointers from dynamic + library data areas may not be considered by the collector. + If you're writing a program that depends on the collector scanning + dynamic library data areas, it may be a good idea to include at least + one call to GC_is_visible() to ensure that those areas are visible + to the collector. + + Note that the garbage collector does not need to be informed of shared + read-only data. However if the shared library mechanism can introduce + discontiguous data areas that may contain pointers, then the collector does + need to be informed. + + Signal processing for most signals may be deferred during collection, + and during uninterruptible parts of the allocation process. + Like standard ANSI C mallocs, by default it is unsafe to invoke + malloc (and other GC routines) from a signal handler while another + malloc call may be in progress. Removing -DNO_SIGNALS from Makefile + attempts to remedy that. But that may not be reliable with a compiler that + substantially reorders memory operations inside GC_malloc. + + The allocator/collector can also be configured for thread-safe operation. + (Full signal safety can also be achieved, but only at the cost of two system + calls per malloc, which is usually unacceptable.) + WARNING: the collector does not guarantee to scan thread-local storage + (e.g. of the kind accessed with pthread_getspecific()). The collector + does scan thread stacks, though, so generally the best solution is to + ensure that any pointers stored in thread-local storage are also + stored on the thread's stack for the duration of their lifetime. + (This is arguably a longstanding bug, but it hasn't been fixed yet.) + + INSTALLATION AND PORTABILITY + + As distributed, the macro SILENT is defined in Makefile. + In the event of problems, this can be removed to obtain a moderate + amount of descriptive output for each collection. + (The given statistics exhibit a few peculiarities. + Things don't appear to add up for a variety of reasons, most notably + fragmentation losses. These are probably much more significant for the + contrived program "test.c" than for your application.) + + Note that typing "make test" will automatically build the collector + and then run setjmp_test and gctest. Setjmp_test will give you information + about configuring the collector, which is useful primarily if you have + a machine that's not already supported. Gctest is a somewhat superficial + test of collector functionality. Failure is indicated by a core dump or + a message to the effect that the collector is broken. Gctest takes about + 35 seconds to run on a SPARCstation 2. It may use up to 8 MB of memory. (The + multi-threaded version will use more. 64-bit versions may use more.) + "Make test" will also, as its last step, attempt to build and test the + "cord" string library. This will fail without an ANSI C compiler, but + the garbage collector itself should still be usable. + + The Makefile will generate a library gc.a which you should link against. + Typing "make cords" will add the cord library to gc.a. + Note that this requires an ANSI C compiler. + + It is suggested that if you need to replace a piece of the collector + (e.g. GC_mark_rts.c) you simply list your version ahead of gc.a on the + ld command line, rather than replacing the one in gc.a. (This will + generate numerous warnings under some versions of AIX, but it still + works.) + + All include files that need to be used by clients will be put in the + include subdirectory. (Normally this is just gc.h. "Make cords" adds + "cord.h" and "ec.h".) + + The collector currently is designed to run essentially unmodified on + machines that use a flat 32-bit or 64-bit address space. + That includes the vast majority of Workstations and X86 (X >= 3) PCs. + (The list here was deleted because it was getting too long and constantly + out of date.) + It does NOT run under plain 16-bit DOS or Windows 3.X. There are however + various packages (e.g. win32s, djgpp) that allow flat 32-bit address + applications to run under those systemsif the have at least an 80386 processor, + and several of those are compatible with the collector. + + In a few cases (Amiga, OS/2, Win32, MacOS) a separate makefile + or equivalent is supplied. Many of these have separate README.system + files. + + Dynamic libraries are completely supported only under SunOS + (and even that support is not functional on the last Sun 3 release), + Linux, IRIX 5&6, HP-PA, Win32 (not Win32S) and OSF/1 on DEC AXP machines. + On other machines we recommend that you do one of the following: + + 1) Add dynamic library support (and send us the code). + 2) Use static versions of the libraries. + 3) Arrange for dynamic libraries to use the standard malloc. + This is still dangerous if the library stores a pointer to a + garbage collected object. But nearly all standard interfaces + prohibit this, because they deal correctly with pointers + to stack allocated objects. (Strtok is an exception. Don't + use it.) + + In all cases we assume that pointer alignment is consistent with that + enforced by the standard C compilers. If you use a nonstandard compiler + you may have to adjust the alignment parameters defined in gc_priv.h. + + A port to a machine that is not byte addressed, or does not use 32 bit + or 64 bit addresses will require a major effort. A port to plain MSDOS + or win16 is hard. + + For machines not already mentioned, or for nonstandard compilers, the + following are likely to require change: + + 1. The parameters in gcconfig.h. + The parameters that will usually require adjustment are + STACKBOTTOM, ALIGNMENT and DATASTART. Setjmp_test + prints its guesses of the first two. + DATASTART should be an expression for computing the + address of the beginning of the data segment. This can often be + &etext. But some memory management units require that there be + some unmapped space between the text and the data segment. Thus + it may be more complicated. On UNIX systems, this is rarely + documented. But the adb "$m" command may be helpful. (Note + that DATASTART will usually be a function of &etext. Thus a + single experiment is usually insufficient.) + STACKBOTTOM is used to initialize GC_stackbottom, which + should be a sufficient approximation to the coldest stack address. + On some machines, it is difficult to obtain such a value that is + valid across a variety of MMUs, OS releases, etc. A number of + alternatives exist for using the collector in spite of this. See the + discussion in gcconfig.h immediately preceding the various + definitions of STACKBOTTOM. + + 2. mach_dep.c. + The most important routine here is one to mark from registers. + The distributed file includes a generic hack (based on setjmp) that + happens to work on many machines, and may work on yours. Try + compiling and running setjmp_t.c to see whether it has a chance of + working. (This is not correct C, so don't blame your compiler if it + doesn't work. Based on limited experience, register window machines + are likely to cause trouble. If your version of setjmp claims that + all accessible variables, including registers, have the value they + had at the time of the longjmp, it also will not work. Vanilla 4.2 BSD + on Vaxen makes such a claim. SunOS does not.) + If your compiler does not allow in-line assembly code, or if you prefer + not to use such a facility, mach_dep.c may be replaced by a .s file + (as we did for the MIPS machine and the PC/RT). + At this point enough architectures are supported by mach_dep.c + that you will rarely need to do more than adjust for assembler + syntax. + + 3. os_dep.c (and gc_priv.h). + Several kinds of operating system dependent routines reside here. + Many are optional. Several are invoked only through corresponding + macros in gc_priv.h, which may also be redefined as appropriate. + The routine GC_register_data_segments is crucial. It registers static + data areas that must be traversed by the collector. (User calls to + GC_add_roots may sometimes be used for similar effect.) + Routines to obtain memory from the OS also reside here. + Alternatively this can be done entirely by the macro GET_MEM + defined in gc_priv.h. Routines to disable and reenable signals + also reside here if they are need by the macros DISABLE_SIGNALS + and ENABLE_SIGNALS defined in gc_priv.h. + In a multithreaded environment, the macros LOCK and UNLOCK + in gc_priv.h will need to be suitably redefined. + The incremental collector requires page dirty information, which + is acquired through routines defined in os_dep.c. Unless directed + otherwise by gcconfig.h, these are implemented as stubs that simply + treat all pages as dirty. (This of course makes the incremental + collector much less useful.) + + 4. dyn_load.c + This provides a routine that allows the collector to scan data + segments associated with dynamic libraries. Often it is not + necessary to provide this routine unless user-written dynamic + libraries are used. + + For a different version of UN*X or different machines using the + Motorola 68000, Vax, SPARC, 80386, NS 32000, PC/RT, or MIPS architecture, + it should frequently suffice to change definitions in gcconfig.h. + + + THE C INTERFACE TO THE ALLOCATOR + + The following routines are intended to be directly called by the user. + Note that usually only GC_malloc is necessary. GC_clear_roots and GC_add_roots + calls may be required if the collector has to trace from nonstandard places + (e.g. from dynamic library data areas on a machine on which the + collector doesn't already understand them.) On some machines, it may + be desirable to set GC_stacktop to a good approximation of the stack base. + (This enhances code portability on HP PA machines, since there is no + good way for the collector to compute this value.) Client code may include + "gc.h", which defines all of the following, plus many others. + + 1) GC_malloc(nbytes) + - allocate an object of size nbytes. Unlike malloc, the object is + cleared before being returned to the user. Gc_malloc will + invoke the garbage collector when it determines this to be appropriate. + GC_malloc may return 0 if it is unable to acquire sufficient + space from the operating system. This is the most probable + consequence of running out of space. Other possible consequences + are that a function call will fail due to lack of stack space, + or that the collector will fail in other ways because it cannot + maintain its internal data structures, or that a crucial system + process will fail and take down the machine. Most of these + possibilities are independent of the malloc implementation. + + 2) GC_malloc_atomic(nbytes) + - allocate an object of size nbytes that is guaranteed not to contain any + pointers. The returned object is not guaranteed to be cleared. + (Can always be replaced by GC_malloc, but results in faster collection + times. The collector will probably run faster if large character + arrays, etc. are allocated with GC_malloc_atomic than if they are + statically allocated.) + + 3) GC_realloc(object, new_size) + - change the size of object to be new_size. Returns a pointer to the + new object, which may, or may not, be the same as the pointer to + the old object. The new object is taken to be atomic iff the old one + was. If the new object is composite and larger than the original object, + then the newly added bytes are cleared (we hope). This is very likely + to allocate a new object, unless MERGE_SIZES is defined in gc_priv.h. + Even then, it is likely to recycle the old object only if the object + is grown in small additive increments (which, we claim, is generally bad + coding practice.) + + 4) GC_free(object) + - explicitly deallocate an object returned by GC_malloc or + GC_malloc_atomic. Not necessary, but can be used to minimize + collections if performance is critical. Probably a performance + loss for very small objects (<= 8 bytes). + + 5) GC_expand_hp(bytes) + - Explicitly increase the heap size. (This is normally done automatically + if a garbage collection failed to GC_reclaim enough memory. Explicit + calls to GC_expand_hp may prevent unnecessarily frequent collections at + program startup.) + + 6) GC_malloc_ignore_off_page(bytes) + - identical to GC_malloc, but the client promises to keep a pointer to + the somewhere within the first 256 bytes of the object while it is + live. (This pointer should nortmally be declared volatile to prevent + interference from compiler optimizations.) This is the recommended + way to allocate anything that is likely to be larger than 100Kbytes + or so. (GC_malloc may result in failure to reclaim such objects.) + + 7) GC_set_warn_proc(proc) + - Can be used to redirect warnings from the collector. Such warnings + should be rare, and should not be ignored during code development. + + 8) GC_enable_incremental() + - Enables generational and incremental collection. Useful for large + heaps on machines that provide access to page dirty information. + Some dirty bit implementations may interfere with debugging + (by catching address faults) and place restrictions on heap arguments + to system calls (since write faults inside a system call may not be + handled well). + + 9) Several routines to allow for registration of finalization code. + User supplied finalization code may be invoked when an object becomes + unreachable. To call (*f)(obj, x) when obj becomes inaccessible, use + GC_register_finalizer(obj, f, x, 0, 0); + For more sophisticated uses, and for finalization ordering issues, + see gc.h. + + The global variable GC_free_space_divisor may be adjusted up from its + default value of 4 to use less space and more collection time, or down for + the opposite effect. Setting it to 1 or 0 will effectively disable collections + and cause all allocations to simply grow the heap. + + The variable GC_non_gc_bytes, which is normally 0, may be changed to reflect + the amount of memory allocated by the above routines that should not be + considered as a candidate for collection. Careless use may, of course, result + in excessive memory consumption. + + Some additional tuning is possible through the parameters defined + near the top of gc_priv.h. + + If only GC_malloc is intended to be used, it might be appropriate to define: + + #define malloc(n) GC_malloc(n) + #define calloc(m,n) GC_malloc((m)*(n)) + + For small pieces of VERY allocation intensive code, gc_inl.h + includes some allocation macros that may be used in place of GC_malloc + and friends. + + All externally visible names in the garbage collector start with "GC_". + To avoid name conflicts, client code should avoid this prefix, except when + accessing garbage collector routines or variables. + + There are provisions for allocation with explicit type information. + This is rarely necessary. Details can be found in gc_typed.h. + + THE C++ INTERFACE TO THE ALLOCATOR: + + The Ellis-Hull C++ interface to the collector is included in + the collector distribution. If you intend to use this, type + "make c++" after the initial build of the collector is complete. + See gc_cpp.h for the definition of the interface. This interface + tries to approximate the Ellis-Detlefs C++ garbage collection + proposal without compiler changes. + + Cautions: + 1. Arrays allocated without new placement syntax are + allocated as uncollectable objects. They are traced by the + collector, but will not be reclaimed. + + 2. Failure to use "make c++" in combination with (1) will + result in arrays allocated using the default new operator. + This is likely to result in disaster without linker warnings. + + 3. If your compiler supports an overloaded new[] operator, + then gc_cpp.cc and gc_cpp.h should be suitably modified. + + 4. Many current C++ compilers have deficiencies that + break some of the functionality. See the comments in gc_cpp.h + for suggested workarounds. + + USE AS LEAK DETECTOR: + + The collector may be used to track down leaks in C programs that are + intended to run with malloc/free (e.g. code with extreme real-time or + portability constraints). To do so define FIND_LEAK in Makefile + This will cause the collector to invoke the report_leak + routine defined near the top of reclaim.c whenever an inaccessible + object is found that has not been explicitly freed. Such objects will + also be automatically reclaimed. + Productive use of this facility normally involves redefining report_leak + to do something more intelligent. This typically requires annotating + objects with additional information (e.g. creation time stack trace) that + identifies their origin. Such code is typically not very portable, and is + not included here, except on SPARC machines. + If all objects are allocated with GC_DEBUG_MALLOC (see next section), + then the default version of report_leak will report the source file + and line number at which the leaked object was allocated. This may + sometimes be sufficient. (On SPARC/SUNOS4 machines, it will also report + a cryptic stack trace. This can often be turned into a sympolic stack + trace by invoking program "foo" with "callprocs foo". Callprocs is + a short shell script that invokes adb to expand program counter values + to symbolic addresses. It was largely supplied by Scott Schwartz.) + Note that the debugging facilities described in the next section can + sometimes be slightly LESS effective in leak finding mode, since in + leak finding mode, GC_debug_free actually results in reuse of the object. + (Otherwise the object is simply marked invalid.) Also note that the test + program is not designed to run meaningfully in FIND_LEAK mode. + Use "make gc.a" to build the collector. + + DEBUGGING FACILITIES: + + The routines GC_debug_malloc, GC_debug_malloc_atomic, GC_debug_realloc, + and GC_debug_free provide an alternate interface to the collector, which + provides some help with memory overwrite errors, and the like. + Objects allocated in this way are annotated with additional + information. Some of this information is checked during garbage + collections, and detected inconsistencies are reported to stderr. + + Simple cases of writing past the end of an allocated object should + be caught if the object is explicitly deallocated, or if the + collector is invoked while the object is live. The first deallocation + of an object will clear the debugging info associated with an + object, so accidentally repeated calls to GC_debug_free will report the + deallocation of an object without debugging information. Out of + memory errors will be reported to stderr, in addition to returning + NIL. + + GC_debug_malloc checking during garbage collection is enabled + with the first call to GC_debug_malloc. This will result in some + slowdown during collections. If frequent heap checks are desired, + this can be achieved by explicitly invoking GC_gcollect, e.g. from + the debugger. + + GC_debug_malloc allocated objects should not be passed to GC_realloc + or GC_free, and conversely. It is however acceptable to allocate only + some objects with GC_debug_malloc, and to use GC_malloc for other objects, + provided the two pools are kept distinct. In this case, there is a very + low probablility that GC_malloc allocated objects may be misidentified as + having been overwritten. This should happen with probability at most + one in 2**32. This probability is zero if GC_debug_malloc is never called. + + GC_debug_malloc, GC_malloc_atomic, and GC_debug_realloc take two + additional trailing arguments, a string and an integer. These are not + interpreted by the allocator. They are stored in the object (the string is + not copied). If an error involving the object is detected, they are printed. + + The macros GC_MALLOC, GC_MALLOC_ATOMIC, GC_REALLOC, GC_FREE, and + GC_REGISTER_FINALIZER are also provided. These require the same arguments + as the corresponding (nondebugging) routines. If gc.h is included + with GC_DEBUG defined, they call the debugging versions of these + functions, passing the current file name and line number as the two + extra arguments, where appropriate. If gc.h is included without GC_DEBUG + defined, then all these macros will instead be defined to their nondebugging + equivalents. (GC_REGISTER_FINALIZER is necessary, since pointers to + objects with debugging information are really pointers to a displacement + of 16 bytes form the object beginning, and some translation is necessary + when finalization routines are invoked. For details, about what's stored + in the header, see the definition of the type oh in debug_malloc.c) + + INCREMENTAL/GENERATIONAL COLLECTION: + + The collector normally interrupts client code for the duration of + a garbage collection mark phase. This may be unacceptable if interactive + response is needed for programs with large heaps. The collector + can also run in a "generational" mode, in which it usually attempts to + collect only objects allocated since the last garbage collection. + Furthermore, in this mode, garbage collections run mostly incrementally, + with a small amount of work performed in response to each of a large number of + GC_malloc requests. + + This mode is enabled by a call to GC_enable_incremental(). + + Incremental and generational collection is effective in reducing + pause times only if the collector has some way to tell which objects + or pages have been recently modified. The collector uses two sources + of information: + + 1. Information provided by the VM system. This may be provided in + one of several forms. Under Solaris 2.X (and potentially under other + similar systems) information on dirty pages can be read from the + /proc file system. Under other systems (currently SunOS4.X) it is + possible to write-protect the heap, and catch the resulting faults. + On these systems we require that system calls writing to the heap + (other than read) be handled specially by client code. + See os_dep.c for details. + + 2. Information supplied by the programmer. We define "stubborn" + objects to be objects that are rarely changed. Such an object + can be allocated (and enabled for writing) with GC_malloc_stubborn. + Once it has been initialized, the collector should be informed with + a call to GC_end_stubborn_change. Subsequent writes that store + pointers into the object must be preceded by a call to + GC_change_stubborn. + + This mechanism performs best for objects that are written only for + initialization, and such that only one stubborn object is writable + at once. It is typically not worth using for short-lived + objects. Stubborn objects are treated less efficiently than pointerfree + (atomic) objects. + + A rough rule of thumb is that, in the absence of VM information, garbage + collection pauses are proportional to the amount of pointerful storage + plus the amount of modified "stubborn" storage that is reachable during + the collection. + + Initial allocation of stubborn objects takes longer than allocation + of other objects, since other data structures need to be maintained. + + We recommend against random use of stubborn objects in client + code, since bugs caused by inappropriate writes to stubborn objects + are likely to be very infrequently observed and hard to trace. + However, their use may be appropriate in a few carefully written + library routines that do not make the objects themselves available + for writing by client code. + + + BUGS: + + Any memory that does not have a recognizable pointer to it will be + reclaimed. Exclusive-or'ing forward and backward links in a list + doesn't cut it. + Some C optimizers may lose the last undisguised pointer to a memory + object as a consequence of clever optimizations. This has almost + never been observed in practice. Send mail to boehm@acm.org + for suggestions on how to fix your compiler. + This is not a real-time collector. In the standard configuration, + percentage of time required for collection should be constant across + heap sizes. But collection pauses will increase for larger heaps. + (On SPARCstation 2s collection times will be on the order of 300 msecs + per MB of accessible memory that needs to be scanned. Your mileage + may vary.) The incremental/generational collection facility helps, + but is portable only if "stubborn" allocation is used. + Please address bug reports to boehm@acm.org. If you are + contemplating a major addition, you might also send mail to ask whether + it's already been done (or whether we tried and discarded it). + diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.Mac gcc-3.1/boehm-gc/doc/README.Mac *** gcc-3.0.4/boehm-gc/doc/README.Mac Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.Mac Fri Aug 17 18:30:49 2001 *************** *** 0 **** --- 1,385 ---- + Patrick Beard's Notes for building GC v4.12 with CodeWarrior Pro 2: + ---------------------------------------------------------------------------- + The current build environment for the collector is CodeWarrior Pro 2. + Projects for CodeWarrior Pro 2 (and for quite a few older versions) + are distributed in the file Mac_projects.sit.hqx. The project file + :Mac_projects:gc.prj builds static library versions of the collector. + :Mac_projects:gctest.prj builds the GC test suite. + + Configuring the collector is still done by editing the files + :Mac_files:MacOS_config.h and :Mac_files:MacOS_Test_config.h. + + Lars Farm's suggestions on building the collector: + ---------------------------------------------------------------------------- + Garbage Collection on MacOS - a manual 'MakeFile' + ------------------------------------------------- + + Project files and IDE's are great on the Macintosh, but they do have + problems when used as distribution media. This note tries to provide + porting instructions in pure TEXT form to avoid those problems. A manual + 'makefile' if you like. + + GC version: 4.12a2 + Codewarrior: CWPro1 + date: 18 July 1997 + + The notes may or may not apply to earlier or later versions of the + GC/CWPro. Actually, they do apply to earlier versions of both except that + until recently a project could only build one target so each target was a + separate project. The notes will most likely apply to future versions too. + Possibly with minor tweaks. + + This is just to record my experiences. These notes do not mean I now + provide a supported port of the GC to MacOS. It works for me. If it works + for you, great. If it doesn't, sorry, try again...;-) Still, if you find + errors, please let me know. + + mailto: lars.farm@ite.mh.se + + address: Lars Farm + Krönvägen 33b + 856 44 Sundsvall + Sweden + + Porting to MacOS is a bit more complex than it first seems. Which MacOS? + 68K/PowerPC? Which compiler? Each supports both 68K and PowerPC and offer a + large number of (unique to each environment) compiler settings. Each + combination of compiler/68K/PPC/settings require a unique combination of + standard libraries. And the IDE's does not select them for you. They don't + even check that the library is built with compatible setting and this is + the major source of problems when porting the GC (and otherwise too). + + You will have to make choices when you configure the GC. I've made some + choices here, but there are other combinations of settings and #defines + that work too. + + As for target settings the major obstacles may be: + - 68K Processor: check "4-byte Ints". + - PPC Processor: uncheck "Store Static Data in TOC". + + What you need to do: + =================== + + 1) Build the GC as a library + 2) Test that the library works with 'test.c'. + 3) Test that the C++ interface 'gc_cpp.cc/h' works with 'test_cpp.cc'. + + 1) The Libraries: + ================= + I made one project with four targets (68K/PPC tempmem or appheap). One target + will suffice if you're able to decide which one you want. I wasn't... + + Codewarrior allows a large number of compiler/linker settings. I used these: + + Settings shared by all targets: + ------------------------------ + o Access Paths: + - User Paths: the GC folder + - System Paths: {Compiler}:Metrowerks Standard Library: + {Compiler}:MacOS Support:Headers: + {Compiler}:MacOS Support:MacHeaders: + o C/C++ language: + - inlining: normal + - direct to SOM: off + - enable/check: exceptions, RTTI, bool (and if you like pool strings) + + PowerPC target settings + ----------------------- + o Target Settings: + - name of target + - MacOS PPC Linker + o PPC Target + - name of library + o C/C++ language + - prefix file as described below + o PPC Processor + - Struct Alignment: PowerPC + - uncheck "Store Static Data in TOC" -- important! + I don't think the others matter, I use full optimization and its ok + o PPC Linker + - Factory Settings (SYM file with full paths, faster linking, dead-strip + static init, Main: __start) + + + 68K target settings + ------------------- + o Target Settings: + - name of target + - MacOS 68K Linker + o 68K Target + - name of library + - A5 relative data + o C/C++ language + - prefix file as described below + o 68K Processor + - Code model: smart + - Struct alignment: 68K + - FP: SANE + - enable 4-Byte Ints -- important! + I don't think the others matter. I selected... + - enable: 68020 + - enable: global register allocation + o IR Optimizer + - enable: Optimize Space, Optimize Speed + I suppose the others would work too, but haven't tried... + o 68K Linker + - Factory Settings (New Style MacsBug,SYM file with full paths, + A6 Frames, fast link, Merge compiler glue into segment 1, + dead-strip static init) + + Prefix Files to configure the GC sources + ---------------------------------------- + The Codewarrior equivalent of commandline compilers -DNAME=X is to use + prefix-files. A TEXT file that is automatically #included before the first byte + of every source file. I used these: + + ---- ( cut here ) ---- gc_prefix_tempmem.h -- 68K and PPC ----- + #include "gc_prefix_common.h" + #undef USE_TEMPORARY_MEMORY + #define USE_TEMPORARY_MEMORY + ---- ( cut here ) ---- gc_prefix_appmem.h -- 68K and PPC ----- + #include "gc_prefix_common.h" + #undef USE_TEMPORARY_MEMORY + // #define USE_TEMPORARY_MEMORY + + ---- ( cut here ) ---- gc_prefix_common.h -------------------- + // gc_prefix_common.h + // ------------------ + // Codewarrior prefix file to configure the GC libraries + // + // prefix files are the Codewarrior equivalent of the + // command line option -Dname=x frequently seen in makefiles + + #if !__MWERKS__ + #error only tried this with Codewarrior + #endif + + #if macintosh + #define MSL_USE_PRECOMPILED_HEADERS 0 + #include + #ifndef __STDC__ + #define __STDC__ 0 + #endif + + // See list of #defines to configure the library in: 'MakeFile' + // see also README + + #define SILENT // no collection messages. In case + // of trouble you might want this off + #define ALL_INTERIOR_POINTERS // follows interior pointers. + //#define DONT_ADD_BYTE_AT_END // disables the padding if defined. + //#define SMALL_CONFIG // whether to use a smaller heap. + #define NO_SIGNALS // signals aren't real on the Macintosh. + #define ATOMIC_UNCOLLECTABLE // GC_malloc_atomic_uncollectable() + + // define either or none as per personal preference + // used in malloc.c + #define REDIRECT_MALLOC GC_malloc + //#define REDIRECT_MALLOC GC_malloc_uncollectable + // if REDIRECT_MALLOC is #defined make sure that the GC library + // is listed before the ANSI/ISO libs in the Codewarrior + // 'Link order' panel + //#define IGNORE_FREE + + // mac specific configs + //#define USE_TEMPORARY_MEMORY // use Macintosh temporary memory. + //#define SHARED_LIBRARY_BUILD // build for use in a shared library. + + #else + // could build Win32 here too, or in the future + // Rhapsody PPC-mach, Rhapsody PPC-MacOS, + // Rhapsody Intel-mach, Rhapsody Intel-Win32,... + // ... ugh this will get messy ... + #endif + + // make sure ints are at least 32-bit + // ( could be set to 16-bit by compiler settings (68K) ) + + struct gc_private_assert_intsize_{ char x[ sizeof(int)>=4 ? 1 : 0 ]; }; + + #if __powerc + #if __option(toc_data) + #error turn off "store static data in TOC" when using GC + // ... or find a way to add TOC to the root set...(?) + #endif + #endif + ---- ( cut here ) ---- end of gc_prefix_common.h ----------------- + + Files to build the GC libraries: + -------------------------------- + allchblk.c + alloc.c + blacklst.c + checksums.c + dbg_mlc.c + finalize.c + headers.c + mach_dep.c + MacOS.c -- contains MacOS code + malloc.c + mallocx.c + mark.c + mark_rts.c + misc.c + new_hblk.c + obj_map.c + os_dep.c -- contains MacOS code + ptr_chck.c + reclaim.c + stubborn.c + typd_mlc.c + gc++.cc -- this is 'gc_cpp.cc' with less 'inline' and + -- throw std::bad_alloc when out of memory + -- gc_cpp.cc works just fine too + + 2) Test that the library works with 'test.c'. + ============================================= + + The test app is just an ordinary ANSI-C console app. Make sure settings + match the library you're testing. + + Files + ----- + test.c + the GC library to test -- link order before ANSI libs + suitable Mac+ANSI libraries + + prefix: + ------ + ---- ( cut here ) ---- gc_prefix_testlib.h -- all libs ----- + #define MSL_USE_PRECOMPILED_HEADERS 0 + #include + #undef NDEBUG + + #define ALL_INTERIOR_POINTERS /* for GC_priv.h */ + ---- ( cut here ) ---- + + 3) Test that the C++ interface 'gc_cpp.cc/h' works with 'test_cpp.cc'. + + The test app is just an ordinary ANSI-C console app. Make sure settings match + the library you're testing. + + Files + ----- + test_cpp.cc + the GC library to test -- link order before ANSI libs + suitable Mac+ANSI libraries + + prefix: + ------ + same as for test.c + + For convenience I used one test-project with several targets so that all + test apps are build at once. Two for each library to test: test.c and + gc_app.cc. When I was satisfied that the libraries were ok. I put the + libraries + gc.h + the c++ interface-file in a folder that I then put into + the MSL hierarchy so that I don't have to alter access-paths in projects + that use the GC. + + After that, just add the proper GC library to your project and the GC is in + action! malloc will call GC_malloc and free GC_free, new/delete too. You + don't have to call free or delete. You may have to be a bit cautious about + delete if you're freeing other resources than RAM. See gc_cpp.h. You can + also keep coding as always with delete/free. That works too. If you want, + "include and tweak it's use a bit. + + Symantec SPM + ============ + It has been a while since I tried the GC in SPM, but I think that the above + instructions should be sufficient to guide you through in SPM too. SPM + needs to know where the global data is. Use the files 'datastart.c' and + 'dataend.c'. Put 'datastart.c' at the top of your project and 'dataend.c' + at the bottom of your project so that all data is surrounded. This is not + needed in Codewarrior because it provides intrinsic variables + __datastart__, __data_end__ that wraps all globals. + + Source Changes (GC 4.12a2) + ========================== + Very few. Just one tiny in the GC, not strictly needed. + - MacOS.c line 131 in routine GC_MacFreeTemporaryMemory() + change # if !defined(SHARED_LIBRARY_BUILD) + to # if !defined(SILENT) && !defined(SHARED_LIBRARY_BUILD) + To turn off a message when the application quits (actually, I faked + this change by #defining SHARED_LIBRARY_BUILD in a statically linked + library for more than a year without ill effects but perhaps this is + better). + + - test_cpp.cc + made the first lines of main() look like this: + ------------ + int main( int argc, char* argv[] ) { + #endif + #if macintosh // MacOS + char* argv_[] = {"test_cpp","10"}; // doesn't + argv=argv_; // have a + argc = sizeof(argv_)/sizeof(argv_[0]); // commandline + #endif // + + int i, iters, n; + # ifndef __GNUC__ + alloc dummy_to_fool_the_compiler_into_doing_things_it_currently_cant_handle; + ------------ + + - config.h [now gcconfig.h] + __MWERKS__ does not have to mean MACOS. You can use Codewarrior to + build a Win32 or BeOS library and soon a Rhapsody library. You may + have to change that #if... + + + + It worked for me, hope it works for you. + + Lars Farm + 18 July 1997 + ---------------------------------------------------------------------------- + + + Patrick Beard's instructions (may be dated): + + v4.3 of the collector now runs under Symantec C++/THINK C v7.0.4, and + Metrowerks C/C++ v4.5 both 68K and PowerPC. Project files are provided + to build and test the collector under both development systems. + + Configuration + ------------- + + To configure the collector, under both development systems, a prefix file + is used to set preprocessor directives. This file is called "MacOS_config.h". + Also to test the collector, "MacOS_Test_config.h" is provided. + + Testing + ------- + + To test the collector (always a good idea), build one of the gctest projects, + gctest.¹ (Symantec C++/THINK C), mw/gctest.68K.¹, or mw/gctest.PPC.¹. The + test will ask you how many times to run; 1 should be sufficient. + + Building + -------- + + For your convenience project files for the major Macintosh development + systems are provided. + + For Symantec C++/THINK C, you must build the two projects gclib-1.¹ and + gclib-2.¹. It has to be split up because the collector has more than 32k + of static data and no library can have more than this in the Symantec + environment. (Future versions will probably fix this.) + + For Metrowerks C/C++ 4.5 you build gc.68K.¹/gc.PPC.¹ and the result will + be a library called gc.68K.lib/gc.PPC.lib. + + Using + ----- + + Under Symantec C++/THINK C, you can just add the gclib-1.¹ and gclib-2.¹ + projects to your own project. Under Metrowerks, you add gc.68K.lib or + gc.PPC.lib and two additional files. You add the files called datastart.c + and dataend.c to your project, bracketing all files that use the collector. + See mw/gctest.¹ for an example. + + Include the projects/libraries you built above into your own project, + #include "gc.h", and call GC_malloc. You don't have to call GC_free. + + + Patrick C. Beard + January 4, 1995 diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.MacOSX gcc-3.1/boehm-gc/doc/README.MacOSX *** gcc-3.0.4/boehm-gc/doc/README.MacOSX Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.MacOSX Sat Aug 18 01:04:43 2001 *************** *** 0 **** --- 1,27 ---- + While the GC should work on MacOS X Server, MacOS X and Darwin, I only tested + it on MacOS X Server. + I've added a PPC assembly version of GC_push_regs(), thus the setjmp() hack is + no longer necessary. Incremental collection is supported via mprotect/signal. + The current solution isn't really optimal because the signal handler must decode + the faulting PPC machine instruction in order to find the correct heap address. + Further, it must poke around in the register state which the kernel saved away + in some obscure register state structure before it calls the signal handler - + needless to say the layout of this structure is no where documented. + Threads and dynamic libraries are not yet supported (adding dynamic library + support via the low-level dyld API shouldn't be that hard). + + The original MacOS X port was brought to you by Andrew Stone. + + + June, 1 2000 + + Dietmar Planitzer + dave.pl@ping.at + + Note from Andrew Begel: + + One more fix to enable gc.a to link successfully into a shared library for + MacOS X. You have to add -fno-common to the CFLAGS in the Makefile. MacOSX + disallows common symbols in anything that eventually finds its way into a + shared library. (I don't completely understand why, but -fno-common seems to + work and doesn't mess up the garbage collector's functionality). diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.OS2 gcc-3.1/boehm-gc/doc/README.OS2 *** gcc-3.0.4/boehm-gc/doc/README.OS2 Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.OS2 Fri Aug 17 18:30:49 2001 *************** *** 0 **** --- 1,6 ---- + The code assumes static linking, and a single thread. The editor de has + not been ported. The cord test program has. The supplied OS2_MAKEFILE + assumes the IBM C Set/2 environment, but the code shouldn't. + + Since we haven't figured out hoe to do perform partial links or to build static + libraries, clients currently need to link against a long list of executables. diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.amiga gcc-3.1/boehm-gc/doc/README.amiga *** gcc-3.0.4/boehm-gc/doc/README.amiga Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.amiga Fri Aug 17 18:30:49 2001 *************** *** 0 **** --- 1,322 ---- + =========================================================================== + Kjetil S. Matheussen's notes (28-11-2000) + =========================================================================== + Compiles under SAS/C again. Should allso still compile under other + amiga compilers without big changes. I haven't checked if it still + works under gcc, because I don't have gcc for amiga. But I have + updated 'Makefile', and hope it compiles fine. + + + WHATS NEW: + + 1. + Made a pretty big effort in preventing GCs allocating-functions from returning + chip-mem. + + The lower part of the new file AmigaOS.c does this in various ways, mainly by + wrapping GC_malloc, GC_malloc_atomic, GC_malloc_uncollectable, + GC_malloc_atomic_uncollectable, GC_malloc_stubborn, GC_malloc_ignore_off_page + and GC_malloc_atomic_ignore_off_page. GC_realloc is allso wrapped, but + doesn't do the same effort in preventing to return chip-mem. + Other allocating-functions (f.ex. GC_*_typed_) can probably be + used without any problems, but beware that the warn hook will not be called. + In case of problems, don't define GC_AMIGA_FASTALLOC. + + Programs using more time actually using the memory allocated + (instead of just allocate and free rapidly) have + the most to earn on this, but even gctest now normally runs twice + as fast and uses less memory, on my poor 8MB machine. + + The changes have only effect when there is no more + fast-mem left. But with the way GC works, it + could happen quite often. Beware that an atexit handler had to be added, + so using the abort() function will make a big memory-loss. + If you absolutely must call abort() instead of exit(), try calling + the GC_amiga_free_all_mem function before abort(). + + New amiga-spesific compilation flags: + + GC_AMIGA_FASTALLOC - By NOT defining this option, GC will work like before, + it will not try to force fast-mem out of the OS, and + it will use normal calloc for allocation, and the rest + of the following flags will have no effect. + + GC_AMIGA_ONLYFAST - Makes GC never to return chip-mem. GC_AMIGA_RETRY have + no effect if this flag is set. + + GC_AMIGA_GC - If gc returns NULL, do a GC_gcollect, and try again. This + usually is a success with the standard GC configuration. + It is allso the most important flag to set to prevent + GC from returning chip-mem. Beware that it slows down a lot + when a program is rapidly allocating/deallocating when + theres either very little fast-memory left or verly little + chip-memory left. Its not a very common situation, but gctest + sometimes (very rare) use many minutes because of this. + + GC_AMIGA_RETRY - If gc succeed allocating memory, but it is chip-mem, + try again and see if it is fast-mem. Most of the time, + it will actually return fast-mem for the second try. + I have set max number of retries to 9 or size/5000. You + can change this if you like. (see GC_amiga_rec_alloc()) + + GC_AMIGA_PRINTSTATS - Gather some statistics during the execution of a + program, and prints out the info when the atexit-handler + is called. + + My reccomendation is to set all this flags, except GC_AMIGA_PRINTSTATS and + GC_AMIGA_ONLYFAST. + + If your program demands high response-time, you should + not define GC_AMIGA_GC, and possible allso define GC_AMIGA_ONLYFAST. + GC_AMIGA_RETRY does not seem to slow down much. + + Allso, when compiling up programs, and GC_AMIGA_FASTALLOC was not defined when + compilling gc, you can define GC_AMIGA_MAKINGLIB to avoid having these allocation- + functions wrapped. (see gc.h) + + Note that GC_realloc must not be called before any of + the other above mentioned allocating-functions have been called. (shouldn't be + any programs doing so either, I hope). + + Another note. The allocation-function is wrapped when defining + GC_AMIGA_FASTALLOC by letting the function go thru the new + GC_amiga_allocwrapper_do function-pointer (see gc.h). Means that + sending function-pointers, such as GC_malloc, GC_malloc_atomic, etc., + for later to be called like f.ex this, (*GC_malloc_functionpointer)(size), + will not wrap the function. This is normally not a big problem, unless + all allocation function is called like this, which will cause the + atexit un-allocating function never to be called. Then you either + have to manually add the atexit handler, or call the allocation- + functions function-pointer functions like this; + (*GC_amiga_allocwrapper_do)(size,GC_malloc_functionpointer). + There are probably better ways this problem could be handled, unfortunately, + I didn't find any without rewriting or replacing a lot of the GC-code, which + I really didn't want to. (Making new GC_malloc_* functions, and just + define f.ex GC_malloc as GC_amiga_malloc should allso work). + + + New amiga-spesific function: + + void GC_amiga_set_toany(void (*func)(void)); + + 'func' is a function that will be called right before gc has to change + allocation-method from MEMF_FAST to MEMF_ANY. Ie. when it is likely + it will return chip-mem. + + + 2. A few small compiler-spesific additions to make it compile with SAS/C again. + + 3. Updated and rewritten the smakefile, so that it works again and that + the "unnecesarry" 'SCOPTIONS' files could be removed. Allso included + the cord-smakefile stuff in the main smakefile, so that the cord smakefile + could be removed too. By writing smake -f Smakefile.smk, both gc.lib and + cord.lib will be made. + + + + STILL MISSING: + + Programs can not be started from workbench, at least not for SAS/C. (Martin + Tauchmanns note about that it now works with workbench is definitely wrong + when concerning SAS/C). I guess it works if you use the old "#if 0'ed"-code, + but I haven't tested it. I think the reason for MT to replace the + "#if 0'ed"-code was only because it was a bit to SAS/C-spesific. But I + don't know. An iconx-script solves this problem anyway. + + + BEWARE! + + -To run gctest, set the stack to around 200000 bytes first. + -SAS/C-spesific: cord will crash if you compile gc.lib with + either parm=reg or parm=both. (missing legal prototypes for + function-pointers someplace is the reason I guess.). + + + tested with software: Radium, http://www.stud.ifi.uio.no/~ksvalast/radium/ + + tested with hardware: MC68060 + + + -ksvalast@ifi.uio.no + + + =========================================================================== + Martin Tauchmann's notes (1-Apr-99) + =========================================================================== + + Works now, also with the GNU-C compiler V2.7.2.1. + Modify the `Makefile` + CC=cc $(ABI_FLAG) + to + CC=gcc $(ABI_FLAG) + + TECHNICAL NOTES + + - `GC_get_stack_base()`, `GC_register_data_segments()` works now with every + C compiler; also Workbench. + + - Removed AMIGA_SKIP_SEG, but the Code-Segment must not be scanned by GC. + + + PROBLEMS + - When the Linker, does`t merge all Code-Segments to an single one. LD of GCC + do it always. + + - With ixemul.library V47.3, when an GC program launched from another program + (example: `Make` or `if_mach M68K AMIGA gctest`), `GC_register_data_segments()` + found the Segment-List of the caller program. + Can be fixed, if the run-time initialization code (for C programs, usually *crt0*) + support `__data` and `__bss`. + + - PowerPC Amiga currently not supported. + + - Dynamic libraries (dyn_load.c) not supported. + + + TESTED WITH SOFTWARE + + `Optimized Oberon 2 C` (oo2c) + + + TESTED WITH HARDWARE + + MC68030 + + + CONTACT + + Please, contact me at , when you change the + Amiga port. + + =========================================================================== + Michel Schinz's notes + =========================================================================== + WHO DID WHAT + + The original Amiga port was made by Jesper Peterson. I (Michel Schinz) + modified it slightly to reflect the changes made in the new official + distributions, and to take advantage of the new SAS/C 6.x features. I also + created a makefile to compile the "cord" package (see the cord + subdirectory). + + TECHNICAL NOTES + + In addition to Jesper's notes, I have the following to say: + + - Starting with version 4.3, gctest checks to see if the code segment is + added to the root set or not, and complains if it is. Previous versions + of this Amiga port added the code segment to the root set, so I tried to + fix that. The only problem is that, as far as I know, it is impossible to + know which segments are code segments and which are data segments (there + are indeed solutions to this problem, like scanning the program on disk + or patch the LoadSeg functions, but they are rather complicated). The + solution I have chosen (see os_dep.c) is to test whether the program + counter is in the segment we are about to add to the root set, and if it + is, to skip the segment. The problems are that this solution is rather + awkward and that it works only for one code segment. This means that if + your program has more than one code segment, all of them but one will be + added to the root set. This isn't a big problem in fact, since the + collector will continue to work correctly, but it may be slower. + + Anyway, the code which decides whether to skip a segment or not can be + removed simply by not defining AMIGA_SKIP_SEG. But notice that if you do + so, gctest will complain (it will say that "GC_is_visible produced wrong + failure indication"). However, it may be useful if you happen to have + pointers stored in a code segment (you really shouldn't). + + If anyone has a good solution to the problem of finding, when a program + is loaded in memory, whether a segment is a code or a data segment, + please let me know. + + PROBLEMS + + If you have any problem with this version, please contact me at + schinz@alphanet.ch (but do *not* send long files, since we pay for + every mail!). + + =========================================================================== + Jesper Peterson's notes + =========================================================================== + + ADDITIONAL NOTES FOR AMIGA PORT + + These notes assume some familiarity with Amiga internals. + + WHY I PORTED TO THE AMIGA + + The sole reason why I made this port was as a first step in getting + the Sather(*) language on the Amiga. A port of this language will + be done as soon as the Sather 1.0 sources are made available to me. + Given this motivation, the garbage collection (GC) port is rather + minimal. + + (*) For information on Sather read the comp.lang.sather newsgroup. + + LIMITATIONS + + This port assumes that the startup code linked with target programs + is that supplied with SAS/C versions 6.0 or later. This allows + assumptions to be made about where to find the stack base pointer + and data segments when programs are run from WorkBench, as opposed + to running from the CLI. The compiler dependent code is all in the + GC_get_stack_base() and GC_register_data_segments() functions, but + may spread as I add Amiga specific features. + + Given that SAS/C was assumed, the port is set up to be built with + "smake" using the "SMakefile". Compiler options in "SCoptions" can + be set with "scopts" program. Both "smake" and "scopts" are part of + the SAS/C commercial development system. + + In keeping with the porting philosophy outlined above, this port + will not behave well with Amiga specific code. Especially not inter- + process comms via messages, and setting up public structures like + Intuition objects or anything else in the system lists. For the + time being the use of this library is limited to single threaded + ANSI/POSIX compliant or near-complient code. (ie. Stick to stdio + for now). Given this limitation there is currently no mechanism for + allocating "CHIP" or "PUBLIC" memory under the garbage collector. + I'll add this after giving it considerable thought. The major + problem is the entire physical address space may have to me scanned, + since there is no telling who we may have passed memory to. + + If you allocate your own stack in client code, you will have to + assign the pointer plus stack size to GC_stackbottom. + + The initial stack size of the target program can be compiled in by + setting the __stack symbol (see SAS documentaion). It can be over- + ridden from the CLI by running the AmigaDOS "stack" program, or from + the WorkBench by setting the stack size in the tool types window. + + SAS/C COMPILER OPTIONS (SCoptions) + + You may wish to check the "CPU" code option is appropriate for your + intended target system. + + Under no circumstances set the "StackExtend" code option in either + compiling the library or *ANY* client code. + + All benign compiler warnings have been suppressed. These mainly + involve lack of prototypes in the code, and dead assignments + detected by the optimizer. + + THE GOOD NEWS + + The library as it stands is compatible with the GigaMem commercial + virtual memory software, and probably similar PD software. + + The performance of "gctest" on an Amiga 2630 (68030 @ 25Mhz) + compares favourably with an HP9000 with similar architecture (a 325 + with a 68030 I think). + + ----------------------------------------------------------------------- + + The Amiga port has been brought to you by: + + Jesper Peterson. + + jep@mtiame.mtia.oz.au (preferred, but 1 week turnaround) + jep@orca1.vic.design.telecom.au (that's orca, 1 day turnaround) + + At least one of these addresses should be around for a while, even + though I don't work for either of the companies involved. + diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.autoconf gcc-3.1/boehm-gc/doc/README.autoconf *** gcc-3.0.4/boehm-gc/doc/README.autoconf Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.autoconf Fri Aug 17 18:39:18 2001 *************** *** 0 **** --- 1,59 ---- + As of GC6.0alpha8, we attempt to support GNU-style builds based on automake, + autoconf and libtool. This is based almost entirely on Tom Tromey's work + with gcj. + + To build and install libraries use + + configure; make; make install + + The advantages of this process are: + + 1) It should eventually do a better job of automatically determining the + right compiler to use, etc. It probably already does in some cases. + + 2) It tries to automatically set a good set of default GC parameters for + the platform (e.g. thread support). It provides an easier way to configure + some of the others. + + 3) It integrates better with other projects using a GNU-style build process. + + 4) It builds both dynamic and static libraries. + + The known disadvantages are: + + 1) The build scripts are much more complex and harder to debug (though largely + standard). I don't understand them all, and there's probably lots of redundant + stuff. + + 2) It probably doesn't work on all Un*x-like platforms yet. It probably will + never work on the rest. + + 3) The scripts are not yet complete. Some of the standard GNU targets don't + yet work. (Corrections/additions are very welcome.) + + The distribution should contain all files needed to run "configure" and "make", + as well as the sources needed to regenerate the derived files. (If I missed + some, please let me know.) + + Note that the distribution comes with a "Makefile" which will be overwritten + by "configure" with one that is not at all equiavelent to the original. The + distribution contains a copy of the original "Makefile" in "Makefile.direct". + + Important options to configure: + + --prefix=PREFIX install architecture-independent files in PREFIX + [/usr/local] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --enable-threads=TYPE choose threading package + --enable-parallel-mark parallelize marking and free list construction + --enable-full-debug include full support for pointer backtracing etc. + + Unless --prefix is set (or --exec-prefix or one of the more obscure options), + make install will install libgc.a and libgc.so in /usr/local/bin, which + would typically require the "make install" to be run as root. + + Most commonly --enable-threads=posix or will be needed. --enable-parallel-mark + is recommended for multiprocessors if it is supported on the platform. + + diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.changes gcc-3.1/boehm-gc/doc/README.changes *** gcc-3.0.4/boehm-gc/doc/README.changes Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.changes Tue Feb 12 04:37:55 2002 *************** *** 0 **** --- 1,1494 ---- + This is a rough history of garbage collector bugs and versions. + + This has been maintained with varying diligence over the years. + + I made an attempt to include recent contributors here. I apologize for any + omissions. + + ------------------------- + + Version 1.3 and immediately preceding versions contained spurious + assembly language assignments to TMP_SP. Only the assignment in the PC/RT + code is necessary. On other machines, with certain compiler options, + the assignments can lead to an unsaved register being overwritten. + Known to cause problems under SunOS 3.5 WITHOUT the -O option. (With + -O the compiler recognizes it as dead code. It probably shouldn't, + but that's another story.) + + Version 1.4 and earlier versions used compile time determined values + for the stack base. This no longer works on Sun 3s, since Sun 3/80s use + a different stack base. We now use a straightforward heuristic on all + machines on which it is known to work (incl. Sun 3s) and compile-time + determined values for the rest. There should really be library calls + to determine such values. + + Version 1.5 and earlier did not ensure 8 byte alignment for objects + allocated on a sparc based machine. + + Version 1.8 added ULTRIX support in gc_private.h. + + Version 1.9 fixed a major bug in gc_realloc. + + Version 2.0 introduced a consistent naming convention for collector + routines and added support for registering dynamic library data segments + in the standard mark_roots.c. Most of the data structures were revamped. + The treatment of interior pointers was completely changed. Finalization + was added. Support for locking was added. Object kinds were added. + We added a black listing facility to avoid allocating at addresses known + to occur as integers somewhere in the address space. Much of this + was accomplished by adapting ideas and code from the PCR collector. + The test program was changed and expanded. + + Version 2.1 was the first stable version since 1.9, and added support + for PPCR. + + Version 2.2 added debugging allocation, and fixed various bugs. Among them: + - GC_realloc could fail to extend the size of the object for certain large object sizes. + - A blatant subscript range error in GC_printf, which unfortunately + wasn't exercised on machines with sufficient stack alignment constraints. + - GC_register_displacement did the wrong thing if it was called after + any allocation had taken place. + - The leak finding code would eventually break after 2048 byte + byte objects leaked. + - interface.c didn't compile. + - The heap size remained much too small for large stacks. + - The stack clearing code behaved badly for large stacks, and perhaps + on HP/PA machines. + + Version 2.3 added ALL_INTERIOR_POINTERS and fixed the following bugs: + - Missing declaration of etext in the A/UX version. + - Some PCR root-finding problems. + - Blacklisting was not 100% effective, because the plausible future + heap bounds were being miscalculated. + - GC_realloc didn't handle out-of-memory correctly. + - GC_base could return a nonzero value for addresses inside free blocks. + - test.c wasn't really thread safe, and could erroneously report failure + in a multithreaded environment. (The locking primitives need to be + replaced for other threads packages.) + - GC_CONS was thoroughly broken. + - On a SPARC with dynamic linking, signals stayed diabled while the + client code was running. + (Thanks to Manuel Serrano at INRIA for reporting the last two.) + + Version 2.4 added GC_free_space_divisor as a tuning knob, added + support for OS/2 and linux, and fixed the following bugs: + - On machines with unaligned pointers (e.g. Sun 3), every 128th word could + fail to be considered for marking. + - Dynamic_load.c erroneously added 4 bytes to the length of the data and + bss sections of the dynamic library. This could result in a bad memory + reference if the actual length was a multiple of a page. (Observed on + Sun 3. Can probably also happen on a Sun 4.) + (Thanks to Robert Brazile for pointing out that the Sun 3 version + was broken. Dynamic library handling is still broken on Sun 3s + under 4.1.1U1, but apparently not 4.1.1. If you have such a machine, + use -Bstatic.) + + Version 2.5 fixed the following bugs: + - Removed an explicit call to exit(1) + - Fixed calls to GC_printf and GC_err_printf, so the correct number of + arguments are always supplied. The OS/2 C compiler gets confused if + the number of actuals and the number of formals differ. (ANSI C + doesn't require this to work. The ANSI sanctioned way of doing things + causes too many compatibility problems.) + + Version 3.0 added generational/incremental collection and stubborn + objects. + + Version 3.1 added the following features: + - A workaround for a SunOS 4.X SPARC C compiler + misfeature that caused problems when the collector was turned into + a dynamic library. + - A fix for a bug in GC_base that could result in a memory fault. + - A fix for a performance bug (and several other misfeatures) pointed + out by Dave Detlefs and Al Dosser. + - Use of dirty bit information for static data under Solaris 2.X. + - DEC Alpha/OSF1 support (thanks to Al Dosser). + - Incremental collection on more platforms. + - A more refined heap expansion policy. Less space usage by default. + - Various minor enhancements to reduce space usage, and to reduce + the amount of memory scanned by the collector. + - Uncollectable allocation without per object overhead. + - More conscientious handling of out-of-memory conditions. + - Fixed a bug in debugging stubborn allocation. + - Fixed a bug that resulted in occasional erroneous reporting of smashed + objects with debugging allocation. + - Fixed bogus leak reports of size 4096 blocks with FIND_LEAK. + + Version 3.2 fixed a serious and not entirely repeatable bug in + the incremental collector. It appeared only when dirty bit info + on the roots was available, which is normally only under Solaris. + It also added GC_general_register_disappearing_link, and some + testing code. Interface.c disappeared. + + Version 3.3 fixes several bugs and adds new ports: + - PCR-specific bugs. + - Missing locking in GC_free, redundant FASTUNLOCK + in GC_malloc_stubborn, and 2 bugs in + GC_unregister_disappearing_link. + All of the above were pointed out by Neil Sharman + (neil@cs.mu.oz.au). + - Common symbols allocated by the SunOS4.X dynamic loader + were not included in the root set. + - Bug in GC_finalize (reported by Brian Beuning and Al Dosser) + - Merged Amiga port from Jesper Peterson (untested) + - Merged NeXT port from Thomas Funke (significantly + modified and untested) + + Version 3.4: + - Fixed a performance bug in GC_realloc. + - Updated the amiga port. + - Added NetBSD and 386BSD ports. + - Added cord library. + - Added trivial performance enhancement for + ALL_INTERIOR_POINTERS. (Don't scan last word.) + + Version 3.5 + - Minor collections now mark from roots only once, if that + doesn't cause an excessive pause. + - The stack clearing heuristic was refined to prevent anomalies + with very heavily recursive programs and sparse stacks. + - Fixed a bug that prevented mark stack growth in some cases. + GC_objects_are_marked should be set to TRUE after a call + to GC_push_roots and as part of GC_push_marked, since + both can now set mark bits. I think this is only a performance + bug, but I wouldn't bet on it. It's certainly very hard to argue + that the old version was correct. + - Fixed an incremental collection bug that prevented it from + working at all when HBLKSIZE != getpagesize() + - Changed dynamic_loading.c to include gc_priv.h before testing + DYNAMIC_LOADING. SunOS dynamic library scanning + must have been broken in 3.4. + - Object size rounding now adapts to program behavior. + - Added a workaround (provided by Manuel Serrano and + colleagues) to a long-standing SunOS 4.X (and 3.X?) ld bug + that I had incorrectly assumed to have been squished. + The collector was broken if the text segment size was within + 32 bytes of a multiple of 8K bytes, and if the beginning of + the data segment contained interesting roots. The workaround + assumes a demand-loadable executable. The original may have + have "worked" in some other cases. + - Added dynamic library support under IRIX5. + - Added support for EMX under OS/2 (thanks to Ari Huttunen). + + Version 3.6: + - fixed a bug in the mark stack growth code that was introduced + in 3.4. + - fixed Makefile to work around DEC AXP compiler tail recursion + bug. + + Version 3.7: + - Added a workaround for an HP/UX compiler bug. + - Fixed another stack clearing performance bug. Reworked + that code once more. + + Version 4.0: + - Added support for Solaris threads (which was possible + only by reimplementing some fraction of Solaris threads, + since Sun doesn't currently make the thread debugging + interface available). + - Added non-threads win32 and win32S support. + - (Grudgingly, with suitable muttering of obscenities) renamed + files so that the collector distribution could live on a FAT + file system. Files that are guaranteed to be useless on + a PC still have long names. Gc_inline.h and gc_private.h + still exist, but now just include gc_inl.h and gc_priv.h. + - Fixed a really obscure bug in finalization that could cause + undetected mark stack overflows. (I would be surprised if + any real code ever tickled this one.) + - Changed finalization code to dynamically resize the hash + tables it maintains. (This probably does not matter for well- + -written code. It no doubt does for C++ code that overuses + destructors.) + - Added typed allocation primitives. Rewrote the marker to + accommodate them with more reasonable efficiency. This + change should also speed up marking for GC_malloc allocated + objects a little. See gc_typed.h for new primitives. + - Improved debugging facilities slightly. Allocation time + stack traces are now kept by default on SPARC/SUNOS4. + (Thanks to Scott Schwartz.) + - Added better support for small heap applications. + - Significantly extended cord package. Fixed a bug in the + implementation of lazily read files. Printf and friends now + have cord variants. Cord traversals are a bit faster. + - Made ALL_INTERIOR_POINTERS recognition the default. + - Fixed de so that it can run in constant space, independent + of file size. Added simple string searching to cords and de. + - Added the Hull-Ellis C++ interface. + - Added dynamic library support for OSF/1. + (Thanks to Al Dosser and Tim Bingham at DEC.) + - Changed argument to GC_expand_hp to be expressed + in units of bytes instead of heap blocks. (Necessary + since the heap block size now varies depending on + configuration. The old version was never very clean.) + - Added GC_get_heap_size(). The previous "equivalent" + was broken. + - Restructured the Makefile a bit. + + Since version 4.0: + - Changed finalization implementation to guarantee that + finalization procedures are called outside of the allocation + lock, making direct use of the interface a little less dangerous. + MAY BREAK EXISTING CLIENTS that assume finalizers + are protected by a lock. Since there seem to be few multithreaded + clients that use finalization, this is hopefully not much of + a problem. + - Fixed a gross bug in CORD_prev. + - Fixed a bug in blacklst.c that could result in unbounded + heap growth during startup on machines that do not clear + memory obtained from the OS (e.g. win32S). + - Ported de editor to win32/win32S. (This is now the only + version with a mouse-sensitive UI.) + - Added GC_malloc_ignore_off_page to allocate large arrays + in the presence of ALL_INTERIOR_POINTERS. + - Changed GC_call_with_alloc_lock to not disable signals in + the single-threaded case. + - Reduced retry count in GC_collect_or_expand for garbage + collecting when out of memory. + - Made uncollectable allocations bypass black-listing, as they + should. + - Fixed a bug in typed_test in test.c that could cause (legitimate) + GC crashes. + - Fixed some potential synchronization problems in finalize.c + - Fixed a real locking problem in typd_mlc.c. + - Worked around an AIX 3.2 compiler feature that results in + out of bounds memory references. + - Partially worked around an IRIX5.2 beta problem (which may + or may not persist to the final release). + - Fixed a bug in the heap integrity checking code that could + result in explicitly deallocated objects being identified as + smashed. Fixed a bug in the dbg_mlc stack saving code + that caused old argument pointers to be considered live. + - Fixed a bug in CORD_ncmp (and hence CORD_str). + - Repaired the OS2 port, which had suffered from bit rot + in 4.0. Worked around what appears to be CSet/2 V1.0 + optimizer bug. + - Fixed a Makefile bug for target "c++". + + Since version 4.1: + - Multiple bug fixes/workarounds in the Solaris threads version. + (It occasionally failed to locate some register contents for + marking. It also turns out that thr_suspend and friends are + unreliable in Solaris 2.3. Dirty bit reads appear + to be unreliable under some weird + circumstances. My stack marking code + contained a serious performance bug. The new code is + extremely defensive, and has not failed in several cpu + hours of testing. But no guarantees ...) + - Added MacOS support (thanks to Patrick Beard.) + - Fixed several syntactic bugs in gc_c++.h and friends. (These + didn't bother g++, but did bother most other compilers.) + Fixed gc_c++.h finalization interface. (It didn't.) + - 64 bit alignment for allocated objects was not guaranteed in a + few cases in which it should have been. + - Added GC_malloc_atomic_ignore_off_page. + - Added GC_collect_a_little. + - Added some prototypes to gc.h. + - Some other minor bug fixes (notably in Makefile). + - Fixed OS/2 / EMX port (thanks to Ari Huttunen). + - Fixed AmigaDOS port. (thanks to Michel Schinz). + - Fixed the DATASTART definition under Solaris. There + was a 1 in 16K chance of the collector missing the first + 64K of static data (and thus crashing). + - Fixed some blatant anachronisms in the README file. + - Fixed PCR-Makefile for upcoming PPCR release. + + Since version 4.2: + - Fixed SPARC alignment problem with GC_DEBUG. + - Fixed Solaris threads /proc workaround. The real + problem was an interaction with mprotect. + - Incorporated fix from Patrick Beard for gc_c++.h (now gc_cpp.h). + - Slightly improved allocator space utilization by + fixing the GC_size_map mechanism. + - Integrated some Sony News and MIPS RISCos 4.51 + patches. (Thanks to Nobuyuki Hikichi of + Software Research Associates, Inc. Japan) + - Fixed HP_PA alignment problem. (Thanks to + xjam@cork.cs.berkeley.edu.) + - Added GC_same_obj and friends. Changed GC_base + to return 0 for pointers past the end of large objects. + Improved GC_base performance with ALL_INTERIOR_POINTERS + on machines with a slow integer mod operation. + Added GC_PTR_ADD, GC_PTR_STORE, etc. to prepare + for preprocessor. + - changed the default on most UNIX machines to be that + signals are not disabled during critical GC operations. + This is still ANSI-conforming, though somewhat dangerous + in the presence of signal handlers. But the performance + cost of the alternative is sometimes problematic. + Can be changed back with a minor Makefile edit. + - renamed IS_STRING in gc.h, to CORD_IS_STRING, thus + following my own naming convention. Added the function + CORD_to_const_char_star. + - Fixed a gross bug in GC_finalize. Symptom: occasional + address faults in that function. (Thanks to Anselm + Baird-Smith (Anselm.BairdSmith@inria.fr) + - Added port to ICL DRS6000 running DRS/NX. Restructured + things a bit to factor out common code, and remove obsolete + code. Collector should now run under SUNOS5 with either + mprotect or /proc dirty bits. (Thanks to Douglas Steel + (doug@wg.icl.co.uk)). + - More bug fixes and workarounds for Solaris 2.X. (These were + mostly related to putting the collector in a dynamic library, + which didn't really work before. Also SOLARIS_THREADS + didn't interact well with dl_open.) Thanks to btlewis@eng.sun.com. + - Fixed a serious performance bug on the DEC Alpha. The text + segment was getting registered as part of the root set. + (Amazingly, the result was still fast enough that the bug + was not conspicuous.) The fix works on OSF/1, version 1.3. + Hopefully it also works on other versions of OSF/1 ... + - Fixed a bug in GC_clear_roots. + - Fixed a bug in GC_generic_malloc_words_small that broke + gc_inl.h. (Reported by Antoine de Maricourt. I broke it + in trying to tweak the Mac port.) + - Fixed some problems with cord/de under Linux. + - Fixed some cord problems, notably with CORD_riter4. + - Added DG/UX port. + Thanks to Ben A. Mesander (ben@piglet.cr.usgs.gov) + - Added finalization registration routines with weaker ordering + constraints. (This is necessary for C++ finalization with + multiple inheritance, since the compiler often adds self-cycles.) + - Filled the holes in the SCO port. (Thanks to Michael Arnoldus + .) + - John Ellis' additions to the C++ support: From John: + + * I completely rewrote the documentation in the interface gc_c++.h + (later renamed gc_cpp.h). I've tried to make it both clearer and more + precise. + + * The definition of accessibility now ignores pointers from an + finalizable object (an object with a clean-up function) to itself. + This allows objects with virtual base classes to be finalizable by the + collector. Compilers typically implement virtual base classes using + pointers from an object to itself, which under the old definition of + accessibility prevented objects with virtual base classes from ever + being collected or finalized. + + * gc_cleanup now includes gc as a virtual base. This was enabled by + the change in the definition of accessibility. + + * I added support for operator new[]. Since most (all?) compilers + don't yet support operator new[], it is conditionalized on + -DOPERATOR_NEW_ARRAY. The code is untested, but its trivial and looks + correct. + + * The test program test_gc_c++ (later renamed test_cpp.cc) + tries to test for the C++-specific functionality not tested by the + other programs. + - Added include to misc.c. (Needed for ppcr.) + - Added PowerMac port. (Thanks to Patrick Beard again.) + - Fixed "srcdir"-related Makefile problems. Changed things so + that all externally visible include files always appear in the + include subdirectory of the source. Made gc.h directly + includable from C++ code. (These were at Per + Bothner's suggestion.) + - Changed Intel code to also mark from ebp (Kevin Warne's + suggestion). + - Renamed C++ related files so they could live in a FAT + file system. (Charles Fiterman's suggestion.) + - Changed Windows NT Makefile to include C++ support in + gc.lib. Added C++ test as Makefile target. + + Since version 4.3: + - ASM_CLEAR_CODE was erroneously defined for HP + PA machines, resulting in a compile error. + - Fixed OS/2 Makefile to create a library. (Thanks to + Mark Boulter (mboulter@vnet.ibm.com)). + - Gc_cleanup objects didn't work if they were created on + the stack. Fixed. + - One copy of Gc_cpp.h in the distribution was out of + synch, and failed to document some known compiler + problems with explicit destructor invocation. Partially + fixed. There are probably other compilers on which + gc_cleanup is miscompiled. + - Fixed Makefile to pass C compiler flags to C++ compiler. + - Added Mac fixes. + - Fixed os_dep.c to work around what appears to be + a new and different VirtualQuery bug under newer + versions of win32S. + - GC_non_gc_bytes was not correctly maintained by + GC_free. Fixed. Thanks to James Clark (jjc@jclark.com). + - Added GC_set_max_heap_size. + - Changed allocation code to ignore blacklisting if it is preventing + use of a very large block of memory. This has the advantage + that naive code allocating very large objects is much more + likely to work. The downside is you might no + longer find out that such code should really use + GC_malloc_ignore_off_page. + - Changed GC_printf under win32 to close and reopen the file + between calls. FAT file systems otherwise make the log file + useless for debugging. + - Added GC_try_to_collect and GC_get_bytes_since_gc. These + allow starting an abortable collection during idle times. + This facility does not require special OS support. (Thanks to + Michael Spertus of Geodesic Systems for suggesting this. It was + actually an easy addition. Kumar Srikantan previously added a similar + facility to a now ancient version of the collector. At the time + this was much harder, and the result was less convincing.) + - Added some support for the Borland development environment. (Thanks + to John Ellis and Michael Spertus.) + - Removed a misfeature from checksums.c that caused unexpected + heap growth. (Thanks to Scott Schwartz.) + - Changed finalize.c to call WARN if it encounters a finalization cycle. + WARN is defined in gc_priv.h to write a message, usually to stdout. + In many environments, this may be inappropriate. + - Renamed NO_PARAMS in gc.h to GC_NO_PARAMS, thus adhering to my own + naming convention. + - Added GC_set_warn_proc to intercept warnings. + - Fixed Amiga port. (Thanks to Michel Schinz (schinz@alphanet.ch).) + - Fixed a bug in mark.c that could result in an access to unmapped + memory from GC_mark_from_mark_stack on machines with unaligned + pointers. + - Fixed a win32 specific performance bug that could result in scanning of + objects allocated with the system malloc. + - Added REDIRECT_MALLOC. + + Since version 4.4: + - Fixed many minor and one major README bugs. (Thanks to Franklin Chen + (chen@adi.com) for pointing out many of them.) + - Fixed ALPHA/OSF/1 dynamic library support. (Thanks to Jonathan Bachrach + (jonathan@harlequin.com)). + - Added incremental GC support (MPROTECT_VDB) for Linux (with some + help from Bruno Haible). + - Altered SPARC recognition tests in gc.h and config.h (mostly as + suggested by Fergus Henderson). + - Added basic incremental GC support for win32, as implemented by + Windows NT and Windows 95. GC_enable_incremental is a noop + under win32s, which doesn't implement enough of the VM interface. + - Added -DLARGE_CONFIG. + - Fixed GC_..._ignore_off_page to also function without + -DALL_INTERIOR_POINTERS. + - (Hopefully) fixed RS/6000 port. (Only the test was broken.) + - Fixed a performance bug in the nonincremental collector running + on machines supporting incremental collection with MPROTECT_VDB + (e.g. SunOS 4, DEC AXP). This turned into a correctness bug under + win32s with win32 incremental collection. (Not all memory protection + was disabled.) + - Fixed some ppcr related bit rot. + - Caused dynamic libraries to be unregistered before reregistering. + The old way turned out to be a performance bug on some machines. + - GC_root_size was not properly maintained under MSWIN32. + - Added -DNO_DEBUGGING and GC_dump. + - Fixed a couple of bugs arising with SOLARIS_THREADS + + REDIRECT_MALLOC. + - Added NetBSD/M68K port. (Thanks to Peter Seebach + .) + - Fixed a serious realloc bug. For certain object sizes, the collector + wouldn't scan the expanded part of the object. (Thanks to Clay Spence + (cds@peanut.sarnoff.com) for noticing the problem, and helping me to + track it down.) + + Since version 4.5: + - Added Linux ELF support. (Thanks to Arrigo Triulzi .) + - GC_base crashed if it was called before any other GC_ routines. + This could happen if a gc_cleanup object was allocated outside the heap + before any heap allocation. + - The heap expansion heuristic was not stable if all objects had finalization + enabled. Fixed finalize.c to count memory in finalization queue and + avoid explicit deallocation. Changed alloc.c to also consider this count. + (This is still not recommended. It's expensive if nothing else.) Thanks + to John Ellis for pointing this out. + - GC_malloc_uncollectable(0) was broken. Thanks to Phong Vo for pointing + this out. + - The collector didn't compile under Linux 1.3.X. (Thanks to Fred Gilham for + pointing this out.) The current workaround is ugly, but expected to be + temporary. + - Fixed a formatting problem for SPARC stack traces. + - Fixed some '=='s in os_dep.c that should have been assignments. + Fortunately these were in code that should never be executed anyway. + (Thanks to Fergus Henderson.) + - Fixed the heap block allocator to only drop blacklisted blocks in small + chunks. Made BL_LIMIT self adjusting. (Both of these were in response + to heap growth observed by Paul Graham.) + - Fixed the Metrowerks/68K Mac code to also mark from a6. (Thanks + to Patrick Beard.) + - Significantly updated README.debugging. + - Fixed some problems with longjmps out of signal handlers, especially under + Solaris. Added a workaround for the fact that siglongjmp doesn't appear to + do the right thing with -lthread under Solaris. + - Added MSDOS/djgpp port. (Thanks to Mitch Harris (maharri@uiuc.edu).) + - Added "make reserved_namespace" and "make user_namespace". The + first renames ALL "GC_xxx" identifiers as "_GC_xxx". The second is the + inverse transformation. Note that doing this is guaranteed to break all + clients written for the other names. + - descriptor field for kind NORMAL in GC_obj_kinds with ADD_BYTE_AT_END + defined should be -ALIGNMENT not WORDS_TO_BYTES(-1). This is + a serious bug on machines with pointer alignment of less than a word. + - GC_ignore_self_finalize_mark_proc didn't handle pointers to very near the + end of the object correctly. Caused failures of the C++ test on a DEC Alpha + with g++. + - gc_inl.h still had problems. Partially fixed. Added warnings at the + beginning to hopefully specify the remaining dangers. + - Added DATAEND definition to config.h. + - Fixed some of the .h file organization. Fixed "make floppy". + + Since version 4.6: + - Fixed some compilation problems with -DCHECKSUMS (thanks to Ian Searle) + - Updated some Mac specific files to synchronize with Patrick Beard. + - Fixed a serious bug for machines with non-word-aligned pointers. + (Thanks to Patrick Beard for pointing out the problem. The collector + should fail almost any conceivable test immediately on such machines.) + + Since version 4.7: + - Changed a "comment" in a MacOS specific part of mach-dep.c that caused + gcc to fail on other platforms. + + Since version 4.8 + - More README.debugging fixes. + - Objects ready for finalization, but not finalized in the same GC + cycle, could be prematurely collected. This occasionally happened + in test_cpp. + - Too little memory was obtained from the system for very large + objects. That could cause a heap explosion if these objects were + not contiguous (e.g. under PCR), and too much of them was blacklisted. + - Due to an improper initialization, the collector was too hesitant to + allocate blacklisted objects immediately after system startup. + - Moved GC_arrays from the data into the bss segment by not explicitly + initializing it to zero. This significantly + reduces the size of executables, and probably avoids some disk accesses + on program startup. It's conceivable that it might break a port that I + didn't test. + - Fixed EMX_MAKEFILE to reflect the gc_c++.h to gc_cpp.h renaming which + occurred a while ago. + + Since 4.9: + - Fixed a typo around a call to GC_collect_or_expand in alloc.c. It broke + handling of out of memory. (Thanks to Patrick Beard for noticing.) + + Since 4.10: + - Rationalized (hopefully) GC_try_to_collect in an incremental collection + environment. It appeared to not handle a call while a collection was in + progress, and was otherwise too conservative. + - Merged GC_reclaim_or_delete_all into GC_reclaim_all to get rid of some + code. + - Added Patrick Beard's Mac fixes, with substantial completely untested + modifications. + - Fixed the MPROTECT_VDB code to deal with large pages and imprecise + fault addresses (as on an UltraSPARC running Solaris 2.5). Note that this + was not a problem in the default configuration, which uses PROC_VDB. + - The DEC Alpha assembly code needed to restore $gp between calls. + Thanks to Fergus Henderson for tracking this down and supplying a + patch. + - The write command for "de" was completely broken for large files. + I used the easiest portable fix, which involved changing the semantics + so that f.new is written instead of overwriting f. That's safer anyway. + - Added README.solaris2 with a discussion of the possible problems of + mixing the collector's sbrk allocation with malloc/realloc. + - Changed the data segment starting address for SGI machines. The + old code failed under IRIX6. + - Required double word alignment for MIPS. + - Various minor fixes to remove warnings. + - Attempted to fix some Solaris threads problems reported by Zhiying Chen. + In particular, the collector could try to fork a thread with the + world stopped as part of GC_thr_init. It also failed to deal with + the case in which the original thread terminated before the whole + process did. + - Added -DNO_EXECUTE_PERMISSION. This has a major performance impact + on the incremental collector under Irix, and perhaps under other + operating systems. + - Added some code to support allocating the heap with mmap. This may + be preferable under some circumstances. + - Integrated dynamic library support for HP. + (Thanks to Knut Tvedten .) + - Integrated James Clark's win32 threads support, and made a number + of changes to it, many of which were suggested by Pontus Rydin. + This is still not 100% solid. + - Integrated Alistair Crooks' support for UTS4 running on an Amdahl + 370-class machine. + - Fixed a serious bug in explicitly typed allocation. Objects requiring + large descriptors where handled in a way that usually resulted in + a segmentation fault in the marker. (Thanks to Jeremy Fitzhardinge + for helping to track this down.) + - Added partial support for GNU win32 development. (Thanks to Fergus + Henderson.) + - Added optional support for Java-style finalization semantics. (Thanks + to Patrick Bridges.) This is recommended only for Java implementations. + - GC_malloc_uncollectable faulted instead of returning 0 when out of + memory. (Thanks to dan@math.uiuc.edu for noticing.) + - Calls to GC_base before the collector was initialized failed on a + DEC Alpha. (Thanks to Matthew Flatt.) + - Added base pointer checking to GC_REGISTER_FINALIZER in debugging + mode, at the suggestion of Jeremy Fitzhardinge. + - GC_debug_realloc failed for uncollectable objects. (Thanks to + Jeremy Fitzhardinge.) + - Explicitly typed allocation could crash if it ran out of memory. + (Thanks to Jeremy Fitzhardinge.) + - Added minimal support for a DEC Alpha running Linux. + - Fixed a problem with allocation of objects whose size overflowed + ptrdiff_t. (This now fails unconditionally, as it should.) + - Added the beginning of Irix pthread support. + - Integrated Xiaokun Zhu's fixes for djgpp 2.01. + - Added SGI-style STL allocator support (gc_alloc.h). + - Fixed a serious bug in README.solaris2. Multithreaded programs must include + gc.h with SOLARIS_THREADS defined. + - Changed GC_free so it actually deallocates uncollectable objects. + (Thanks to Peter Chubb for pointing out the problem.) + - Added Linux ELF support for dynamic libararies. (Thanks again to + Patrick Bridges.) + - Changed the Borland cc configuration so that the assembler is not + required. + - Fixed a bug in the C++ test that caused it to fail in 64-bit + environments. + + Since 4.11: + - Fixed ElfW definition in dyn_load.c. (Thanks to Fergus Henderson.) + This prevented the dynamic library support from compiling on some + older ELF Linux systems. + - Fixed UTS4 port (which I apparently mangled during the integration) + (Thanks to again to Alistair Crooks.) + - "Make C++" failed on Suns with SC4.0, due to a problem with "bool". + Fixed in gc_priv.h. + - Added more pieces for GNU win32. (Thanks to Timothy N. Newsham.) + The current state of things should suffice for at least some + applications. + - Changed the out of memory retry count handling as suggested by + Kenjiro Taura. (This matters only if GC_max_retries > 0, which + is no longer the default.) + - If a /proc read failed repeatedly, GC_written_pages was not updated + correctly. (Thanks to Peter Chubb for diagnosing this.) + - Under unlikely circumstances, the allocator could infinite loop in + an out of memory situation. (Thanks again to Kenjiro Taura for + identifying the problem and supplying a fix.) + - Fixed a syntactic error in the DJGPP code. (Thanks to Fergus + Henderson for finding this by inspection.) Also fixed a test program + problem with DJGPP (Thanks to Peter Monks.) + - Atomic uncollectable objects were not treated correctly by the + incremental collector. This resulted in weird log statistics and + occasional performance problems. (Thanks to Peter Chubb for pointing + this out.) + - Fixed some problems resulting from compilers that dont define + __STDC__. In this case void * and char * were used inconsistently + in some cases. (Void * should not have been used at all. If + you have an ANSI superset compiler that does not define __STDC__, + please compile with -D__STDC__=0. Thanks to Manuel Serrano and others + for pointing out the problem.) + - Fixed a compilation problem on Irix with -n32 and -DIRIX_THREADS. + Also fixed some other IRIX_THREADS problems which may or may not have + had observable symptoms. + - Fixed an HP PA compilation problem in dyn_load.c. (Thanks to + Philippe Queinnec.) + - SEGV fault handlers sometimes did not get reset correctly. (Thanks + to David Pickens.) + - Added a fix for SOLARIS_THREADS on Intel. (Thanks again to David + Pickens.) This probably needs more work to become functional. + - Fixed struct sigcontext_struct in os_dep.c for compilation under + Linux 2.1.X. (Thanks to Fergus Henderson.) + - Changed the DJGPP STACKBOTTOM and DATASTART values to those suggested + by Kristian Kristensen. These may still not be right, but it is + it is likely to work more often than what was there before. They may + even be exactly right. + - Added a #include to test_cpp.cc. This appears to help + with HP/UX and gcc. (Thanks to assar@sics.se.) + - Version 4.11 failed to run in incremental mode on recent 64-bit Irix + kernels. This was a problem related to page unaligned heap segments. + Changed the code to page align heap sections on all platforms. + (I had mistakenly identified this as a kernel problem earlier. + It was not.) + - Version 4.11 did not make allocated storage executable, except on + one or two platforms, due to a bug in a #if test. (Thanks to Dave + Grove for pointing this out.) + - Added sparc_sunos4_mach_dep.s to support Sun's compilers under SunOS4. + - Added GC_exclude_static_roots. + - Fixed the object size mapping algorithm. This shouldn't matter, + but the old code was ugly. + - Heap checking code could die if one of the allocated objects was + larger than its base address. (Unsigned underflow problem. Thanks + to Clay Spence for isolating the problem.) + - Added RS6000 (AIX) dynamic library support and fixed STACK_BOTTOM. + (Thanks to Fred Stearns.) + - Added Fergus Henderson's patches for improved robustness with large + heaps and lots of blacklisting. + - Added Peter Chubb's changes to support Solaris Pthreads, to support + MMAP allocation in Solaris, to allow Solaris to find dynamic libraries + through /proc, to add malloc_typed_ignore_off_page, and a few other + minor features and bug fixes. + - The Solaris 2 port should not use sbrk. I received confirmation from + Sun that the use of sbrk and malloc in the same program is not + supported. The collector now defines USE_MMAP by default on Solaris. + - Replaced the djgpp makefile with Gary Leavens' version. + - Fixed MSWIN32 detection test. + - Added Fergus Henderson's patches to allow putting the collector into + a DLL under GNU win32. + - Added Ivan V. Demakov's port to Watcom C on X86. + - Added Ian Piumarta's Linux/PowerPC port. + - On Brian Burton's suggestion added PointerFreeGC to the placement + options in gc_cpp.h. This is of course unsafe, and may be controversial. + On the other hand, it seems to be needed often enough that it's worth + adding as a standard facility. + + Since 4.12: + - Fixed a crucial bug in the Watcom port. There was a redundant decl + of GC_push_one in gc_priv.h. + - Added FINALIZE_ON_DEMAND. + - Fixed some pre-ANSI cc problems in test.c. + - Removed getpagesize() use for Solaris. It seems to be missing in one + or two versions. + - Fixed bool handling for SPARCCompiler version 4.2. + - Fixed some files in include that had gotten unlinked from the main + copy. + - Some RS/6000 fixes (missing casts). Thanks to Toralf Foerster. + - Fixed several problems in GC_debug_realloc, affecting mostly the + FIND_LEAK case. + - GC_exclude_static_roots contained a buggy unsigned comparison to + terminate a loop. (Thanks to Wilson Ho.) + - CORD_str failed if the substring occurred at the last possible position. + (Only affects cord users.) + - Fixed Linux code to deal with RedHat 5.0 and integrated Peter Bigot's + os_dep.c code for dealing with various Linux versions. + - Added workaround for Irix pthreads sigaction bug and possible signal + misdirection problems. + Since alpha1: + - Changed RS6000 STACKBOTTOM. + - Integrated Patrick Beard's Mac changes. + - Alpha1 didn't compile on Irix m.n, m < 6. + - Replaced Makefile.dj with a new one from Gary Leavens. + - Added Andrew Stitcher's changes to support SCO OpenServer. + - Added PRINT_BLACK_LIST, to allow debugging of high densities of false + pointers. + - Added code to debug allocator to keep track of return address + in GC_malloc caller, thus giving a bit more context. + - Changed default behavior of large block allocator to more + aggressively avoid fragmentation. This is likely to slow down the + collector when it succeeds at reducing space cost. + - Integrated Fergus Henderson's CYGWIN32 changes. They are untested, + but needed for newer versions. + - USE_MMAP had some serious bugs. This caused the collector to fail + consistently on Solaris with -DSMALL_CONFIG. + - Added Linux threads support, thanks largely to Fergus Henderson. + Since alpha2: + - Fixed more Linux threads problems. + - Changed default GC_free_space_divisor to 3 with new large block allocation. + (Thanks to Matthew Flatt for some measurements that suggest the old + value sometimes favors space too much over time.) + - More CYGWIN32 fixes. + - Integrated Tyson-Dowd's Linux-M68K port. + - Minor HP PA and DEC UNIX fixes from Fergus Henderson. + - Integrated Christoffe Raffali's Linux-SPARC changes. + - Allowed for one more GC fixup iteration after a full GC in incremental + mode. Some quick measurements suggested that this significantly + reduces pause times even with smaller GC_RATE values. + - Moved some more GC data structures into GC_arrays. This decreases + pause times and GC overhead, but makes debugging slightly less convenient. + - Fixed namespace pollution problem ("excl_table"). + - Made GC_incremental a constant for -DSMALL_CONFIG, hopefully shrinking + that slightly. + - Added some win32 threads fixes. + - Integrated Ivan Demakov and David Stes' Watcom fixes. + - Various other minor fixes contributed by many people. + - Renamed config.h to gcconfig.h, since config.h tends to be used for + many other things. + - Integrated Matthew Flatt's support for 68K MacOS "far globals". + - Fixed up some of the dynamic library Makefile targets for consistency + across platforms. + - Fixed a USE_MMAP typo that caused out-of-memory handling to fail + on Solaris. + - Added code to test.c to test thread creation a bit more. + - Integrated GC_win32_free_heap, as suggested by Ivan Demakov. + - Fixed Solaris 2.7 stack base finding problem. (This may actually + have been done in an earlier alpha release.) + Since alpha3: + - Fixed MSWIN32 recognition test, which interfered with cygwin. + - Removed unnecessary gc_watcom.asm from distribution. Removed + some obsolete README.win32 text. + - Added Alpha Linux incremental GC support. (Thanks to Philipp Tomsich + for code for retrieving the fault address in a signal handler.) + Changed Linux signal handler context argument to be a pointer. + - Took care of some new warnings generated by the 7.3 SGI compiler. + - Integrated Phillip Musumeci's FreeBSD/ELF fixes. + - -DIRIX_THREADS was broken with the -o32 ABI (typo in gc_priv.h> + + Since 4.13: + - Fixed GC_print_source_ptr to not use a prototype. + - generalized CYGWIN test. + - gc::new did the wrong thing with PointerFreeGC placement. + (Thanks to Rauli Ruohonen.) + - In the ALL_INTERIOR_POINTERS (default) case, some callee-save register + values could fail to be scanned if the register was saved and + reused in a GC frame. This showed up in verbose mode with gctest + compiled with an unreleased SGI compiler. I vaguely recall an old + bug report that may have been related. The bug was probably quite old. + (The problem was that the stack scanning could be deferred until + after the relevant frame was overwritten, and the new save location + might be outside the scanned area. Fixed by more eager stack scanning.) + - PRINT_BLACK_LIST had some problems. A few source addresses were garbage. + - Replaced Makefile.dj and added -I flags to cord make targets. + (Thanks to Gary Leavens.) + - GC_try_to_collect was broken with the nonincremental collector. + - gc_cleanup destructors could pass the wrong address to + GC_register_finalizer_ignore_self in the presence of multiple + inheritance. (Thanks to Darrell Schiebel.) + - Changed PowerPC Linux stack finding code. + + Since 4.14alpha1 + - -DSMALL_CONFIG did not work reliably with large (> 4K) pages. + Recycling the mark stack during expansion could result in a size + zero heap segment, which confused things. (This was probably also an + issue with the normal config and huge pages.) + - Did more work to make sure that callee-save registers were scanned + completely, even with the setjmp-based code. Added USE_GENERIC_PUSH_REGS + macro to facilitate testing on machines I have access to. + - Added code to explicitly push register contents for win32 threads. + This seems to be necessary. (Thanks to Pierre de Rop.) + + Since 4.14alpha2 + - changed STACKBOTTOM for DJGPP (Thanks to Salvador Eduardo Tropea). + + Since 4.14 + - Reworked large block allocator. Now uses multiple doubly linked free + lists to approximate best fit. + - Changed heap expansion heuristic. Entirely free blocks are no longer + counted towards the heap size. This seems to have a major impact on + heap size stability; the old version could expand the heap way too + much in the presence of large block fragmentation. + - added -DGC_ASSERTIONS and some simple assertions inside the collector. + This is mainlyt for collector debugging. + - added -DUSE_MUNMAP to allow the heap to shrink. Suupported on only + a few UNIX-like platforms for now. + - added GC_dump_regions() for debugging of fragmentation issues. + - Changed PowerPC pointer alignment under Linux to 4. (This needs + checking by someone who has one. The suggestions came to me via a + rather circuitous path.) + - Changed the Linux/Alpha port to walk the data segment backwards until + it encounters a SIGSEGV. The old way to find the start of the data + segment broke with a recent release. + - cordxtra.c needed to call GC_REGISTER_FINALIZER instead of + GC_register_finalizer, so that it would continue to work with GC_DEBUG. + - allochblk sometimes cleared the wrong block for debugging purposes + when it dropped blacklisted blocks. This could result in spurious + error reports with GC_DEBUG. + - added MACOS X Server support. (Thanks to Andrew Stone.) + - Changed the Solaris threads code to ignore stack limits > 8 MB with + a warning. Empirically, it is not safe to access arbitrary pages + in such large stacks. And the dirty bit implementation does not + guarantee that none of them will be accessed. + - Integrated Martin Tauchmann's Amiga changes. + - Integrated James Dominy's OpenBSD/SPARC port. + + Since 5.0alpha1 + - Fixed bugs introduced in alpha1 (OpenBSD & large block initialization). + - Added -DKEEP_BACK_PTRS and backptr.h interface. (The implementation + idea came from Al Demers.) + + Since 5.0alpha2 + - Added some highly incomplete code to support a copied young generation. + Comments on nursery.h are appreciated. + - Changed -DFIND_LEAK, -DJAVA_FINALIZATION, and -DFINALIZE_ON_DEMAND, + so the same effect could be obtained with a runtime switch. This is + a step towards standardizing on a single dynamic GC library. + - Significantly changed the way leak detection is handled, as a consequence + of the above. + + Since 5.0 alpha3 + - Added protection fault handling patch for Linux/M68K from Fergus + Henderson and Roman Hodek. + - Removed the tests for SGI_SOURCE in new_gc_alloc.h. This was causing that + interface to fail on nonSGI platforms. + - Changed the Linux stack finding code to use /proc, after changing it + to use HEURISTIC1. (Thanks to David Mossberger for pointing out the + /proc hook.) + - Added HP/UX incremental GC support and HP/UX 11 thread support. + Thread support is currently still flakey. + - Added basic Linux/IA64 support. + - Integrated Anthony Green's PicoJava support. + - Integrated Scott Ananian's StrongARM/NetBSD support. + - Fixed some fairly serious performance bugs in the incremental + collector. These have probably been there essentially forever. + (Mark bits were sometimes set before scanning dirty pages. + The reclaim phase unnecessarily dirtied full small object pages.) + - Changed the reclaim phase to ignore nearly full pages to avoid + touching them. + - Limited GC_black_list_spacing to roughly the heap growth increment. + - Changed full collection triggering heuristic to decrease full GC + frequency by default, but to explicitly trigger full GCs during + heap growth. This doesn't always improve things, but on average it's + probably a win. + - GC_debug_free(0, ...) failed. Thanks to Fergus Henderson for the + bug report and fix. + + Since 5.0 alpha4 + - GC_malloc_explicitly_typed and friends sometimes failed to + initialize first word. + - Added allocation routines and support in the marker for mark descriptors + in a type structure referenced by the first word of an object. This was + introduced to support gcj, but hopefully in a way that makes it + generically useful. + - Added GC_requested_heapsize, and inhibited collections in nonincremental + mode if the actual used heap size is less than what was explicitly + requested. + - The Solaris pthreads version of GC_pthread_create didn't handle a NULL + attribute pointer. Solaris thread support used the wrong default thread + stack size. (Thanks to Melissa O'Neill for the patch.) + - Changed PUSH_CONTENTS macro to no longer modify first parameter. + This usually doesn't matter, but it was certainly an accident waiting + to happen ... + - Added GC_register_finalizer_no_order and friends to gc.h. They're + needed by Java implementations. + - Integrated a fix for a win32 deadlock resulting from clock() calling + malloc. (Thanks to Chris Dodd.) + - Integrated Hiroshi Kawashima's port to Linux/MIPS. This was designed + for a handheld platform, and may or may not be sufficient for other + machines. + - Fixed a va_arg problem with the %c specifier in cordprnt.c. It appears + that this was always broken, but recent versions of gcc are the first to + report the (statically detectable) bug. + - Added an attempt at a more general solution to dlopen races/deadlocks. + GC_dlopen now temporarily disables collection. Still not ideal, but ... + - Added -DUSE_I686_PREFETCH, -DUSE_3DNOW_PREFETCH, and support for IA64 + prefetch instructions. May improve performance measurably, but I'm not + sure the code will run correctly on processors that don't support the + instruction. Won't build except with very recent gcc. + - Added caching for header lookups in the marker. This seems to result + in a barely measurable performance gain. Added support for interleaved + lookups of two pointers, but unconfigured that since the performance + gain is currently near zero, and it adds to code size. + - Changed Linux DATA_START definition to check both data_start and + __data_start, since nothing else seems to be portable. + - Added -DUSE_LD_WRAP to optionally take advantage of the GNU ld function + wrapping mechanism. Probably currently useful only on Linux. + - Moved some variables for the scratch allocator into GC_arrays, on + Martin Hirzel's suggestion. + - Fixed a win32 threads bug that caused the collector to not look for + interior pointers from one of the thread stacks without + ALL_INTERIOR_POINTERS. (Thanks to Jeff Sturm.) + - Added Mingw32 support. (Thanks again to Jeff Sturm for the patch.) + - Changed the alpha port to use the generic register scanning code instead + of alpha_mach_dep.s. Alpha_mach_dep.s doesn't look for pointers in fp + registers, but gcc sometimes spills pointers there. (Thanks to Manuel + Serrano for helping me debug this by email.) Changed the IA64 code to + do something similar for similar reasons. + + [5.0alpha5 doesn't really exist, but it may have escaped.] + + Since 5.0alpha6: + - -DREDIRECT_MALLOC was broken in alpha6. Fixed. + - Cleaned up gc_ccp.h slightly, thus also causing the HP C++ compiler to + accept it. + - Removed accidental reference to dbg_mlc.c, which caused dbg_mlc.o to be + linked into every executable. + - Added PREFETCH to bitmap marker. Changed it to use the header cache. + - GC_push_marked sometimes pushed one object too many, resulting in a + segmentation fault in GC_mark_from_mark_stack. This was probably an old + bug. It finally showed up in gctest on win32. + - Gc_priv.h erroneously #defined GC_incremental to be TRUE instead of FALSE + when SMALL_CONFIG was defined. This was no doubt a major performance bug for + the default win32 configuration. + - Removed -DSMALL_CONFIG from NT_MAKEFILE. It seemed like an anchronism now + that the average PC has 64MB or so. + - Integrated Bryce McKinley's patches for linux threads and dynamic loading + from the libgcj tree. Turned on dynamic loading support for Linux/PPC. + - Changed the stack finding code to use environ on HP/UX. (Thanks + to Gustavo Rodriguez-Rivera for the suggestion.) This should probably + be done on other platforms, too. Since I can't test those, that'll + wait until after 5.0. + + Since 5.0alpha7: + - Fixed threadlibs.c for linux threads. -DUSE_LD_WRAP was broken and + -ldl was omitted. Fixed Linux stack finding code to handle + -DUSE_LD_WRAP correctly. + - Added MSWIN32 exception handler around marker, so that the collector + can recover from root segments that are unmapped during the collection. + This caused occasional failures under Windows 98, and may also be + an issue under Windows NT/2000. + + Since 5.0 + - Fixed a gc.h header bug which showed up under Irix. (Thanks to + Dan Sullivan.) + - Fixed a typo in GC_double_descr in typd_mlc.c. + This probably could result in objects described by array descriptors not + getting traced correctly. (Thanks to Ben Hutchings for pointing this out.) + - The block nearly full tests in reclaim.c were not correct for 64 bit + environments. This could result in unnecessary heap growth under unlikely + conditions. + + Since 5.1 + - dyn_load.c declared GC_scratch_last_end_ptr as an extern even if it + was defined as a macro. This prevented the collector from building on + Irix. + - We quietly assumed that indirect mark descriptors were never 0. + Our own typed allocation interface violated that. This could result + in segmentation faults in the marker with typed allocation. + - Fixed a _DUSE_MUNMAP bug in the heap block allocation code. + (Thanks to Ben Hutchings for the patch.) + - Taught the collector about VC++ handling array operator new. + (Thanks again to Ben Hutchings for the patch.) + - The two copies of gc_hdrs.h had diverged. Made one a link to the other + again. + + Since 5.2 (A few 5.2 patches are not in 6.0alpha1) + - Fixed _end declaration for OSF1. + - There were lots of spurious leak reports in leak detection mode, caused + by the fact that some pages were not being swept, and hence unmarked + objects weren't making it onto free lists. (This bug dated back to 5.0.) + - Fixed a typo in the liblinuxgc.so Makefile rule. + - Added the GetExitCodeThread to Win32 GC_stop_world to (mostly) work + around a Windows 95 GetOpenFileName problem. (Thanks to Jacob Navia.) + + Since 5.3 + - Fixed a typo that prevented compilation with -DUSE_3DNOW_PREFETCH. + (Thanks to Shawn Wagner for actually testing this.) + - Fixed GC_is_thread_stack in solaris_threads.c. It forgot to return a value + in the common case. I wonder why nobody noticed? + - Fixed another silly syntax problem in GC_double_descr. (Thanks to + Fergus Henderson for finding it.) + - Fixed a GC_gcj_malloc bug: It tended to release the allocator lock twice. + + Since 5.4 (A few 5.3 patches are not in 6.0alpha2) + - Added HP/PA prefetch support. + - Added -DDBG_HDRS_ALL and -DSHORT_DBG_HDRS to reduce the cost and improve + the reliability of generating pointer backtrace information, e.g. in + the Bigloo environment. + - Added parallel marking support (-DPARALLEL_MARK). This currently + works only under IA32 and IA64 Linux, but it shouldn't be hard to adapt + to other platforms. This is intended to be a lighter-weight (less + new code, probably not as scalable) solution than the work by Toshio Endo + et al, at the University of Tokyo. A number of their ideas were + reused, though the code wasn't, and the underlying data structure + is significantly different. In particular, we keep the global mark + stack as a single shared data structure, but most of the work is done + on smaller thread-local mark stacks. + - Changed GC_malloc_many to be cheaper, and to require less mutual exclusion + with -DPARALLEL_MARK. + - Added full support for thread local allocation under Linux + (-DTHREAD_LOCAL_ALLOC). This is a thin veneer on GC_malloc_many, and + should be easily portable to other platforms, especially those that + support pthreads. + - CLEAR_DOUBLE was not always getting invoked when it should have been. + - GC_gcj_malloc and friends used different out of memory handling than + everything else, probably because I forgot about one when I implemented + the other. They now both call GC_oom_fn(), not GC_oom_action(). + - Integrated Jakub Jelinek's fixes for Linux/SPARC. + - Moved GC_objfreelist, GC_aobjfreelist, and GC_words_allocd out of + GC_arrays, and separately registered the first two as excluded roots. + This makes code compiled with gc_inl.h less dependent on the + collector version. (It would be nice to remove the inclusion of + gc_priv.h by gc_inl.h completely, but we're not there yet. The + locking definitions in gc_priv.h are still referenced.) + This change was later coniditoned on SEPARATE_GLOBALS, which + is not defined by default, since it involves a performance hit. + - Register GC_obj_kinds separately as an excluded root region. The + attempt to register it with GC_arrays was usually failing. (This wasn't + serious, but seemed to generate some confusion.) + - Moved backptr.h to gc_backptr.h. + + Since 6.0alpha1 + - Added USE_MARK_BYTES to reduce the need for compare-and-swap on platforms + for which that's expensive. + - Fixed a locking bug ib GC_gcj_malloc and some locking assertion problems. + - Added a missing volatile to OR_WORD and renamed the parameter to + GC_compare_and_swap so it's not a C++ reserved word. (Thanks to + Toshio Endo for pointing out both of those.) + - Changed Linux dynamic library registration code to look at /proc/self/maps + instead of the rld data structures when REDIRECT_MALLOC is defined. + Otherwise some of the rld data data structures may be prematurely garbage + collected. (Thanks to Eric Benson for helping to track this down.) + - Fixed USE_LD_WRAP a bit more, so it should now work without threads. + - Renamed XXX_THREADS macros to GC_XXX_THREADS for namespace correctness. + Tomporarily added some backward compatibility definitions. Renamed + USE_LD_WRAP to GC_USE_LD_WRAP. + - Many MACOSX POWERPC changes, some additions to the gctest output, and + a few minor generic bug fixes. (Thanks to Dietmar Planitzer.) + + Since 6.0 alpha2 + - Fixed the /proc/self/maps code to not seek, since that apparently is not + reliable across all interesting kernels. + - Fixed some compilation problems in the absence of PARALLEL_MARK + (introduced in alpha2). + - Fixed an algorithmic problem with PARALLEL_MARK. If work needs to + be given back to the main mark "stack", the BOTTOM entries of the local + stack should be given away, not the top ones. This has substantial + performance impact, especially for > 2 processors, from what I can tell. + - Extracted gc_lock.h from gc_priv.h. This should eventually make it a + bit easier to avoid including gc_priv.h in clients. + - Moved all include files to include/ and removed duplicate links to the + same file. The old scheme was a bad idea because it was too easy to get the + copies out of sync, and many systems don't support hard links. + Unfortunately, it's likely that I broke some of the non-Unix Makefiles in + the process, although I tried to update them appropriately. + - Removed the partial support for a copied nursery. It's not clear that + this would be a tremendous win, since we don't consistently lose to + generational copying collectors. And it would significantly complicate + many things. May be reintroduced if/when it really turns out to win. + - Removed references to IRIX_JDK_THREADS, since I believe there never + were and never will be any clients. + - Added some code to linux_threads.c to possibly support HPUX threads + using the Linux code. Unfortunately, it doesn't work yet, and is + currently disabled. + - Added support under Linux/X86 for saving the call chain, both in (debug) + objects for client debugging, and in GC_arrays._last_stack for GC + debugging. This was previously supported only under Solaris. It is + not enabled by default under X86, since it requires that code be compiled + to explicitly dave frame pointers on the call stack. (With gcc this + currently happens by default, but is often turned off explicitly.) + To turn it on, define SAVE_CALL_CHAIN. + + Since 6.0 alpha3 + - Moved up the detection of mostly full blocks to the initiatiation of the + sweep phase. This eliminates some lock conention in the PARALLEL_MARK case, + as multiple threads try to look at mostly full blocks concurrently. + - Restored the code in GC_malloc_many that grabs a prefix of the global + free list. This avoids the case in which every GC_malloc_many call + tries and fails to allocate a new heap block, and the returns a single + object from the global free list. + - Some minor fixes in new_hblk.c. (Attempted to build free lists in order + of increasing addresses instead of decreasing addresses for cache performance + reasons. But this seems to be only a very minor gain with -DEAGER_SWEEP, + and a loss in other cases. So the change was backed out.) + - Fixed some of the documentation. (Thanks in large part to Fergus + Henderson.) + - Fixed the Linux USE_PROC_FOR_LIBRARIES code to deal with apps that perform + large numbers of mmaps. (Thanks to Eric Benson.) Also fixed that code to + deal with short reads. + - Added GC_get_total_bytes(). + - Fixed leak detection mode to avoid spurious messages under linuxthreads. + (This should also now be easy for the other supported threads packages. + But the code is tricky enough that I'm hesitant to do it without being able + to test. Everything allocated in the GC thread support itself should be + explicitly deallocated.) + - Made it possible (with luck) to redirect malloc to GC_local_malloc. + + Since 6.0 alpha4 + - Changed the definition of GC_pause in linux_threads.c to use a volatile + asm. Some versions of gcc apparently optimize away writes to local volatile + variables. This caused poor locking behaviour starting at about + 4 processors. + - Added GC_start_blocking(), GC_end_blocking() calls and wrapper for sleep + to linux_threads.c. + The first two calls could be used to generally avoid sending GC signals to + blocked threads, avoiding both premature wakeups and unnecessary overhead. + - Fixed a serious bug in thread-local allocation. At thread termination, + GC_free could get called on small integers. Changed the code for thread + termination to more efficiently return left-over free-lists. + - Integrated Kjetil Matheussen's BeOS support. + - Rearranged the directory structure to create the doc and tests + subdirectories. + - Sort of integrated Eric Benson's patch for OSF1. This provided basic + OSF1 thread support by suitably extending hpux_irix_threads.c. Based + on earlier email conversations with David Butenhof, I suspect that it + will be more reliable in the long run to base this on linux_threads.c + instead. Thus I attempted to patch up linux_threads.c based on Eric's code. + The result is almost certainly broken, but hopefully close enough that + someone with access to a machine can pick it up. + - Integrated lots of minor changes from the NetBSD distribution. (These + were supplied by David Brownlee. I'm not sure about the original + authors.) + - Hacked a bit more on the HP/UX thread-support in linux_threads.c. It + now appears to work in the absence of incremental collection. Renamed + hpux_irix_threads.c back to irix_threads.c, and removed the attempt to + support HPUX there. + - Changed gc.h to define _REENTRANT in cases in which it should already + have been defined. It is still safer to also define it on the command + line. + + Since 6.0alpha5: + - Changed the definition of DATASTART on ALPHA and IA64, where data_start + and __data_start are not defined by earlier versions of glibc. This might + need to be fixed on other platforms as well. + - Changed the way the stack base and backing store base are found on IA64. + This should now remain reliable on future kernels. But since it relies + on /proc, it will no longer work in the simulated NUE environment. + - Made the call to random() in dbg_mlc.c with -DKEEP_BACK_PTRS dependent + on the OS. On non-Unix systems, rand() should be used instead. Handled + small RAND_MAX. (Thanks to Peter Ross for pointing this out.) + - Fixed the cord make rules to create the cord subdirectory, if necessary. + (Thanks to Doug Moen.) + - Changed fo_object_size calculation in finalize.c. Turned finalization + of nonheap object into a no-op. Removed anachronism from GC_size() + implementation. + - Changed GC_push_dirty call in solaris_threads.c to GC_push_selected. + It was missed in a previous renaming. (Thanks to Vladimir Tsichevski + for pointing this out.) + - Arranged to not not mask SIGABRT in linux_threads.c. (Thanks to Bryce + McKinlay.) + - Added GC_no_dls hook for applications that want to register their own + roots. + - Integrated Kjetil Matheussen's Amiga changes. + - Added FREEBSD_STACKBOTTOM. Changed the X86/FreeBSD port to use it. + (Thanks to Matthew Flatt.) + - Added pthread_detach interception for platforms supported by linux_threads.c + and irix_threads.c. Should also be added for Solaris? + - Changed the USE_MMAP code to check for the case in which we got the + high end of the address space, i.e. mem_ptr + mem_sz == 0. It appears + that this can happen under Solaris 7. It seems to be allowed by what + I would claim is an oversight in the mmap specification. (Thanks to Toshio + Endo for pointing out the problem.) + - Cleanup of linux_threads.c. Some code was originally cloned from + irix_threads.c and now unnecessary. Some comments were obviously wrong. + - (Mostly) fixed a longstanding problem with setting of dirty bits from + a signal handler. In the presence of threads, dirty bits could get lost, + since the etting of a bit in the bit vector was not atomic with respect + to other updates. The fix is 100% correct only for platforms for which + GC_test_and_set is defined. The goal is to make that all platforms with + thread support. Matters only if incremental GC and threads are both + enabled. + - made GC_all_interior_pointers (a.k.a. ALL_INTERIOR_POINTERS) an + initialization time, instead of build-time option. This is a + nontrivial, high risk change. It should slow down the code measurably + only if MERGE_SIZES is not defined, which is a very nonstandard + configuration. + - Added doc/README.environment, and implemented what it describes. This + allows a number of additional configuration options to be set through + the environment. It documents a few previously undocumented options. + - Integrated Eric Benson's leak testing improvements. + - Removed the option to throw away the beginning of each page (DISCARD_WORDS). + This became less and less useful as processors enforce stricter alignment. + And it hadn't been tested in ages, and was thus probably broken anyway. + + Since 6.0alpha6: + - Added GC_finalizer_notifier. Fixed GC_finalize_on_demand. (The variable + actually wasn't being tested at the right points. The build-time flag + was.) + - Added Tom Tromey's S390 Linux patch. + - Added code to push GC_finalize_now in GC_push_finalizer_structures. + (Thanks to Matthew Flatt.) + - Added GC_push_gc_structures() to push all GC internal roots. + - Integrated some FreeBSD changes from Matthew Flatt. + - It looks like USRSTACK is not always correctly defined under Solaris. + Hacked gcconfig.h to attempt to work around the problem. The result + is not well tested. (Thanks again to Matthew Flatt for pointing this + out. The gross hack is mine. - HB) + - Added Ji-Yong Chung's win32 threads and C++ fixes. + - Arranged for hpux_test_and_clear.s to no longer be needed or built. + It was causing build problems with gas, and it's not clear this is + better than the pthreads alternative on this platform. + - Some MINGW32 fixes from Hubert Garavel. + - Added Initial Hitachi SH4 port from Kaz Kojima. + - Ported thread-local allocation and parallel mark code to HP/UX on PA_RISC. + - Made include/gc_mark.h more public and separated out the really private + pieces. This is probably still not quite sufficient for clients that + want to supply their own kind of type information. But it's a start. + This involved lots of identifier renaming to make it namespace clean. + - Added GC_dont_precollect for clients that need complete control over + the root set. + - GC_is_visible didn't do the right thing with gcj objects. (Not that + many people are likely to care, but ...) + - Don't redefine read with GC_USE_LD_WRAP. + - Initial port to LINUX/HP_PA. Incremental collection and threads are not + yet supported. (Incremental collection should work if you have the + right kernel. Threads may work with a sufficiently patched pthread + library.) + - Changed gcconfig.h to recognize __i386__ as an alternative to i386 in + many places. (Thanks to Benjamin Lerman.) + - Made win32_threads.c more tolerant of detaching a thread that it didn't + know about. (Thanks to Paul Nash.) + - Added Makefile.am and configure.in from gcc to the distribution, with + minimal changes. For the moment, those are just placeholders. In the + future, we're planning to switch to a GNU-style build environment for + Un*x-like systems, though the old Makefile will remain as a backup. + - Turned off STUBBORN_ALLOC by default, and added it back as a Makefile + option. + - Redistributed some functions between malloc.c and mallocx.c, so that + simple statically linked apps no longer pull in mallocx.o. + - Changed large object allocation to clear the first and last few words + of each block before releassing the lock. Otherwise the marker could see + objects with nonsensical type descriptors. + - Fixed a couple of subtle problems that could result in not recognizing + interior pointers from the stack. (I believe these were introduced + in 6.0alpha6.) + - GC_debug_free_inner called GC_free, which tried to reacquire the + allocator lock, and hence deadlocked. (DBG_HDRS_ALL probably never worked + with threads?) + - Fixed several problems with back traces. Accidental references to a free + list could cause the free list pointer to be overwritten by a back pointer. + There seemed to be some problems with the encoding of root and finalizer + references. + + Since 6.0alpha7: + - Changed GC_debug_malloc_replacement and GC_debug_realloc_replacement + so that they compile under Irix. (Thanks to Dave Love.) + - Updated powerpc_macosx_mach_dep.s so that it works if the collector + is in a dynamic library. (Thanks to Andrew Begel.) + - Transformed README.debugging into debugging.html, updating and + expanding it in the process. Added gcdescr.html and tree.html + from the web site to the GC distribution. + - Fixed several problems related to PRINT_BLACK_LIST. This involved + restructuring some of the marker macros. + - Fixed some problems with the sizing of objects with debug information. + Finalization was broken KEEP_BACK_PTRS or PRINT_BLACK_LIST. Reduced the + object size with SHORT_DEBUG_HDRS by another word. + - The "Needed to allocate blacklisted ..." warning had inadvertently + been turned off by default, due to a buggy test in allchblk.c. Turned + it back on. + - Removed the marker macros to deal with 2 pointers in interleaved fashion. + They were messy and the performance improvement seemed minimal. We'll + leave such scheduling issues to the compiler. + - Changed Linux/PowerPC test to also check for __powerpc__ in response + to a discussion on the gcc mailing list. + - On Matthew Flatt's suggestion removed the "static" from the jmp_buf + declaration in GC_generic_push_regs. This was causing problems in + systems that register all of their own roots. It looks far more correct + to me without the "static" anyway. + - Fixed several problems with thread local allocation of pointerfree or + typed objects. The collector was reclaiming thread-local free lists, since + it wasn't following the link fields. + - There was apparently a long-standing race condition related to multithreaded + incremental collection. A collection could be started and a thread stopped + between the memory unprotect system call and the setting of the + corresponding dirt bit. I believe this did not affect Solaris or PCR, which + use a different dirty-bit implementation. Fixed this by installing + signal handlers with sigaction instead of signal, and disabling the thread + suspend signal while in the write-protect handler. (It is unclear + whether this scenario ever actually occurred. I found it while tracking + down the following:) + - Incremental collection did not cooperate correctly with the PARALLEL_MARK + implementation of GC_malloc_many or the local_malloc primitves. It still + doesn't work well, but it shouldn't lose memory anymore. + - Integrated some changes from the gcc source tree that I had previously + missed. (Thanks to Bryce McKinley for the reminder/diff.) + - Added Makefile.direct as a copy of the default Makefile, which would + normally be overwritten if configure is run. + - Changed the gc.tar target in Makefile.direct to embed the version number + in the gc directory name. This will affect future tar file distributions. + - Changed the Irix dynamic library finding code to no longer try to + eliminate writable text segments under Irix6.x, since that is probably no + longer necessary, and can apparently be unsafe on occasion. (Thanks to + Shiro Kawai for pointing this out.) + - GC_cleanup with GC_DEBUG enabled passed a real object base address to + GC_debug_register_finalizer_ignore_self, which expected a pointer past the + debug header. Call GC_register_finalizer_ignore_self instead, even with + debugging enabled. (Thanks to Jean-Daniel Fekete for catching this.) + - The collector didn't build with call chain saving enabled but NARGS=0. + (Thanks to Maarten Thibaut.) + - Fixed up the GNU-style build files enough so that they work in some + obvious cases. + - Added initial port to Digital Mars compiler for win32. (Thanks to Walter + Bright.) + + Since 6.0alpha8: + - added README.macros. + - Made gc.mak a symbolic link to work around winzip's tendency to ignore + hard links. + - Simplified the setting of NEED_FIND_LIMIT in os_dep.c, possibly breaking + it on untested platforms. + - Integrated initial GNU HURD port. (Thanks to Chris Lingard and Igor + Khavkine.) + - A few more fixes for Digital Mars compiler (Walter Bright). + - Fixed gcc version recognition. Renamed OPERATOR_NEW_ARRAY to + GC_OPERATOR_NEW_ARRAY. Changed GC_OPERATOR_NEW_ARRAY to be the default. + It can be overridden with -DGC_NO_OPERATOR_NEW_ARRAY. (Thanks to + Cesar Eduardo Barros.) + - Changed the byte size to free-list mapping in thread local allocation + so that size 0 allocations are handled correctly. + - Fixed Linux/MIPS stackbottom for new toolchain. (Thanks to Ryan Murray.) + - Changed finalization registration to invoke GC_oom_fn when it runs out + of memory. + - Removed lvalue cast in finalize.c. This caused some debug configurations + not to build with some non-gcc compilers. + + Since 6.0alpha9: + - Two more bug fixes for KEEP_BACK_PTRS and DBG_HDRS_ALL. + - Fixed a stack clearing problem that resulted in SIGILL with a + misaligned stack pointer for multithreaded SPARC builds. + - Integrated another HURD patch (thanks to Igor Khavkine). + + Since 6.0: + - Non-debug, atomic allocations could result in bogus smashed object + reports with debugging on. (Thanks to Patrick Doyle for the small + test case.) + - Fixed GC_get_register_stack_base (Itanium only) to work around a glibc + 2.2.4 bug. + - Initial port to HP/UX on Itanium. Thread support and both 32 and 64 + bit ABIs appear to work. Parallel mark support doesn't yet, due to + some inline assembly code issues. Thread local allocation does appear + to work. + - ifdef'ed out glibc2.1/Itanium workaround. I suspect nobody is using + that combination anymore. + - Added a patch to make new_gc_alloc.h usable with gcc3.0. (Thanks to + Dimitris Vyzovitis for the patch.) + - Debugged 64-bit support on HP/UX PA-RISC. + - Turned on dynamic loading support for FreeBSD/ELF. (Thanks to Peter + Housel.) + - Unregistering of finalizers with debugging allocation was broken. + (Thanks to Jani Kajala for the test case.) + - Old finalizers were not returned correctly from GC_debug_register_finalizer. + - Disabled MPROTECT_VDB for Linux/M68K based on a report that it doesn't work. + - Cleaned up some statistics gathering code in reclaim.c (Thanks to Walter + Bright.) + - Added some support for OpenBSD/ELF/Linux. (Thanks to Suzuki Toshiya.) + - Added Jakub Jelinek's patch to use dl_iterate_phdr for dynamic library + traversal to dyn_load.c. Changed it to weakly reference dl_iterate_phdr, + so that the old code is stilll used with old versions of glibc. + - Cleaned up feature test macros for various threads packages and + integrated (partially functional) FreeBSD threads code from Loren Rittle. + It's likely that the cleanup broke something, since it touched lots of + code. It's also likelly that it fixed some unreported bugs in the + less common thread implementations, since some of the original code + didn't stand up to close scrutiny. Support for the next pthreads + implementation should be easier to add. + + Since 6.1alpha1: + - No longer wrap read by default in multithreaded applications. It was + pointed out on the libgcj list that this holds the allocation lock for + way too long if the read blocks. For now, reads into the heap are + broken with incremental collection. It's possible to turn this back on + if you make sure that read calls don't block (e.g. by calling select + first). + - Fix ifdef in Solaris_threads.h to refer to GC_SOLARIS_THREADS. + - Added check for environment variable GC_IGNORE_GCJ_INFO. + - Added printing of stop-the-world GC times if GC_PRINT_STATS environment + variable is set. + - The calloc definition in leak_detector.h was missing parentheses, and + realloc was missing a second argument to GC_REALLOC. + (Thanks to Elrond (elrondsamba-tng.org).) + - Added GC_PRINT_BACK_HEIGHT environment variable and associated + code, mostly in the new file backgraph.c. See doc/README.environment. + - Added -DUSE_GLOBAL_ALLOC to work around a Windows NT issue. (Thanks to + Jonathan Clark.) + - Integrated port to NEC EWS4800 (MIPS-based workstation, with somewhat + different address-space layout). This may help for other machines with + holes in the data segment. (Thanks to Hironori Sakamoto.) + - Changed the order in which GC_push_roots and friends push things onto + the mark stack. GC_push_all calls need to come first, since we can't + necessarily recovere if those overflow the mark stack. (Thanks to + Matthew Flatt for tracking down the problem.) + - Some minor cleanups to mostly support the Intel compiler on Linux/IA64. + + Since 6.1 alpha2: + - Minor cleanup on the gcconfig.h section for SPARC. + - Minor fix to support Intel compiler for I386/Linux. (Thanks to Sven + Hartrumpf.) + - Added SPARC V9 (64-bit) support. (Thanks to Jeff Sturm.) + - Restructured the way in which we determine whether or not to keep + call stacks for debug allocation. By default SAVE_CALL_COUNT is + now zero on all platforms. Added SAVE_CALL_NARGS parameters. + If possible, use execinfo.h to capture call stack. (This should + add support for a number of new platforms, though often at + considerable runtime expense.) + - Try to print symbolic information for call stacks. On Linux, we + do this with a combination of execinfo.h and running addr2line in + a separate process. This is both much more expensive and much more + useful. Amazingly, it seems to be fast enough for most purposes. + - Redefined strdup if -DREDIRECT_MALLOC is given. + - Changed incremental collector and MPROTECT_VDB implementation so that, + under favorable conditions, pointerfree objects are not protected. + Added GC_incremental_protection_needs() to determine ahead of time whether + pointerfree objects may be protected. Replaced GC_write_hint() with + GC_remove_protection(). + - Added test for GC_ENABLE_INCREMENTAL environment variable. + - Made GC_time_limit runtime configurable. Added GC_PAUSE_TIME_TARGET + environment variable. + - Eliminated GC_page_sz, a duplicate of GC_page_size. + - Caused the Solaris and Irix thread creation primitives to call + GC_init_inner(). + + + To do: + - There seem to be outstanding issues on Solaris/X86, possibly with + finding the data segment starting address. Information/patches would + be appreciated. + - Very large root set sizes (> 16 MB or so) could cause the collector + to abort with an unexpected mark stack overflow. (Thanks again to + Peter Chubb.) NOT YET FIXED. Workaround is to increase the initial + size. + - The SGI version of the collector marks from mmapped pages, even + if they are not part of dynamic library static data areas. This + causes performance problems with some SGI libraries that use mmap + as a bitmap allocator. NOT YET FIXED. It may be possible to turn + off DYNAMIC_LOADING in the collector as a workaround. It may also + be possible to conditionally intercept mmap and use GC_exclude_static_roots. + The real fix is to walk rld data structures, which looks possible. + - Incremental collector should handle large objects better. Currently, + it looks like the whole object is treated as dirty if any part of it + is. + - Cord/cordprnt.c doesn't build on a few platforms (notably PowerPC), since + we make some unwarranted assumptions about how varargs are handled. This + currently makes the cord-aware versions of printf unusable on some platforms. + Fixing this is unfortunately not trivial. diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.contributors gcc-3.1/boehm-gc/doc/README.contributors *** gcc-3.0.4/boehm-gc/doc/README.contributors Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.contributors Fri Aug 17 18:30:49 2001 *************** *** 0 **** --- 1,57 ---- + This is an attempt to acknowledge early contributions to the garbage + collector. Later contributions should instead be mentioned in + README.changes. + + HISTORY - + + Early versions of this collector were developed as a part of research + projects supported in part by the National Science Foundation + and the Defense Advance Research Projects Agency. + + The garbage collector originated as part of the run-time system for + the Russell programming language implementation. The first version of the + garbage collector was written primarily by Al Demers. It was then refined + and mostly rewritten, primarily by Hans-J. Boehm, at Cornell U., + the University of Washington, Rice University (where it was first used for + C and assembly code), Xerox PARC, SGI, and HP Labs. However, significant + contributions have also been made by many others. + + Some other contributors: + + More recent contributors are mentioned in the modification history in + README.changes. My apologies for any omissions. + + The SPARC specific code was originally contributed by Mark Weiser. + The Encore Multimax modifications were supplied by + Kevin Kenny (kenny@m.cs.uiuc.edu). The adaptation to the IBM PC/RT is largely + due to Vernon Lee, on machines made available to Rice by IBM. + Much of the HP specific code and a number of good suggestions for improving the + generic code are due to Walter Underwood. + Robert Brazile (brazile@diamond.bbn.com) originally supplied the ULTRIX code. + Al Dosser (dosser@src.dec.com) and Regis Cridlig (Regis.Cridlig@cl.cam.ac.uk) + subsequently provided updates and information on variation between ULTRIX + systems. Parag Patel (parag@netcom.com) supplied the A/UX code. + Jesper Peterson(jep@mtiame.mtia.oz.au), Michel Schinz, and + Martin Tauchmann (martintauchmann@bigfoot.com) supplied the Amiga port. + Thomas Funke (thf@zelator.in-berlin.de(?)) and + Brian D.Carlstrom (bdc@clark.lcs.mit.edu) supplied the NeXT ports. + Douglas Steel (doug@wg.icl.co.uk) provided ICL DRS6000 code. + Bill Janssen (janssen@parc.xerox.com) supplied the SunOS dynamic loader + specific code. Manuel Serrano (serrano@cornas.inria.fr) supplied linux and + Sony News specific code. Al Dosser provided Alpha/OSF/1 code. He and + Dave Detlefs(detlefs@src.dec.com) also provided several generic bug fixes. + Alistair G. Crooks(agc@uts.amdahl.com) supplied the NetBSD and 386BSD ports. + Jeffrey Hsu (hsu@soda.berkeley.edu) provided the FreeBSD port. + Brent Benson (brent@jade.ssd.csd.harris.com) ported the collector to + a Motorola 88K processor running CX/UX (Harris NightHawk). + Ari Huttunen (Ari.Huttunen@hut.fi) generalized the OS/2 port to + nonIBM development environments (a nontrivial task). + Patrick Beard (beard@cs.ucdavis.edu) provided the initial MacOS port. + David Chase, then at Olivetti Research, suggested several improvements. + Scott Schwartz (schwartz@groucho.cse.psu.edu) supplied some of the + code to save and print call stacks for leak detection on a SPARC. + Jesse Hull and John Ellis supplied the C++ interface code. + Zhong Shao performed much of the experimentation that led to the + current typed allocation facility. (His dynamic type inference code hasn't + made it into the released version of the collector, yet.) + diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.cords gcc-3.1/boehm-gc/doc/README.cords *** gcc-3.0.4/boehm-gc/doc/README.cords Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.cords Sat Aug 18 01:04:43 2001 *************** *** 0 **** --- 1,53 ---- + Copyright (c) 1993-1994 by Xerox Corporation. All rights reserved. + + THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED + OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + + Permission is hereby granted to use or copy this program + for any purpose, provided the above notices are retained on all copies. + Permission to modify the code and to distribute modified code is granted, + provided the above notices are retained, and a notice that the code was + modified is included with the above copyright notice. + + Please send bug reports to Hans-J. Boehm (Hans_Boehm@hp.com or + boehm@acm.org). + + This is a string packages that uses a tree-based representation. + See cord.h for a description of the functions provided. Ec.h describes + "extensible cords", which are essentially output streams that write + to a cord. These allow for efficient construction of cords without + requiring a bound on the size of a cord. + + More details on the data structure can be found in + + Boehm, Atkinson, and Plass, "Ropes: An Alternative to Strings", + Software Practice and Experience 25, 12, December 1995, pp. 1315-1330. + + A fundamentally similar "rope" data structure is also part of SGI's standard + template library implementation, and its descendents, which include the + GNU C++ library. That uses reference counting by default. + There is a short description of that data structure at + http://reality.sgi.com/boehm/ropeimpl.html . (The more official location + http://www.sgi.com/tech/stl/ropeimpl.html is missing a figure.) + + All of these are descendents of the "ropes" in Xerox Cedar. + + de.c is a very dumb text editor that illustrates the use of cords. + It maintains a list of file versions. Each version is simply a + cord representing the file contents. Nonetheless, standard + editing operations are efficient, even on very large files. + (Its 3 line "user manual" can be obtained by invoking it without + arguments. Note that ^R^N and ^R^P move the cursor by + almost a screen. It does not understand tabs, which will show + up as highlighred "I"s. Use the UNIX "expand" program first.) + To build the editor, type "make cord/de" in the gc directory. + + This package assumes an ANSI C compiler such as gcc. It will + not compile with an old-style K&R compiler. + + Note that CORD_printf iand friends use C functions with variable numbers + of arguments in non-standard-conforming ways. This code is known to + break on some platforms, notably PowerPC. It should be possible to + build the remainder of the library (everything but cordprnt.c) on + any platform that supports the collector. + diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.dj gcc-3.1/boehm-gc/doc/README.dj *** gcc-3.0.4/boehm-gc/doc/README.dj Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.dj Fri Aug 17 18:30:49 2001 *************** *** 0 **** --- 1,12 ---- + [Original version supplied by Xiaokun Zhu ] + [This version came mostly from Gary Leavens. ] + + Look first at Makefile.dj, and possibly change the definitions of + RM and MV if you don't have rm and mv installed. + Then use Makefile.dj to compile the garbage collector. + For example, you can do: + + make -f Makefile.dj test + + All the tests should work fine. + diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.environment gcc-3.1/boehm-gc/doc/README.environment *** gcc-3.0.4/boehm-gc/doc/README.environment Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.environment Tue Apr 9 00:03:25 2002 *************** *** 0 **** --- 1,94 ---- + The garbage collector looks at a number of environment variables which are + then used to affect its operation. These are examined only on Un*x-like + platforms. + + GC_INITIAL_HEAP_SIZE= - Initial heap size in bytes. May speed up + process start-up. + + GC_LOOP_ON_ABORT - Causes the collector abort routine to enter a tight loop. + This may make it easier to debug, such a process, especially + for multithreaded platforms that don't produce usable core + files, or if a core file would be too large. On some + platforms, this also causes SIGSEGV to be caught and + result in an infinite loop in a handler, allowing + similar debugging techniques. + + GC_PRINT_STATS - Turn on as much logging as is easily feasible without + adding signifcant runtime overhead. Doesn't work if + the collector is built with SMALL_CONFIG. Overridden + by setting GC_quiet. On by default if the collector + was built without -DSILENT. + + GC_PRINT_ADDRESS_MAP - Linux only. Dump /proc/self/maps, i.e. various address + maps for the process, to stderr on every GC. Useful for + mapping root addresses to source for deciphering leak + reports. + + GC_NPROCS= - Linux w/threads only. Explicitly sets the number of processors + that the GC should expect to use. Note that setting this to 1 + when multiple processors are available will preserve + correctness, but may lead to really horrible performance. + + GC_NO_BLACKLIST_WARNING - Prevents the collector from issuing + warnings about allocations of very large blocks. + Deprecated. Use GC_LARGE_ALLOC_WARN_INTERVAL instead. + + GC_LARGE_ALLOC_WARN_INTERVAL= - Print every nth warning about very large + block allocations, starting with the nth one. Small values + of n are generally benign, in that a bounded number of + such warnings generally indicate at most a bounded leak. + For best results it should be set at 1 during testing. + Default is 5. Very large numbers effectively disable the + warning. + + GC_IGNORE_GCJ_INFO - Ignore the type descriptors implicitly supplied by + GC_gcj_malloc and friends. This is useful for debugging + descriptor generation problems, and possibly for + temporarily working around such problems. It forces a + fully conservative scan of all heap objects except + those known to be pointerfree, and may thus have other + adverse effects. + + GC_PRINT_BACK_HEIGHT - Print max length of chain through unreachable objects + ending in a reachable one. If this number remains + bounded, then the program is "GC robust". This ensures + that a fixed number of misidentified pointers can only + result in a bounded space leak. This currently only + works if debugging allocation is used throughout. + It increases GC space and time requirements appreciably. + This feature is still somewhat experimental, and requires + that the collector have been built with MAKE_BACK_GRAPH + defined. For details, see Boehm, "Bounding Space Usage + of Conservative Garbage Collectors", POPL 2001, or + http://lib.hpl.hp.com/techpubs/2001/HPL-2001-251.html . + + GC_ENABLE_INCREMENTAL - Turn on incremental collection at startup. Note that, + depending on platform and collector configuration, this + may involve write protecting pieces of the heap to + track modifications. These pieces may include pointerfree + objects or not. Although this is intended to be + transparent, it may cause unintended system call failures. + Use with caution. + + GC_PAUSE_TIME_TARGET - Set the desired garbage collector pause time in msecs. + This only has an effect if incremental collection is enabled. + If a collection requires appreciably more time than this, + the client will be restarted, and the collector will need + to do additional work to compensate. The special value + "999999" indicates that pause time is unlimited, and the + incremental collector will behave completely like a + simple generational collector. If the collector is + configured for parallel marking, and run on a multiprocessor, + incremental collection should only be used with unlimited + pause time. + + The following turn on runtime flags that are also program settable. Checked + only during initialization. We expect that they will usually be set through + other means, but this may help with debugging and testing: + + GC_FIND_LEAK - Turns on GC_find_leak and thus leak detection. + + GC_ALL_INTERIOR_POINTERS - Turns on GC_all_interior_pointers and thus interior + pointer recognition. + + GC_DONT_GC - Turns off garbage collection. Use cautiously. diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.ews4800 gcc-3.1/boehm-gc/doc/README.ews4800 *** gcc-3.0.4/boehm-gc/doc/README.ews4800 Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.ews4800 Thu Jan 31 02:48:54 2002 *************** *** 0 **** --- 1,75 ---- + GC on EWS4800 + ------------- + + 1. About EWS4800 + EWS4800 is 32bit/64bit workstation. + + Vender: NEC Corporation + OS: UX/4800 R9.* - R13.* (SystemV R4.2) + CPU: R4000, R4400, R10000 (MIPS) + + 2. Compiler + + 32bit: + Use ANSI C compiler. + CC = /usr/abiccs/bin/cc + + 64bit: + Use 64bit ANSI C compiler. + CC = /usr/ccs64/bin/cc + AR = /usr/ccs64/bin/ar + + 3. ELF file format + *** Caution: The following infomation is empirical. *** + + 32bit: + ELF file has an unique format. (See a.out(4) and end(3C).) + + &_start + : text segment + &etext + DATASTART + : data segment (initialized) + &edata + DATASTART2 + : data segment (uninitialized) + &end + + Here, DATASTART and DATASTART2 are macros of GC, and are defined as + the following equations. (See include/private/gcconfig.h.) + The algorithm for DATASTART is similar with the function + GC_SysVGetDataStart() in os_dep.c. + + DATASTART = ((&etext + 0x3ffff) & ~0x3ffff) + (&etext & 0xffff) + + Dynamically linked: + DATASTART2 = (&_gp + 0x8000 + 0x3ffff) & ~0x3ffff + + Statically linked: + DATASTART2 = &edata + + GC has to check addresses both between DATASTART and &edata, and + between DATASTART2 and &end. If a program accesses between &etext + and DATASTART, or between &edata and DATASTART2, the segmentation + error occurs and the program stops. + + If a program is statically linked, there is not a gap between + &edata and DATASTART2. The global symbol &_DYNAMIC_LINKING is used + for the detection. + + 64bit: + ELF file has a simple format. (See end(3C).) + + _ftext + : text segment + _etext + _fdata = DATASTART + : data segment (initialized) + _edata + _fbss + : data segment (uninitialized) + _end = DATAEND + + -- + Hironori SAKAMOTO + diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.hp gcc-3.1/boehm-gc/doc/README.hp *** gcc-3.0.4/boehm-gc/doc/README.hp Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.hp Fri Aug 17 18:30:49 2001 *************** *** 0 **** --- 1,18 ---- + Dynamic loading support requires that executables be linked with -ldld. + The alternative is to build the collector without defining DYNAMIC_LOADING + in gcconfig.h and ensuring that all garbage collectable objects are + accessible without considering statically allocated variables in dynamic + libraries. + + The collector should compile with either plain cc or cc -Ae. Cc -Aa + fails to define _HPUX_SOURCE and thus will not configure the collector + correctly. + + Incremental collection support was reccently added, and should now work. + + In spite of past claims, pthread support under HP/UX 11 should now work. + Define GC_HPUX_THREADS for the build. Incremental collection still does not + work in combination with it. + + The stack finding code can be confused by putenv calls before collector + initialization. Call GC_malloc or GC_init before any putenv calls. diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.linux gcc-3.1/boehm-gc/doc/README.linux *** gcc-3.0.4/boehm-gc/doc/README.linux Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.linux Fri Aug 17 18:30:49 2001 *************** *** 0 **** --- 1,135 ---- + See README.alpha for Linux on DEC AXP info. + + This file applies mostly to Linux/Intel IA32. Ports to Linux on an M68K + and PowerPC are also integrated. They should behave similarly, except that + the PowerPC port lacks incremental GC support, and it is unknown to what + extent the Linux threads code is functional. See below for M68K specific + notes. + + Incremental GC is supported on Intel IA32 and M68K. + + Dynamic libraries are supported on an ELF system. A static executable + should be linked with the gcc option "-Wl,-defsym,_DYNAMIC=0". + + The collector appears to work with Linux threads. We have seen + intermittent hangs in sem_wait. So far we have been unable to reproduce + these unless the process was being debugged or traced. Thus it's + possible that the only real issue is that the debugger loses + signals on rare occasions. + + The garbage collector uses SIGPWR and SIGXCPU if it is used with + Linux threads. These should not be touched by the client program. + + To use threads, you need to abide by the following requirements: + + 1) You need to use LinuxThreads (which are included in libc6). + + The collector relies on some implementation details of the LinuxThreads + package. It is unlikely that this code will work on other + pthread implementations (in particular it will *not* work with + MIT pthreads). + + 2) You must compile the collector with -DGC_LINUX_THREADS and -D_REENTRANT + specified in the Makefile. + + 3a) Every file that makes thread calls should define GC_LINUX_THREADS and + _REENTRANT and then include gc.h. Gc.h redefines some of the + pthread primitives as macros which also provide the collector with + information it requires. + + 3b) A new alternative to (3a) is to build the collector and compile GC clients + with -DGC_USE_LD_WRAP, and to link the final program with + + (for ld) --wrap read --wrap dlopen --wrap pthread_create \ + --wrap pthread_join --wrap pthread_detach \ + --wrap pthread_sigmask --wrap sleep + + (for gcc) -Wl,--wrap -Wl,read -Wl,--wrap -Wl,dlopen -Wl,--wrap \ + -Wl,pthread_create -Wl,--wrap -Wl,pthread_join -Wl,--wrap \ + -Wl,pthread_detach -Wl,--wrap -Wl,pthread_sigmask \ + -Wl,--wrap -Wl,sleep + + In any case, _REENTRANT should be defined during compilation. + + 4) Dlopen() disables collection during its execution. (It can't run + concurrently with the collector, since the collector looks at its + data structures. It can't acquire the allocator lock, since arbitrary + user startup code may run as part of dlopen().) Under unusual + conditions, this may cause unexpected heap growth. + + 5) The combination of GC_LINUX_THREADS, REDIRECT_MALLOC, and incremental + collection fails in seemingly random places. This hasn't been tracked + down yet, but is perhaps not completely astonishing. The thread package + uses malloc, and thus can presumably get SIGSEGVs while inside the + package. There is no real guarantee that signals are handled properly + at that point. + + 6) Thread local storage may not be viewed as part of the root set by the + collector. This probably depends on the linuxthreads version. For the + time being, any collectable memory referenced by thread local storage should + also be referenced from elsewhere, or be allocated as uncollectable. + (This is really a bug that should be fixed somehow.) + + + M68K LINUX: + (From Richard Zidlicky) + The bad news is that it can crash every linux-m68k kernel on a 68040, + so an additional test is needed somewhere on startup. I have meanwhile + patches to correct the problem in 68040 buserror handler but it is not + yet in any standard kernel. + + Here is a simple test program to detect whether the kernel has the + problem. It could be run as a separate check in configure or tested + upon startup. If it fails (return !0) than mprotect can't be used + on that system. + + /* + * test for bug that may crash 68040 based Linux + */ + + #include + #include + #include + #include + #include + + + char *membase; + int pagesize=4096; + int pageshift=12; + int x_taken=0; + + int sighandler(int sig) + { + mprotect(membase,pagesize,PROT_READ|PROT_WRITE); + x_taken=1; + } + + main() + { + long l; + + signal(SIGSEGV,sighandler); + l=(long)mmap(NULL,pagesize,PROT_READ,MAP_PRIVATE | MAP_ANON,-1,0); + if (l==-1) + { + perror("mmap/malloc"); + abort(); + } + membase=(char*)l; + *(long*)(membase+sizeof(long))=123456789; + if (*(long*)(membase+sizeof(long)) != 123456789 ) + { + fprintf(stderr,"writeback failed !\n"); + exit(1); + } + if (!x_taken) + { + fprintf(stderr,"exception not taken !\n"); + exit(1); + } + fprintf(stderr,"vmtest Ok\n"); + exit(0); + } + + diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.macros gcc-3.1/boehm-gc/doc/README.macros *** gcc-3.0.4/boehm-gc/doc/README.macros Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.macros Fri Aug 17 18:39:18 2001 *************** *** 0 **** --- 1,78 ---- + The collector uses a large amount of conditional compilation in order to + deal with platform dependencies. This violates a number of known coding + standards. On the other hand, it seems to be the only practical way to + support this many platforms without excessive code duplication. + + A few guidelines have mostly been followed in order to keep this manageable: + + 1) #if and #ifdef directives are properly indented whenever easily possible. + All known C compilers allow whitespace between the "#" and the "if" to make + this possible. ANSI C also allows white space before the "#", though we + avoid that. It has the known disadvantages that it differs from the normal + GNU conventions, and that it makes patches larger than otherwise necessary. + In my opinion, it's still well worth it, for the same reason that we indent + ordinary "if" statements. + + 2) Whenever possible, tests are performed on the macros defined in gcconfig.h + instead of directly testing patform-specific predefined macros. This makes it + relatively easy to adapt to new compilers with a different set of predefined + macros. Currently these macros generally identify platforms instead of + features. In many cases, this is a mistake. + + 3) The code currently avoids #elif, eventhough that would make it more + readable. This was done since #elif would need to be understood by ALL + compilers used to build the collector, and that hasn't always been the case. + It makes sense to reconsider this decision at some point, since #elif has been + standardized at least since 1989. + + Many of the tested configuration macros are at least somewhat defined in + either include/private/gcconfig.h or in Makefile.direct. Here is an attempt + at defining some of the remainder: (Thanks to Walter Bright for suggesting + this. This is a work in progress) + + MACRO EXPLANATION + ----- ----------- + + __DMC__ Always #define'd by the Digital Mars compiler. Expands + to the compiler version number in hex, i.e. 0x810 is + version 8.1b0 + + _ENABLE_ARRAYNEW + #define'd by the Digital Mars C++ compiler when + operator new[] and delete[] are separately + overloadable. Used in gc_cpp.h. + + _MSC_VER Expands to the Visual C++ compiler version. Assumed to + not be defined for other compilers (at least if they behave + appreciably differently). + + _DLL Defined by Visual C++ if dynamic libraries are being built + or used. Used to test whether __declspec(dllimport) or + __declspec(dllexport) needs to be added to declarations + to support the case in which the collector is in a dll. + + GC_DLL User-settable macro that forces the effect of _DLL. + + GC_NOT_DLL User-settable macro that overrides _DLL, e.g. if dynamic + libraries are used, but the collector is in a static library. + + __STDC__ Assumed to be defined only by compilers that understand + prototypes and other C89 features. Its value is generally + not used, since we are fine with most nonconforming extensions. + + SUNOS5SIGS Solaris-like signal handling. This is probably misnamed, + since it really doesn't guarantee much more than Posix. + Currently set only for Solaris2.X, HPUX, and DRSNX. Should + probably be set for some other platforms. + + PCR Set if the collector is being built as part of the Xerox + Portable Common Runtime. + + SRC_M3 Set if the collector is being built as a replacement of the + one in the DEC/Compaq SRC Modula-3 runtime. I suspect this + was last used around 1994, and no doubt broke a long time ago. + It's there primarily incase someone wants to port to a similar + system. + + + diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.rs6000 gcc-3.1/boehm-gc/doc/README.rs6000 *** gcc-3.0.4/boehm-gc/doc/README.rs6000 Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.rs6000 Fri Aug 17 18:30:49 2001 *************** *** 0 **** --- 1,9 ---- + We have so far failed to find a good way to determine the stack base. + It is highly recommended that GC_stackbottom be set explicitly on program + startup. The supplied value sometimes causes failure under AIX 4.1, though + it appears to work under 3.X. HEURISTIC2 seems to work under 4.1, but + involves a substantial performance penalty, and will fail if there is + no limit on stack size. + + There is no thread support. (I assume recent versions of AIX provide + pthreads? I no longer have access to a machine ...) diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.sgi gcc-3.1/boehm-gc/doc/README.sgi *** gcc-3.0.4/boehm-gc/doc/README.sgi Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.sgi Fri Aug 17 18:30:49 2001 *************** *** 0 **** --- 1,41 ---- + Performance of the incremental collector can be greatly enhanced with + -DNO_EXECUTE_PERMISSION. + + The collector should run with all of the -32, -n32 and -64 ABIs. Remember to + define the AS macro in the Makefile to be "as -64", or "as -n32". + + If you use -DREDIRECT_MALLOC=GC_malloc with C++ code, your code should make + at least one explicit call to malloc instead of new to ensure that the proper + version of malloc is linked in. + + Sproc threads are not supported in this version, though there may exist other + ports. + + Pthreads support is provided. This requires that: + + 1) You compile the collector with -DGC_IRIX_THREADS specified in the Makefile. + + 2) You have the latest pthreads patches installed. + + (Though the collector makes only documented pthread calls, + it relies on signal/threads interactions working just right in ways + that are not required by the standard. It is unlikely that this code + will run on other pthreads platforms. But please tell me if it does.) + + 3) Every file that makes thread calls should define IRIX_THREADS and then + include gc.h. Gc.h redefines some of the pthread primitives as macros which + also provide the collector with information it requires. + + 4) pthread_cond_wait and pthread_cond_timed_wait should be prepared for + premature wakeups. (I believe the pthreads and realted standards require this + anyway. Irix pthreads often terminate a wait if a signal arrives. + The garbage collector uses signals to stop threads.) + + 5) It is expensive to stop a thread waiting in IO at the time the request is + initiated. Applications with many such threads may not exhibit acceptable + performance with the collector. (Increasing the heap size may help.) + + 6) The collector should not be compiled with -DREDIRECT_MALLOC. This + confuses some library calls made by the pthreads implementation, which + expect the standard malloc. + diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.solaris2 gcc-3.1/boehm-gc/doc/README.solaris2 *** gcc-3.0.4/boehm-gc/doc/README.solaris2 Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.solaris2 Fri Aug 17 18:30:49 2001 *************** *** 0 **** --- 1,62 ---- + The collector supports both incremental collection and threads under + Solaris 2. The incremental collector normally retrieves page dirty information + through the appropriate /proc calls. But it can also be configured + (by defining MPROTECT_VDB instead of PROC_VDB in gcconfig.h) to use mprotect + and signals. This may result in shorter pause times, but it is no longer + safe to issue arbitrary system calls that write to the heap. + + Under other UNIX versions, + the collector normally obtains memory through sbrk. There is some reason + to expect that this is not safe if the client program also calls the system + malloc, or especially realloc. The sbrk man page strongly suggests this is + not safe: "Many library routines use malloc() internally, so use brk() + and sbrk() only when you know that malloc() definitely will not be used by + any library routine." This doesn't make a lot of sense to me, since there + seems to be no documentation as to which routines can transitively call malloc. + Nonetheless, under Solaris2, the collector now (since 4.12) allocates + memory using mmap by default. (It defines USE_MMAP in gcconfig.h.) + You may want to reverse this decisions if you use -DREDIRECT_MALLOC=... + + + SOLARIS THREADS: + + The collector must be compiled with -DGC_SOLARIS_THREADS (thr_ functions) + or -DGC_SOLARIS_PTHREADS (pthread_ functions) to be thread safe. + It is also essential that gc.h be included in files that call thr_create, + thr_join, thr_suspend, thr_continue, or dlopen. Gc.h macro defines + these to also do GC bookkeeping, etc. Gc.h must be included with + one or both of these macros defined, otherwise + these replacements are not visible. + A collector built in this way way only be used by programs that are + linked with the threads library. + + In this mode, the collector contains various workarounds for older Solaris + bugs. Mostly, these should not be noticeable unless you look at system + call traces. However, it cannot protect a guard page at the end of + a thread stack. If you know that you will only be running Solaris2.5 + or later, it should be possible to fix this by compiling the collector + with -DSOLARIS23_MPROTECT_BUG_FIXED. + + Since 5.0 alpha5, dlopen disables collection temporarily, + unless USE_PROC_FOR_LIBRARIES is defined. In some unlikely cases, this + can result in unpleasant heap growth. But it seems better than the + race/deadlock issues we had before. + + If solaris_threads are used on an X86 processor with malloc redirected to + GC_malloc, it is necessary to call GC_thr_init explicitly before forking the + first thread. (This avoids a deadlock arising from calling GC_thr_init + with the allocation lock held.) + + It appears that there is a problem in using gc_cpp.h in conjunction with + Solaris threads and Sun's C++ runtime. Apparently the overloaded new operator + is invoked by some iostream initialization code before threads are correctly + initialized. As a result, call to thr_self() in garbage collector + initialization segfaults. Currently the only known workaround is to not + invoke the garbage collector from a user defined global operator new, or to + have it invoke the garbage-collector's allocators only after main has started. + (Note that the latter requires a moderately expensive test in operator + delete.) + + Hans-J. Boehm + (The above contains my personal opinions, which are probably not shared + by anyone else.) diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.uts gcc-3.1/boehm-gc/doc/README.uts *** gcc-3.0.4/boehm-gc/doc/README.uts Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.uts Fri Aug 17 18:30:49 2001 *************** *** 0 **** --- 1,2 ---- + Alistair Crooks supplied the port. He used Lexa C version 2.1.3 with + -Xa to compile. diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/README.win32 gcc-3.1/boehm-gc/doc/README.win32 *** gcc-3.0.4/boehm-gc/doc/README.win32 Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/README.win32 Tue Feb 12 04:37:55 2002 *************** *** 0 **** --- 1,156 ---- + The collector has at various times been compiled under Windows 95 & NT, + with the original Microsoft SDK, with Visual C++ 2.0, 4.0, and 6, with + the GNU win32 environment, with Borland 4.5, with Watcom C, and recently + with the Digital Mars compiler. It is likely that some of these have been + broken in the meantime. Patches are appreciated. + + It runs under both win32s and win32, but with different semantics. + Under win32, all writable pages outside of the heaps and stack are + scanned for roots. Thus the collector sees pointers in DLL data + segments. Under win32s, only the main data segment is scanned. + (The main data segment should always be scanned. Under some + versions of win32s, other regions may also be scanned.) + Thus all accessible objects should be accessible from local variables + or variables in the main data segment. Alternatively, other data + segments (e.g. in DLLs) may be registered with the collector by + calling GC_init() and then GC_register_root_section(a), where + a is the address of some variable inside the data segment. (Duplicate + registrations are ignored, but not terribly quickly.) + + (There are two reasons for this. We didn't want to see many 16:16 + pointers. And the VirtualQuery call has different semantics under + the two systems, and under different versions of win32s.) + + The collector test program "gctest" is linked as a GUI application, + but does not open any windows. Its output appears in the file + "gc.log". It may be started from the file manager. The hour glass + cursor may appear as long as it's running. If it is started from the + command line, it will usually run in the background. Wait a few + minutes (a few seconds on a modern machine) before you check the output. + You should see either a failure indication or a "Collector appears to + work" message. + + The cord test program has not been ported (but should port + easily). A toy editor (cord/de.exe) based on cords (heavyweight + strings represented as trees) has been ported and is included. + It runs fine under either win32 or win32S. It serves as an example + of a true Windows application, except that it was written by a + nonexpert Windows programmer. (There are some peculiarities + in the way files are displayed. The is displayed explicitly + for standard DOS text files. As in the UNIX version, control + characters are displayed explicitly, but in this case as red text. + This may be suboptimal for some tastes and/or sets of default + window colors.) + + In general -DREDIRECT_MALLOC is unlikely to work unless the + application is completely statically linked. + + The collector normally allocates memory from the OS with VirtualAlloc. + This appears to cause problems under Windows NT and Windows 2000 (but + not Windows 95/98) if the memory is later passed to CreateDIBitmap. + To work around this problem, build the collector with -DUSE_GLOBAL_ALLOC. + This is currently incompatible with -DUSE_MUNMAP. (Thanks to Jonathan + Clark for tracking this down.) + + For Microsoft development tools, rename NT_MAKEFILE as + MAKEFILE. (Make sure that the CPU environment variable is defined + to be i386.) In order to use the gc_cpp.h C++ interface, all + client code should include gc_cpp.h. + + Clients may need to define GC_NOT_DLL before including gc.h, if the + collector was built as a static library (as it normally is in the + absence of thread support). + + For GNU-win32, use the regular makefile, possibly after uncommenting + the line "include Makefile.DLLs". The latter should be necessary only + if you want to package the collector as a DLL. The GNU-win32 port is + believed to work only for b18, not b19, probably dues to linker changes + in b19. This is probably fixable with a different definition of + DATASTART and DATAEND in gcconfig.h. + + For Borland tools, use BCC_MAKEFILE. Note that + Borland's compiler defaults to 1 byte alignment in structures (-a1), + whereas Visual C++ appears to default to 8 byte alignment (/Zp8). + The garbage collector in its default configuration EXPECTS AT + LEAST 4 BYTE ALIGNMENT. Thus the BORLAND DEFAULT MUST + BE OVERRIDDEN. (In my opinion, it should usually be anyway. + I expect that -a1 introduces major performance penalties on a + 486 or Pentium.) Note that this changes structure layouts. (As a last + resort, gcconfig.h can be changed to allow 1 byte alignment. But + this has significant negative performance implications.) + The Makefile is set up to assume Borland 4.5. If you have another + version, change the line near the top. By default, it does not + require the assembler. If you do have the assembler, I recommend + removing the -DUSE_GENERIC. + + There is some support for incremental collection. This is + currently pretty simple-minded. Pages are protected. Protection + faults are caught by a handler installed at the bottom of the handler + stack. This is both slow and interacts poorly with a debugger. + Whenever possible, I recommend adding a call to + GC_enable_incremental at the last possible moment, after most + debugging is complete. Unlike the UNIX versions, no system + calls are wrapped by the collector itself. It may be necessary + to wrap ReadFile calls that use a buffer in the heap, so that the + call does not encounter a protection fault while it's running. + (As usual, none of this is an issue unless GC_enable_incremental + is called.) + + Note that incremental collection is disabled with -DSMALL_CONFIG. + + James Clark has contributed the necessary code to support win32 threads. + Use NT_THREADS_MAKEFILE (a.k.a gc.mak) instead of NT_MAKEFILE + to build this version. Note that this requires some files whose names + are more than 8 + 3 characters long. Thus you should unpack the tar file + so that long file names are preserved. To build the garbage collector + test with VC++ from the command line, use + + nmake /F ".\gc.mak" CFG="gctest - Win32 Release" + + This requires that the subdirectory gctest\Release exist. + The test program and DLL will reside in the Release directory. + + This version relies on the collector residing in a dll. + + This version currently supports incremental collection only if it is + enabled before any additional threads are created. + Version 4.13 attempts to fix some of the earlier problems, but there + may be other issues. If you need solid support for win32 threads, you + might check with Geodesic Systems. Their collector must be licensed, + but they have invested far more time in win32-specific issues. + + Hans + + Ivan V. Demakov's README for the Watcom port: + + The collector has been compiled with Watcom C 10.6 and 11.0. + It runs under win32, win32s, and even under msdos with dos4gw + dos-extender. It should also run under OS/2, though this isn't + tested. Under win32 the collector can be built either as dll + or as static library. + + Note that all compilations were done under Windows 95 or NT. + For unknown reason compiling under Windows 3.11 for NT (one + attempt has been made) leads to broken executables. + + Incremental collection is not supported. + + cord is not ported. + + Before compiling you may need to edit WCC_MAKEFILE to set target + platform, library type (dynamic or static), calling conventions, and + optimization options. + + To compile the collector and testing programs use the command: + wmake -f WCC_MAKEFILE + + All programs using gc should be compiled with 4-byte alignment. + For further explanations on this see comments about Borland. + + If gc compiled as dll, the macro ``GC_DLL'' should be defined before + including "gc.h" (for example, with -DGC_DLL compiler option). It's + important, otherwise resulting programs will not run. + + Ivan Demakov (email: ivan@tgrad.nsk.su) + + diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/barrett_diagram gcc-3.1/boehm-gc/doc/barrett_diagram *** gcc-3.0.4/boehm-gc/doc/barrett_diagram Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/barrett_diagram Fri Aug 17 18:30:49 2001 *************** *** 0 **** --- 1,106 ---- + This is an ASCII diagram of the data structure used to check pointer + validity. It was provided by Dave Barrett , + and should be of use to others attempting to understand the code. + The data structure in GC4.X is essentially the same. -HB + + + + + Data Structure used by GC_base in gc3.7: + 21-Apr-94 + + + + + 63 LOG_TOP_SZ[11] LOG_BOTTOM_SZ[10] LOG_HBLKSIZE[13] + +------------------+----------------+------------------+------------------+ + p:| | TL_HASH(hi) | | HBLKDISPL(p) | + +------------------+----------------+------------------+------------------+ + \-----------------------HBLKPTR(p)-------------------/ + \------------hi-------------------/ + \______ ________/ \________ _______/ \________ _______/ + V V V + | | | + GC_top_index[] | | | + --- +--------------+ | | | + ^ | | | | | + | | | | | | + TOP +--------------+<--+ | | + _SZ +-<| [] | * | | + (items)| +--------------+ if 0 < bi< HBLKSIZE | | + | | | | then large object | | + | | | | starts at the bi'th | | + v | | | HBLK before p. | i | + --- | +--------------+ | (word- | + v | aligned) | + bi= |GET_BI(p){->hash_link}->key==hi | | + v | | + | (bottom_index) \ scratch_alloc'd | | + | ( struct bi ) / by get_index() | | + --- +->+--------------+ | | + ^ | | | | + ^ | | | | + BOTTOM | | ha=GET_HDR_ADDR(p) | | + _SZ(items)+--------------+<----------------------+ +-------+ + | +--<| index[] | | + | | +--------------+ GC_obj_map: v + | | | | from / +-+-+-----+-+-+-+-+ --- + v | | | GC_add < 0| | | | | | | | ^ + --- | +--------------+ _map_entry \ +-+-+-----+-+-+-+-+ | + | | asc_link | +-+-+-----+-+-+-+-+ MAXOBJSZ + | +--------------+ +-->| | | j | | | | | +1 + | | key | | +-+-+-----+-+-+-+-+ | + | +--------------+ | +-+-+-----+-+-+-+-+ | + | | hash_link | | | | | | | | | | v + | +--------------+ | +-+-+-----+-+-+-+-+ --- + | | |<--MAX_OFFSET--->| + | | (bytes) + HDR(p)| GC_find_header(p) | |<--MAP_ENTRIES-->| + | \ from | =HBLKSIZE/WORDSZ + | (hdr) (struct hblkhdr) / alloc_hdr() | (1024 on Alpha) + +-->+----------------------+ | (8/16 bits each) + GET_HDR(p)| word hb_sz (words) | | + +----------------------+ | + | struct hblk *hb_next | | + +----------------------+ | + |mark_proc hb_mark_proc| | + +----------------------+ | + | char * hb_map |>-------------+ + +----------------------+ + | ushort hb_obj_kind | + +----------------------+ + | hb_last_reclaimed | + --- +----------------------+ + ^ | | + MARK_BITS| hb_marks[] | *if hdr is free, hb_sz + DISCARD_WORDS + _SZ(words)| | is the size of a heap chunk (struct hblk) + v | | of at least MININCR*HBLKSIZE bytes (below), + --- +----------------------+ otherwise, size of each object in chunk. + + Dynamic data structures above are interleaved throughout the heap in blocks of + size MININCR * HBLKSIZE bytes as done by gc_scratch_alloc which cannot be + freed; free lists are used (e.g. alloc_hdr). HBLKs's below are collected. + + (struct hblk) + --- +----------------------+ < HBLKSIZE --- --- DISCARD_ + ^ |garbage[DISCARD_WORDS]| aligned ^ ^ HDR_BYTES WORDS + | | | | v (bytes) (words) + | +-----hb_body----------+ < WORDSZ | --- --- + | | | aligned | ^ ^ + | | Object 0 | | hb_sz | + | | | i |(word- (words)| + | | | (bytes)|aligned) v | + | + - - - - - - - - - - -+ --- | --- | + | | | ^ | ^ | + n * | | j (words) | hb_sz BODY_SZ + HBLKSIZE | Object 1 | v v | (words) + (bytes) | |--------------- v MAX_OFFSET + | + - - - - - - - - - - -+ --- (bytes) + | | | !All_INTERIOR_PTRS ^ | + | | | sets j only for hb_sz | + | | Object N | valid object offsets. | | + v | | All objects WORDSZ v v + --- +----------------------+ aligned. --- --- + + DISCARD_WORDS is normally zero. Indeed the collector has not been tested + with another value in ages. diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/debugging.html gcc-3.1/boehm-gc/doc/debugging.html *** gcc-3.0.4/boehm-gc/doc/debugging.html Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/debugging.html Tue Feb 12 04:37:55 2002 *************** *** 0 **** --- 1,291 ---- + + + Debugging Garbage Collector Related Problems + + +

Debugging Garbage Collector Related Problems

+ This page contains some hints on + debugging issues specific to + the Boehm-Demers-Weiser conservative garbage collector. + It applies both to debugging issues in client code that manifest themselves + as collector misbehavior, and to debugging the collector itself. +

+ If you suspect a bug in the collector itself, it is strongly recommended + that you try the latest collector release, even if it is labelled as "alpha", + before proceeding. +

Bus Errors and Segmentation Violations

+

+ If the fault occurred in GC_find_limit, or with incremental collection enabled, + this is probably normal. The collector installs handlers to take care of + these. You will not see these unless you are using a debugger. + Your debugger should allow you to continue. + It's often preferable to tell the debugger to ignore SIGBUS and SIGSEGV + ("handle SIGSEGV SIGBUS nostop noprint" in gdb, + "ignore SIGSEGV SIGBUS" in most versions of dbx) + and set a breakpoint in abort. + The collector will call abort if the signal had another cause, + and there was not other handler previously installed. +

+ We recommend debugging without incremental collection if possible. + (This applies directly to UNIX systems. + Debugging with incremental collection under win32 is worse. See README.win32.) +

+ If the application generates an unhandled SIGSEGV or equivalent, it may + often be easiest to set the environment variable GC_LOOP_ON_ABORT. On many + platforms, this will cause the collector to loop in a handler when the + SIGSEGV is encountered (or when the collector aborts for some other reason), + and a debugger can then be attached to the looping + process. This sidesteps common operating system problems related + to incomplete core files for multithreaded applications, etc. +

Other Signals

+ On most platforms, the multithreaded version of the collector needs one or + two other signals for internal use by the collector in stopping threads. + It is normally wise to tell the debugger to ignore these. On Linux, + the collector currently uses SIGPWR and SIGXCPU by default. +

Warning Messages About Needing to Allocate Blacklisted Blocks

+ The garbage collector generates warning messages of the form +
+ Needed to allocate blacklisted block at 0x...
+ 
+ when it needs to allocate a block at a location that it knows to be + referenced by a false pointer. These false pointers can be either permanent + (e.g. a static integer variable that never changes) or temporary. + In the latter case, the warning is largely spurious, and the block will + eventually be reclaimed normally. + In the former case, the program will still run correctly, but the block + will never be reclaimed. Unless the block is intended to be + permanent, the warning indicates a memory leak. +
    +
  1. Ignore these warnings while you are using GC_DEBUG. Some of the routines + mentioned below don't have debugging equivalents. (Alternatively, write + the missing routines and send them to me.) +
  2. Replace allocator calls that request large blocks with calls to + GC_malloc_ignore_off_page or + GC_malloc_atomic_ignore_off_page. You may want to set a + breakpoint in GC_default_warn_proc to help you identify such calls. + Make sure that a pointer to somewhere near the beginning of the resulting block + is maintained in a (preferably volatile) variable as long as + the block is needed. +
  3. + If the large blocks are allocated with realloc, we suggest instead allocating + them with something like the following. Note that the realloc size increment + should be fairly large (e.g. a factor of 3/2) for this to exhibit reasonable + performance. But we all know we should do that anyway. +
    + void * big_realloc(void *p, size_t new_size)
    + {
    +     size_t old_size = GC_size(p);
    +     void * result;
    +  
    +     if (new_size <= 10000) return(GC_realloc(p, new_size));
    +     if (new_size <= old_size) return(p);
    +     result = GC_malloc_ignore_off_page(new_size);
    +     if (result == 0) return(0);
    +     memcpy(result,p,old_size);
    +     GC_free(p);
    +     return(result);
    + }
    + 
    + +
  4. In the unlikely case that even relatively small object + (<20KB) allocations are triggering these warnings, then your address + space contains lots of "bogus pointers", i.e. values that appear to + be pointers but aren't. Usually this can be solved by using GC_malloc_atomic + or the routines in gc_typed.h to allocate large pointer-free regions of bitmaps, etc. Sometimes the problem can be solved with trivial changes of encoding + in certain values. It is possible, to identify the source of the bogus + pointers by building the collector with -DPRINT_BLACK_LIST, + which will cause it to print the "bogus pointers", along with their location. + +
  5. If you get only a fixed number of these warnings, you are probably only + introducing a bounded leak by ignoring them. If the data structures being + allocated are intended to be permanent, then it is also safe to ignore them. + The warnings can be turned off by calling GC_set_warn_proc with a procedure + that ignores these warnings (e.g. by doing absolutely nothing). +
+ +

The Collector References a Bad Address in GC_malloc

+ + This typically happens while the collector is trying to remove an entry from + its free list, and the free list pointer is bad because the free list link + in the last allocated object was bad. +

+ With > 99% probability, you wrote past the end of an allocated object. + Try setting GC_DEBUG before including gc.h and + allocating with GC_MALLOC. This will try to detect such + overwrite errors. + +

Unexpectedly Large Heap

+ + Unexpected heap growth can be due to one of the following: +
    +
  1. Data structures that are being unintentionally retained. This + is commonly caused by data structures that are no longer being used, + but were not cleared, or by caches growing without bounds. +
  2. Pointer misidentification. The garbage collector is interpreting + integers or other data as pointers and retaining the "referenced" + objects. +
  3. Heap fragmentation. This should never result in unbounded growth, + but it may account for larger heaps. This is most commonly caused + by allocation of large objects. On some platforms it can be reduced + by building with -DUSE_MUNMAP, which will cause the collector to unmap + memory corresponding to pages that have not been recently used. +
  4. Per object overhead. This is usually a relatively minor effect, but + it may be worth considering. If the collector recognizes interior + pointers, object sizes are increased, so that one-past-the-end pointers + are correctly recognized. The collector can be configured not to do this + (-DDONT_ADD_BYTE_AT_END). +

    + The collector rounds up object sizes so the result fits well into the + chunk size (HBLKSIZE, normally 4K on 32 bit machines, 8K + on 64 bit machines) used by the collector. Thus it may be worth avoiding + objects of size 2K + 1 (or 2K if a byte is being added at the end.) +

+ The last two cases can often be identified by looking at the output + of a call to GC_dump(). Among other things, it will print the + list of free heap blocks, and a very brief description of all chunks in + the heap, the object sizes they correspond to, and how many live objects + were found in the chunk at the last collection. +

+ Growing data structures can usually be identified by +

    +
  1. Building the collector with -DKEEP_BACK_PTRS, +
  2. Preferably using debugging allocation (defining GC_DEBUG + before including gc.h and allocating with GC_MALLOC), + so that objects will be identified by their allocation site, +
  3. Running the application long enough so + that most of the heap is composed of "leaked" memory, and +
  4. Then calling GC_generate_random_backtrace() from backptr.h + a few times to determine why some randomly sampled objects in the heap are + being retained. +
+

+ The same technique can often be used to identify problems with false + pointers, by noting whether the reference chains printed by + GC_generate_random_backtrace() involve any misidentified pointers. + An alternate technique is to build the collector with + -DPRINT_BLACK_LIST which will cause it to report values that + are almost, but not quite, look like heap pointers. It is very likely that + actual false pointers will come from similar sources. +

+ In the unlikely case that false pointers are an issue, it can usually + be resolved using one or more of the following techniques: +

    +
  1. Use GC_malloc_atomic for objects containing no pointers. + This is especially important for large arrays containing compressed data, + pseudo-random numbers, and the like. It is also likely to improve GC + performance, perhaps drastically so if the application is paging. +
  2. If you allocate large objects containing only + one or two pointers at the beginning, either try the typed allocation + primitives is gc_typed.h, or separate out the pointerfree component. +
  3. Consider using GC_malloc_ignore_off_page() + to allocate large objects. (See gc.h and above for details. + Large means > 100K in most environments.) +
+

Prematurely Reclaimed Objects

+ The usual symptom of this is a segmentation fault, or an obviously overwritten + value in a heap object. This should, of course, be impossible. In practice, + it may happen for reasons like the following: +
    +
  1. The collector did not intercept the creation of threads correctly in + a multithreaded application, e.g. because the client called + pthread_create without including gc.h, which redefines it. +
  2. The last pointer to an object in the garbage collected heap was stored + somewhere were the collector couldn't see it, e.g. in an + object allocated with system malloc, in certain types of + mmaped files, + or in some data structure visible only to the OS. (On some platforms, + thread-local storage is one of these.) +
  3. The last pointer to an object was somehow disguised, e.g. by + XORing it with another pointer. +
  4. Incorrect use of GC_malloc_atomic or typed allocation. +
  5. An incorrect GC_free call. +
  6. The client program overwrote an internal garbage collector data structure. +
  7. A garbage collector bug. +
  8. (Empirically less likely than any of the above.) A compiler optimization + that disguised the last pointer. +
+ The following relatively simple techniques should be tried first to narrow + down the problem: +
    +
  1. If you are using the incremental collector try turning it off for + debugging. +
  2. If you are using shared libraries, try linking statically. If that works, + ensure that DYNAMIC_LOADING is defined on your platform. +
  3. Try to reproduce the problem with fully debuggable unoptimized code. + This will eliminate the last possibility, as well as making debugging easier. +
  4. Try replacing any suspect typed allocation and GC_malloc_atomic + calls with calls to GC_malloc. +
  5. Try removing any GC_free calls (e.g. with a suitable + #define). +
  6. Rebuild the collector with -DGC_ASSERTIONS. +
  7. If the following works on your platform (i.e. if gctest still works + if you do this), try building the collector with + -DREDIRECT_MALLOC=GC_malloc_uncollectable. This will cause + the collector to scan memory allocated with malloc. +
+ If all else fails, you will have to attack this with a debugger. + Suggested steps: +
    +
  1. Call GC_dump() from the debugger around the time of the failure. Verify + that the collectors idea of the root set (i.e. static data regions which + it should scan for pointers) looks plausible. If not, i.e. if it doesn't + include some static variables, report this as + a collector bug. Be sure to describe your platform precisely, since this sort + of problem is nearly always very platform dependent. +
  2. Especially if the failure is not deterministic, try to isolate it to + a relatively small test case. +
  3. Set a break point in GC_finish_collection. This is a good + point to examine what has been marked, i.e. found reachable, by the + collector. +
  4. If the failure is deterministic, run the process + up to the last collection before the failure. + Note that the variable GC_gc_no counts collections and can be used + to set a conditional breakpoint in the right one. It is incremented just + before the call to GC_finish_collection. + If object p was prematurely recycled, it may be helpful to + look at *GC_find_header(p) at the failure point. + The hb_last_reclaimed field will identify the collection number + during which its block was last swept. +
  5. Verify that the offending object still has its correct contents at + this point. + The call GC_is_marked(p) from the debugger to verify that the + object has not been marked, and is about to be reclaimed. +
  6. Determine a path from a root, i.e. static variable, stack, or + register variable, + to the reclaimed object. Call GC_is_marked(q) for each object + q along the path, trying to locate the first unmarked object, say + r. +
  7. If r is pointed to by a static root, + verify that the location + pointing to it is part of the root set printed by GC_dump(). If it + is on the stack in the main (or only) thread, verify that + GC_stackbottom is set correctly to the base of the stack. If it is + in another thread stack, check the collector's thread data structure + (GC_thread[] on several platforms) to make sure that stack bounds + are set correctly. +
  8. If r is pointed to by heap object s, check that the + collector's layout description for s is such that the pointer field + will be scanned. Call *GC_find_header(s) to look at the descriptor + for the heap chunk. The hb_descr field specifies the layout + of objects in that chunk. See gc_mark.h for the meaning of the descriptor. + (If it's low order 2 bits are zero, then it is just the length of the + object prefix to be scanned. This form is always used for objects allocated + with GC_malloc or GC_malloc_atomic.) +
  9. If the failure is not deterministic, you may still be able to apply some + of the above technique at the point of failure. But remember that objects + allocated since the last collection will not have been marked, even if the + collector is functioning properly. On some platforms, the collector + can be configured to save call chains in objects for debugging. + Enabling this feature will also cause it to save the call stack at the + point of the last GC in GC_arrays._last_stack. +
  10. When looking at GC internal data structures remember that a number + of GC_xxx variables are really macro defined to + GC_arrays._xxx, so that + the collector can avoid scanning them. +
+ + + + + + diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/gc.man gcc-3.1/boehm-gc/doc/gc.man *** gcc-3.0.4/boehm-gc/doc/gc.man Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/gc.man Fri Aug 17 18:30:49 2001 *************** *** 0 **** --- 1,80 ---- + .TH GC_MALLOC 1L "12 February 1996" + .SH NAME + GC_malloc, GC_malloc_atomic, GC_free, GC_realloc, GC_enable_incremental, GC_register_finalizer, GC_malloc_ignore_off_page, GC_malloc_atomic_ignore_off_page, GC_set_warn_proc \- Garbage collecting malloc replacement + .SH SYNOPSIS + #include "gc.h" + .br + # define malloc(n) GC_malloc(n) + .br + ... malloc(...) ... + .br + .sp + cc ... gc.a + .LP + .SH DESCRIPTION + .I GC_malloc + and + .I GC_free + are plug-in replacements for standard malloc and free. However, + .I + GC_malloc + will attempt to reclaim inaccessible space automatically by invoking a conservative garbage collector at appropriate points. The collector traverses all data structures accessible by following pointers from the machines registers, stack(s), data, and bss segments. Inaccessible structures will be reclaimed. A machine word is considered to be a valid pointer if it is an address inside an object allocated by + .I + GC_malloc + or friends. + .LP + See the documentation in the include file gc_cpp.h for an alternate, C++ specific interface to the garbage collector. + .LP + Unlike the standard implementations of malloc, + .I + GC_malloc + clears the newly allocated storage. + .I + GC_malloc_atomic + does not. Furthermore, it informs the collector that the resulting object will never contain any pointers, and should therefore not be scanned by the collector. + .LP + .I + GC_free + can be used to deallocate objects, but its use is optional, and generally discouraged. + .I + GC_realloc + has the standard realloc semantics. It preserves pointer-free-ness. + .I + GC_register_finalizer + allows for registration of functions that are invoked when an object becomes inaccessible. + .LP + The garbage collector tries to avoid allocating memory at locations that already appear to be referenced before allocation. (Such apparent ``pointers'' are usually large integers and the like that just happen to look like an address.) This may make it hard to allocate very large objects. An attempt to do so may generate a warning. + .LP + .I + GC_malloc_ignore_off_page + and + .I + GC_malloc_atomic_ignore_off_page + inform the collector that the client code will always maintain a pointer to near the beginning of the object (within the first 512 bytes), and that pointers beyond that can be ignored by the collector. This makes it much easier for the collector to place large objects. These are recommended for large object allocation. (Objects expected to be larger than about 100KBytes should be allocated this way.) + .LP + It is also possible to use the collector to find storage leaks in programs destined to be run with standard malloc/free. The collector can be compiled for thread-safe operation. Unlike standard malloc, it is safe to call malloc after a previous malloc call was interrupted by a signal, provided the original malloc call is not resumed. + .LP + The collector may, on rare occasion produce warning messages. On UNIX machines these appear on stderr. Warning messages can be filtered, redirected, or ignored with + .I + GC_set_warn_proc. + This is recommended for production code. See gc.h for details. + .LP + Debugging versions of many of the above routines are provided as macros. Their names are identical to the above, but consist of all capital letters. If GC_DEBUG is defined before gc.h is included, these routines do additional checking, and allow the leak detecting version of the collector to produce slightly more useful output. Without GC_DEBUG defined, they behave exactly like the lower-case versions. + .LP + On some machines, collection will be performed incrementally after a call to + .I + GC_enable_incremental. + This may temporarily write protect pages in the heap. See the README file for more information on how this interacts with system calls that write to the heap. + .LP + Other facilities not discussed here include limited facilities to support incremental collection on machines without appropriate VM support, provisions for providing more explicit object layout information to the garbage collector, more direct support for ``weak'' pointers, support for ``abortable'' garbage collections during idle time, etc. + .LP + .SH "SEE ALSO" + The README and gc.h files in the distribution. More detailed definitions of the functions exported by the collector are given there. (The above list is not complete.) + .LP + Boehm, H., and M. Weiser, "Garbage Collection in an Uncooperative Environment", + \fISoftware Practice & Experience\fP, September 1988, pp. 807-820. + .LP + The malloc(3) man page. + .LP + .SH AUTHOR + Hans-J. Boehm (boehm@parc.xerox.com). Some of the code was written by others, most notably Alan Demers. diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/gcdescr.html gcc-3.1/boehm-gc/doc/gcdescr.html *** gcc-3.0.4/boehm-gc/doc/gcdescr.html Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/gcdescr.html Fri Aug 17 18:39:18 2001 *************** *** 0 **** --- 1,438 ---- + + + Conservative GC Algorithmic Overview + Hans-J. Boehm, Silicon Graphics + + +

This is under construction

+

Conservative GC Algorithmic Overview

+

+ This is a description of the algorithms and data structures used in our + conservative garbage collector. I expect the level of detail to increase + with time. For a survey of GC algorithms, see for example + Paul Wilson's + excellent paper. For an overview of the collector interface, + see here. +

+ This description is targeted primarily at someone trying to understand the + source code. It specifically refers to variable and function names. + It may also be useful for understanding the algorithms at a higher level. +

+ The description here assumes that the collector is used in default mode. + In particular, we assume that it used as a garbage collector, and not just + a leak detector. We initially assume that it is used in stop-the-world, + non-incremental mode, though the presence of the incremental collector + will be apparent in the design. + We assume the default finalization model, but the code affected by that + is very localized. +

Introduction

+ The garbage collector uses a modified mark-sweep algorithm. Conceptually + it operates roughly in four phases: + +
    + +
  1. + Preparation Clear all mark bits, indicating that all objects + are potentially unreachable. + +
  2. + Mark phase Marks all objects that can be reachable via chains of + pointers from variables. Normally the collector has no real information + about the location of pointer variables in the heap, so it + views all static data areas, stacks and registers as potentially containing + containing pointers. Any bit patterns that represent addresses inside + heap objects managed by the collector are viewed as pointers. + Unless the client program has made heap object layout information + available to the collector, any heap objects found to be reachable from + variables are again scanned similarly. + +
  3. + Sweep phase Scans the heap for inaccessible, and hence unmarked, + objects, and returns them to an appropriate free list for reuse. This is + not really a separate phase; even in non incremental mode this is operation + is usually performed on demand during an allocation that discovers an empty + free list. Thus the sweep phase is very unlikely to touch a page that + would not have been touched shortly thereafter anyway. + +
  4. + Finalization phase Unreachable objects which had been registered + for finalization are enqueued for finalization outside the collector. + +
+ +

+ The remaining sections describe the memory allocation data structures, + and then the last 3 collection phases in more detail. We conclude by + outlining some of the additional features implemented in the collector. + +

Allocation

+ The collector includes its own memory allocator. The allocator obtains + memory from the system in a platform-dependent way. Under UNIX, it + uses either malloc, sbrk, or mmap. +

+ Most static data used by the allocator, as well as that needed by the + rest of the garbage collector is stored inside the + _GC_arrays structure. + This allows the garbage collector to easily ignore the collectors own + data structures when it searches for root pointers. Other allocator + and collector internal data structures are allocated dynamically + with GC_scratch_alloc. GC_scratch_alloc does not + allow for deallocation, and is therefore used only for permanent data + structures. +

+ The allocator allocates objects of different kinds. + Different kinds are handled somewhat differently by certain parts + of the garbage collector. Certain kinds are scanned for pointers, + others are not. Some may have per-object type descriptors that + determine pointer locations. Or a specific kind may correspond + to one specific object layout. Two built-in kinds are uncollectable. + One (STUBBORN) is immutable without special precautions. + In spite of that, it is very likely that most applications currently + use at most two kinds: NORMAL and PTRFREE objects. +

+ The collector uses a two level allocator. A large block is defined to + be one larger than half of HBLKSIZE, which is a power of 2, + typically on the order of the page size. +

+ Large block sizes are rounded up to + the next multiple of HBLKSIZE and then allocated by + GC_allochblk. This uses roughly what Paul Wilson has termed + a "next fit" algorithm, i.e. first-fit with a rotating pointer. + The implementation does check for a better fitting immediately + adjacent block, which gives it somewhat better fragmentation characteristics. + I'm now convinced it should use a best fit algorithm. The actual + implementation of GC_allochblk + is significantly complicated by black-listing issues + (see below). +

+ Small blocks are allocated in blocks of size HBLKSIZE. + Each block is + dedicated to only one object size and kind. The allocator maintains + separate free lists for each size and kind of object. +

+ In order to avoid allocating blocks for too many distinct object sizes, + the collector normally does not directly allocate objects of every possible + request size. Instead request are rounded up to one of a smaller number + of allocated sizes, for which free lists are maintained. The exact + allocated sizes are computed on demand, but subject to the constraint + that they increase roughly in geometric progression. Thus objects + requested early in the execution are likely to be allocated with exactly + the requested size, subject to alignment constraints. + See GC_init_size_map for details. +

+ The actual size rounding operation during small object allocation is + implemented as a table lookup in GC_size_map. +

+ Both collector initialization and computation of allocated sizes are + handled carefully so that they do not slow down the small object fast + allocation path. An attempt to allocate before the collector is initialized, + or before the appropriate GC_size_map entry is computed, + will take the same path as an allocation attempt with an empty free list. + This results in a call to the slow path code (GC_generic_malloc_inner) + which performs the appropriate initialization checks. +

+ In non-incremental mode, we make a decision about whether to garbage collect + whenever an allocation would otherwise have failed with the current heap size. + If the total amount of allocation since the last collection is less than + the heap size divided by GC_free_space_divisor, we try to + expand the heap. Otherwise, we initiate a garbage collection. This ensures + that the amount of garbage collection work per allocated byte remains + constant. +

+ The above is in fat an oversimplification of the real heap expansion + heuristic, which adjusts slightly for root size and certain kinds of + fragmentation. In particular, programs with a large root set size and + little live heap memory will expand the heap to amortize the cost of + scanning the roots. +

+ Versions 5.x of the collector actually collect more frequently in + nonincremental mode. The large block allocator usually refuses to split + large heap blocks once the garbage collection threshold is + reached. This often has the effect of collecting well before the + heap fills up, thus reducing fragmentation and working set size at the + expense of GC time. 6.x will chose an intermediate strategy depending + on how much large object allocation has taken place in the past. + (If the collector is configured to unmap unused pages, versions 6.x + will use the 5.x strategy.) +

+ (It has been suggested that this should be adjusted so that we favor + expansion if the resulting heap still fits into physical memory. + In many cases, that would no doubt help. But it is tricky to do this + in a way that remains robust if multiple application are contending + for a single pool of physical memory.) + +

Mark phase

+ + The marker maintains an explicit stack of memory regions that are known + to be accessible, but that have not yet been searched for contained pointers. + Each stack entry contains the starting address of the block to be scanned, + as well as a descriptor of the block. If no layout information is + available for the block, then the descriptor is simply a length. + (For other possibilities, see gc_mark.h.) +

+ At the beginning of the mark phase, all root segments are pushed on the + stack by GC_push_roots. If ALL_INTERIOR_PTRS is not + defined, then stack roots require special treatment. In this case, the + normal marking code ignores interior pointers, but GC_push_all_stack + explicitly checks for interior pointers and pushes descriptors for target + objects. +

+ The marker is structured to allow incremental marking. + Each call to GC_mark_some performs a small amount of + work towards marking the heap. + It maintains + explicit state in the form of GC_mark_state, which + identifies a particular sub-phase. Some other pieces of state, most + notably the mark stack, identify how much work remains to be done + in each sub-phase. The normal progression of mark states for + a stop-the-world collection is: +

    +
  1. MS_INVALID indicating that there may be accessible unmarked + objects. In this case GC_objects_are_marked will simultaneously + be false, so the mark state is advanced to +
  2. MS_PUSH_UNCOLLECTABLE indicating that it suffices to push + uncollectable objects, roots, and then mark everything reachable from them. + Scan_ptr is advanced through the heap until all uncollectable + objects are pushed, and objects reachable from them are marked. + At that point, the next call to GC_mark_some calls + GC_push_roots to push the roots. It the advances the + mark state to +
  3. MS_ROOTS_PUSHED asserting that once the mark stack is + empty, all reachable objects are marked. Once in this state, we work + only on emptying the mark stack. Once this is completed, the state + changes to +
  4. MS_NONE indicating that reachable objects are marked. +
+ + The core mark routine GC_mark_from_mark_stack, is called + repeatedly by several of the sub-phases when the mark stack starts to fill + up. It is also called repeatedly in MS_ROOTS_PUSHED state + to empty the mark stack. + The routine is designed to only perform a limited amount of marking at + each call, so that it can also be used by the incremental collector. + It is fairly carefully tuned, since it usually consumes a large majority + of the garbage collection time. +

+ The marker correctly handles mark stack overflows. Whenever the mark stack + overflows, the mark state is reset to MS_INVALID. + Since there are already marked objects in the heap, + this eventually forces a complete + scan of the heap, searching for pointers, during which any unmarked objects + referenced by marked objects are again pushed on the mark stack. This + process is repeated until the mark phase completes without a stack overflow. + Each time the stack overflows, an attempt is made to grow the mark stack. + All pieces of the collector that push regions onto the mark stack have to be + careful to ensure forward progress, even in case of repeated mark stack + overflows. Every mark attempt results in additional marked objects. +

+ Each mark stack entry is processed by examining all candidate pointers + in the range described by the entry. If the region has no associated + type information, then this typically requires that each 4-byte aligned + quantity (8-byte aligned with 64-bit pointers) be considered a candidate + pointer. +

+ We determine whether a candidate pointer is actually the address of + a heap block. This is done in the following steps: + +

  • The candidate pointer is checked against rough heap bounds. + These heap bounds are maintained such that all actual heap objects + fall between them. In order to facilitate black-listing (see below) + we also include address regions that the heap is likely to expand into. + Most non-pointers fail this initial test. +
  • The candidate pointer is divided into two pieces; the most significant + bits identify a HBLKSIZE-sized page in the address space, and + the least significant bits specify an offset within that page. + (A hardware page may actually consist of multiple such pages. + HBLKSIZE is usually the page size divided by a small power of two.) +
  • + The page address part of the candidate pointer is looked up in a + table. + Each table entry contains either 0, indicating that the page is not part + of the garbage collected heap, a small integer n, indicating + that the page is part of large object, starting at least n pages + back, or a pointer to a descriptor for the page. In the first case, + the candidate pointer i not a true pointer and can be safely ignored. + In the last two cases, we can obtain a descriptor for the page containing + the beginning of the object. +
  • + The starting address of the referenced object is computed. + The page descriptor contains the size of the object(s) + in that page, the object kind, and the necessary mark bits for those + objects. The size information can be used to map the candidate pointer + to the object starting address. To accelerate this process, the page header + also contains a pointer to a precomputed map of page offsets to displacements + from the beginning of an object. The use of this map avoids a + potentially slow integer remainder operation in computing the object + start address. +
  • + The mark bit for the target object is checked and set. If the object + was previously unmarked, the object is pushed on the mark stack. + The descriptor is read from the page descriptor. (This is computed + from information GC_obj_kinds when the page is first allocated.) + +

    + At the end of the mark phase, mark bits for left-over free lists are cleared, + in case a free list was accidentally marked due to a stray pointer. + +

    Sweep phase

    + + At the end of the mark phase, all blocks in the heap are examined. + Unmarked large objects are immediately returned to the large object free list. + Each small object page is checked to see if all mark bits are clear. + If so, the entire page is returned to the large object free list. + Small object pages containing some reachable object are queued for later + sweeping. +

    + This initial sweep pass touches only block headers, not + the blocks themselves. Thus it does not require significant paging, even + if large sections of the heap are not in physical memory. +

    + Nonempty small object pages are swept when an allocation attempt + encounters an empty free list for that object size and kind. + Pages for the correct size and kind are repeatedly swept until at + least one empty block is found. Sweeping such a page involves + scanning the mark bit array in the page header, and building a free + list linked through the first words in the objects themselves. + This does involve touching the appropriate data page, but in most cases + it will be touched only just before it is used for allocation. + Hence any paging is essentially unavoidable. +

    + Except in the case of pointer-free objects, we maintain the invariant + that any object in a small object free list is cleared (except possibly + for the link field). Thus it becomes the burden of the small object + sweep routine to clear objects. This has the advantage that we can + easily recover from accidentally marking a free list, though that could + also be handled by other means. The collector currently spends a fair + amount of time clearing objects, and this approach should probably be + revisited. +

    + In most configurations, we use specialized sweep routines to handle common + small object sizes. Since we allocate one mark bit per word, it becomes + easier to examine the relevant mark bits if the object size divides + the word length evenly. We also suitably unroll the inner sweep loop + in each case. (It is conceivable that profile-based procedure cloning + in the compiler could make this unnecessary and counterproductive. I + know of no existing compiler to which this applies.) +

    + The sweeping of small object pages could be avoided completely at the expense + of examining mark bits directly in the allocator. This would probably + be more expensive, since each allocation call would have to reload + a large amount of state (e.g. next object address to be swept, position + in mark bit table) before it could do its work. The current scheme + keeps the allocator simple and allows useful optimizations in the sweeper. + +

    Finalization

    + Both GC_register_disappearing_link and + GC_register_finalizer add the request to a corresponding hash + table. The hash table is allocated out of collected memory, but + the reference to the finalizable object is hidden from the collector. + Currently finalization requests are processed non-incrementally at the + end of a mark cycle. +

    + The collector makes an initial pass over the table of finalizable objects, + pushing the contents of unmarked objects onto the mark stack. + After pushing each object, the marker is invoked to mark all objects + reachable from it. The object itself is not explicitly marked. + This assures that objects on which a finalizer depends are neither + collected nor finalized. +

    + If in the process of marking from an object the + object itself becomes marked, we have uncovered + a cycle involving the object. This usually results in a warning from the + collector. Such objects are not finalized, since it may be + unsafe to do so. See the more detailed + discussion of finalization semantics. +

    + Any objects remaining unmarked at the end of this process are added to + a queue of objects whose finalizers can be run. Depending on collector + configuration, finalizers are dequeued and run either implicitly during + allocation calls, or explicitly in response to a user request. +

    + The collector provides a mechanism for replacing the procedure that is + used to mark through objects. This is used both to provide support for + Java-style unordered finalization, and to ignore certain kinds of cycles, + e.g. those arising from C++ implementations of virtual inheritance. + +

    Generational Collection and Dirty Bits

    + We basically use the parallel and generational GC algorithm described in + "Mostly Parallel Garbage Collection", + by Boehm, Demers, and Shenker. +

    + The most significant modification is that + the collector always runs in the allocating thread. + There is no separate garbage collector thread. + If an allocation attempt either requests a large object, or encounters + an empty small object free list, and notices that there is a collection + in progress, it immediately performs a small amount of marking work + as described above. +

    + This change was made both because we wanted to easily accommodate + single-threaded environments, and because a separate GC thread requires + very careful control over the scheduler to prevent the mutator from + out-running the collector, and hence provoking unneeded heap growth. +

    + In incremental mode, the heap is always expanded when we encounter + insufficient space for an allocation. Garbage collection is triggered + whenever we notice that more than + GC_heap_size/2 * GC_free_space_divisor + bytes of allocation have taken place. + After GC_full_freq minor collections a major collection + is started. +

    + All collections initially run interrupted until a predetermined + amount of time (50 msecs by default) has expired. If this allows + the collection to complete entirely, we can avoid correcting + for data structure modifications during the collection. If it does + not complete, we return control to the mutator, and perform small + amounts of additional GC work during those later allocations that + cannot be satisfied from small object free lists. When marking completes, + the set of modified pages is retrieved, and we mark once again from + marked objects on those pages, this time with the mutator stopped. +

    + We keep track of modified pages using one of three distinct mechanisms: +

      +
    1. + Through explicit mutator cooperation. Currently this requires + the use of GC_malloc_stubborn. +
    2. + By write-protecting physical pages and catching write faults. This is + implemented for many Unix-like systems and for win32. It is not possible + in a few environments. +
    3. + By retrieving dirty bit information from /proc. (Currently only Sun's + Solaris supports this. Though this is considerably cleaner, performance + may actually be better with mprotect and signals.) +
    + +

    Thread support

    + We support several different threading models. Unfortunately Pthreads, + the only reasonably well standardized thread model, supports too narrow + an interface for conservative garbage collection. There appears to be + no portable way to allow the collector to coexist with various Pthreads + implementations. Hence we currently support only a few of the more + common Pthreads implementations. +

    + In particular, it is very difficult for the collector to stop all other + threads in the system and examine the register contents. This is currently + accomplished with very different mechanisms for different Pthreads + implementations. The Solaris implementation temporarily disables much + of the user-level threads implementation by stopping kernel-level threads + ("lwp"s). The Irix implementation sends signals to individual Pthreads + and has them wait in the signal handler. The Linux implementation + is similar in spirit to the Irix one. +

    + The Irix implementation uses + only documented Pthreads calls, but relies on extensions to their semantics, + notably the use of mutexes and condition variables from signal + handlers. The Linux implementation should be far closer to + portable, though impirically it is not completely portable. +

    + All implementations must + intercept thread creation and a few other thread-specific calls to allow + enumeration of threads and location of thread stacks. This is current + accomplished with # define's in gc.h, or optionally + by using ld's function call wrapping mechanism under Linux. +

    + Comments are appreciated. Please send mail to + boehm@acm.org + diff -Nrc3pad gcc-3.0.4/boehm-gc/doc/tree.html gcc-3.1/boehm-gc/doc/tree.html *** gcc-3.0.4/boehm-gc/doc/tree.html Thu Jan 1 00:00:00 1970 --- gcc-3.1/boehm-gc/doc/tree.html Fri Aug 17 18:39:18 2001 *************** *** 0 **** --- 1,198 ---- + + + Two-Level Tree Structure for Fast Pointer Lookup + Hans-J. Boehm, Silicon Graphics + + +

    Two-Level Tree Structure for Fast Pointer Lookup

    +

    + The conservative garbage collector described + here uses a 2-level tree + data structure to aid in fast pointer identification. + This data structure is described in a bit more detail here, since +

      +
    1. Variations of the data structure are more generally useful. +
    2. It appears to be hard to understand by reading the code. +
    3. Some other collectors appear to use inferior data structures to + solve the same problem. +
    4. It is central to fast collector operation. +
    + A candidate pointer is divided into three sections, the high, + middle, and low bits. The exact division between these + three groups of bits is dependent on the detailed collector configuration. +

    + The high and middle bits are used to look up an entry in the table described + here. The resulting table entry consists of either a block descriptor + (struct hblkhdr * or hdr *) + identifying the layout of objects in the block, or an indication that this + address range corresponds to the middle of a large block, together with a + hint for locating the actual block descriptor. Such a hint consist + of a displacement that can be subtracted from the middle bits of the candidate + pointer without leaving the object. +

    + In either case, the block descriptor (struct hblkhdr) + refers to a table of object starting addresses (the hb_map field). + The starting address table is indexed by the low bits if the candidate pointer. + The resulting entry contains a displacement to the beginning of the object, + or an indication that this cannot be a valid object pointer. + (If all interior pointer are recognized, pointers into large objects + are handled specially, as appropriate.) + +

    The Tree

    +

    + The rest of this discussion focuses on the two level data structure + used to map the high and middle bits to the block descriptor. +

    + The high bits are used as an index into the GC_top_index (really + GC_arrays._top_index) array. Each entry points to a + bottom_index data structure. This structure in turn consists + mostly of an array index indexed by the middle bits of + the candidate pointer. The index array contains the actual + hdr pointers. +

    + Thus a pointer lookup consists primarily of a handful of memory references, + and can be quite fast: +

      +
    1. The appropriate bottom_index pointer is looked up in + GC_top_index, based on the high bits of the candidate pointer. +
    2. The appropriate hdr pointer is looked up in the + bottom_index structure, based on the middle bits. +
    3. The block layout map pointer is retrieved from the hdr + structure. (This memory reference is necessary since we try to share + block layout maps.) +
    4. The displacement to the beginning of the object is retrieved from the + above map. +
    +

    + In order to conserve space, not all GC_top_index entries in fact + point to distinct bottom_index structures. If no address with + the corresponding high bits is part of the heap, then the entry points + to GC_all_nils, a single bottom_index structure consisting + only of NULL hdr pointers. +

    + Bottom_index structures contain slightly more information than + just hdr pointers. The asc_link field is used to link + all bottom_index structures in ascending order for fast traversal. + This list is pointed to be GC_all_bottom_indices. + It is maintained with the aid of key field that contains the + high bits corresponding to the bottom_index. + +

    64 bit addresses

    +

    + In the case of 64 bit addresses, this picture is complicated slightly + by the fact that one of the index structures would have to be huge to + cover the entire address space with a two level tree. We deal with this + by turning GC_top_index into a chained hash table, instead of + a simple array. This adds a hash_link field to the + bottom_index structure. +

    + The "hash function" consists of dropping the high bits. This is cheap to + compute, and guarantees that there will be no collisions if the heap + is contiguous and not excessively large. + +

    A picture

    +

    + The following is an ASCII diagram of the data structure. + This was contributed by Dave Barrett several years ago. +

    + 
    + 		Data Structure used by GC_base in gc3.7:
    + 			      21-Apr-94
    + 			 
    + 			
    + 
    + 
    +     63                  LOG_TOP_SZ[11]  LOG_BOTTOM_SZ[10]   LOG_HBLKSIZE[13]
    +    +------------------+----------------+------------------+------------------+
    +  p:|                  |   TL_HASH(hi)  |                  |   HBLKDISPL(p)   |
    +    +------------------+----------------+------------------+------------------+
    +     \-----------------------HBLKPTR(p)-------------------/
    +     \------------hi-------------------/ 
    +                       \______ ________/ \________ _______/ \________ _______/
    +                              V                   V                  V
    +                              |                   |                  |
    +            GC_top_index[]    |                   |                  | 
    +  ---      +--------------+   |                   |                  |  
    +   ^       |              |   |                   |                  |   
    +   |       |              |   |                   |                  |   
    +  TOP      +--------------+<--+                   |                  |      
    +  _SZ   +-<|      []      | *                     |                  |     
    + (items)|  +--------------+  if 0 < bi< HBLKSIZE  |                  |    
    +   |    |  |              | then large object     |                  |    
    +   |    |  |              | starts at the bi'th   |                  |    
    +   v    |  |              | HBLK before p.        |             i    |    
    +  ---   |  +--------------+                       |          (word-  |    
    +        v                                         |         aligned) |    
    +    bi= |GET_BI(p){->hash_link}->key==hi          |                  |   
    +        v                                         |                  |    
    +        |   (bottom_index)  \ scratch_alloc'd     |                  |    
    +        |   ( struct  bi )  / by get_index()      |                  |    
    +  ---   +->+--------------+                       |                  |    
    +   ^       |              |                       |                  |
    +   ^       |              |                       |                  |
    +  BOTTOM   |              |   ha=GET_HDR_ADDR(p)  |                  |
    + _SZ(items)+--------------+<----------------------+          +-------+
    +   |   +--<|   index[]    |                                  |         
    +   |   |   +--------------+                      GC_obj_map: v              
    +   |   |   |              |              from      / +-+-+-----+-+-+-+-+  --- 
    +   v   |   |              |              GC_add   < 0| | |     | | | | |   ^  
    +  ---  |   +--------------+             _map_entry \ +-+-+-----+-+-+-+-+   |  
    +       |   |   asc_link   |                          +-+-+-----+-+-+-+-+ MAXOBJSZ
    +       |   +--------------+                      +-->| | |  j  | | | | |  +1   
    +       |   |     key      |                      |   +-+-+-----+-+-+-+-+   |  
    +       |   +--------------+                      |   +-+-+-----+-+-+-+-+   | 
    +       |   |  hash_link   |                      |   | | |     | | | | |   v 
    +       |   +--------------+                      |   +-+-+-----+-+-+-+-+  ---
    +       |                                         |   |<--MAX_OFFSET--->|   
    +       |                                         |         (bytes)
    + HDR(p)| GC_find_header(p)                       |   |<--MAP_ENTRIES-->| 
    +       |                           \ from        |    =HBLKSIZE/WORDSZ   
    +       |    (hdr) (struct hblkhdr) / alloc_hdr() |    (1024 on Alpha)
    +       +-->+----------------------+              |    (8/16 bits each)
    + GET_HDR(p)| word   hb_sz (words) |              |          
    +           +----------------------+              |     
    +           | struct hblk *hb_next |              |
    +           +----------------------+              |       
    +           |mark_proc hb_mark_proc|              |
    +           +----------------------+              |
    +           | char * hb_map        |>-------------+
    +           +----------------------+           
    +           | ushort hb_obj_kind   |           
    +           +----------------------+           
    +           |   hb_last_reclaimed  |           
    +  ---      +----------------------+                
    +   ^       |                      |
    +  MARK_BITS|       hb_marks[]     | *if hdr is free, hb_sz + DISCARD_WORDS
    + _SZ(words)|                      |  is the size of a heap chunk (struct hblk)
    +   v       |                      |  of at least MININCR*HBLKSIZE bytes (below),
    +  ---      +----------------------+  otherwise, size of each object in chunk.
    + 
    + Dynamic data structures above are interleaved throughout the heap in blocks of 
    + size MININCR * HBLKSIZE bytes as done by gc_scratch_alloc which cannot be
    + freed; free lists are used (e.g. alloc_hdr).  HBLK's below are collected.
    + 
    + 	      (struct hblk)      
    +  ---      +----------------------+ < HBLKSIZE ---         ---          DISCARD_
    +   ^       |garbage[DISCARD_WORDS]|   aligned   ^           ^ HDR_BYTES WORDS
    +   |       |                      |             |           v (bytes)   (words)
    +   |       +-----hb_body----------+ < WORDSZ    |          ---   ---   
    +   |       |                      |   aligned   |           ^     ^
    +   |       |      Object 0        |             |           hb_sz |
    +   |       |                      |           i |(word-    (words)|
    +   |       |                      |      (bytes)|aligned)   v     |
    +   |       + - - - - - - - - - - -+ ---         |          ---    |
    +   |       |                      |  ^          |           ^     |
    +   n *     |                      |  j (words)  |          hb_sz BODY_SZ 
    +  HBLKSIZE |      Object 1        |  v          v           |   (words)
    +  (bytes)  |                      |---------------          v   MAX_OFFSET
    +   |       + - - - - - - - - - - -+                        ---  (bytes)
    +   |       |                      | !All_INTERIOR_PTRS      ^     |
    +   |       |                      | sets j only for       hb_sz   |
    +   |       |      Object N        | valid object offsets.   |     |
    +   v       |                      | All objects WORDSZ      v     v
    +  ---      +----------------------+ aligned.               ---   ---
    + 
    + DISCARD_WORDS is normally zero.  Indeed the collector has not been tested
    + with another value in ages.
    + 
    + diff -Nrc3pad gcc-3.0.4/boehm-gc/dyn_load.c gcc-3.1/boehm-gc/dyn_load.c *** gcc-3.0.4/boehm-gc/dyn_load.c Mon Jul 24 04:06:16 2000 --- gcc-3.1/boehm-gc/dyn_load.c Tue Apr 9 00:03:24 2002 *************** *** 26,40 **** * None of this is safe with dlclose and incremental collection. * But then not much of anything is safe in the presence of dlclose. */ ! #ifndef MACOS # include #endif ! #include "gc_priv.h" ! /* BTL: avoid circular redefinition of dlopen if SOLARIS_THREADS defined */ ! # if (defined(LINUX_THREADS) || defined(SOLARIS_THREADS) \ ! || defined(HPUX_THREADS) || defined(IRIX_THREADS)) && defined(dlopen) \ ! && !defined(USE_LD_WRAP) /* To support threads in Solaris, gc.h interposes on dlopen by */ /* defining "dlopen" to be "GC_dlopen", which is implemented below. */ /* However, both GC_FirstDLOpenedLinkMap() and GC_dlopen() use the */ --- 26,43 ---- * None of this is safe with dlclose and incremental collection. * But then not much of anything is safe in the presence of dlclose. */ ! #if defined(__linux__) && !defined(_GNU_SOURCE) ! /* Can't test LINUX, since this must be define before other includes */ ! # define _GNU_SOURCE ! #endif ! #if !defined(MACOS) && !defined(_WIN32_WCE) # include #endif ! #include "private/gc_priv.h" ! /* BTL: avoid circular redefinition of dlopen if GC_SOLARIS_THREADS defined */ ! # if (defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS)) \ ! && defined(dlopen) && !defined(GC_USE_LD_WRAP) /* To support threads in Solaris, gc.h interposes on dlopen by */ /* defining "dlopen" to be "GC_dlopen", which is implemented below. */ /* However, both GC_FirstDLOpenedLinkMap() and GC_dlopen() use the */ *************** *** 46,56 **** # undef GC_must_restore_redefined_dlopen # endif ! #if (defined(DYNAMIC_LOADING) || defined(MSWIN32)) && !defined(PCR) #if !defined(SUNOS4) && !defined(SUNOS5DL) && !defined(IRIX5) && \ ! !defined(MSWIN32) && !(defined(ALPHA) && defined(OSF1)) && \ !defined(HPUX) && !(defined(LINUX) && defined(__ELF__)) && \ ! !defined(RS6000) && !defined(SCO_ELF) --> We only know how to find data segments of dynamic libraries for the --> above. Additional SVR4 variants might not be too --> hard to add. --- 49,63 ---- # undef GC_must_restore_redefined_dlopen # endif ! #if (defined(DYNAMIC_LOADING) || defined(MSWIN32) || defined(MSWINCE)) \ ! && !defined(PCR) #if !defined(SUNOS4) && !defined(SUNOS5DL) && !defined(IRIX5) && \ ! !defined(MSWIN32) && !defined(MSWINCE) && \ ! !(defined(ALPHA) && defined(OSF1)) && \ !defined(HPUX) && !(defined(LINUX) && defined(__ELF__)) && \ ! !defined(RS6000) && !defined(SCO_ELF) && \ ! !(defined(FREEBSD) && defined(__ELF__)) && \ ! !(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) --> We only know how to find data segments of dynamic libraries for the --> above. Additional SVR4 variants might not be too --> hard to add. *************** *** 72,77 **** --- 79,101 ---- # define l_name lm_name #endif + #if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \ + (defined(FREEBSD) && defined(__ELF__)) || \ + (defined(NETBSD) && defined(__ELF__)) || defined(HURD) + # include + # include + # include + #endif + + /* Newer versions of GNU/Linux define this macro. We + * define it similarly for any ELF systems that don't. */ + # ifndef ElfW + # if !defined(ELF_CLASS) || ELF_CLASS == ELFCLASS32 + # define ElfW(type) Elf32_##type + # else + # define ElfW(type) Elf64_##type + # endif + # endif #if defined(SUNOS5DL) && !defined(USE_PROC_FOR_LIBRARIES) *************** *** 82,92 **** static struct link_map * GC_FirstDLOpenedLinkMap() { ! extern Elf32_Dyn _DYNAMIC; ! Elf32_Dyn *dp; struct r_debug *r; static struct link_map * cachedResult = 0; ! static Elf32_Dyn *dynStructureAddr = 0; /* BTL: added to avoid Solaris 5.3 ld.so _DYNAMIC bug */ # ifdef SUNOS53_SHARED_LIB --- 106,116 ---- static struct link_map * GC_FirstDLOpenedLinkMap() { ! extern ElfW(Dyn) _DYNAMIC; ! ElfW(Dyn) *dp; struct r_debug *r; static struct link_map * cachedResult = 0; ! static ElfW(Dyn) *dynStructureAddr = 0; /* BTL: added to avoid Solaris 5.3 ld.so _DYNAMIC bug */ # ifdef SUNOS53_SHARED_LIB *************** GC_FirstDLOpenedLinkMap() *** 96,102 **** /* at program startup. */ if( dynStructureAddr == 0 ) { void* startupSyms = dlopen(0, RTLD_LAZY); ! dynStructureAddr = (Elf32_Dyn*)dlsym(startupSyms, "_DYNAMIC"); } # else dynStructureAddr = &_DYNAMIC; --- 120,126 ---- /* at program startup. */ if( dynStructureAddr == 0 ) { void* startupSyms = dlopen(0, RTLD_LAZY); ! dynStructureAddr = (ElfW(Dyn)*)dlsym(startupSyms, "_DYNAMIC"); } # else dynStructureAddr = &_DYNAMIC; *************** GC_FirstDLOpenedLinkMap() *** 107,113 **** } if( cachedResult == 0 ) { int tag; ! for( dp = ((Elf32_Dyn *)(&_DYNAMIC)); (tag = dp->d_tag) != 0; dp++ ) { if( tag == DT_DEBUG ) { struct link_map *lm = ((struct r_debug *)(dp->d_un.d_ptr))->r_map; --- 131,137 ---- } if( cachedResult == 0 ) { int tag; ! for( dp = ((ElfW(Dyn) *)(&_DYNAMIC)); (tag = dp->d_tag) != 0; dp++ ) { if( tag == DT_DEBUG ) { struct link_map *lm = ((struct r_debug *)(dp->d_un.d_ptr))->r_map; *************** GC_FirstDLOpenedLinkMap() *** 121,126 **** --- 145,155 ---- #endif /* SUNOS5DL ... */ + /* BTL: added to fix circular dlopen definition if GC_SOLARIS_THREADS defined */ + # if defined(GC_must_restore_redefined_dlopen) + # define dlopen GC_dlopen + # endif + #if defined(SUNOS4) && !defined(USE_PROC_FOR_LIBRARIES) #ifdef LINT *************** static ptr_t GC_first_common() *** 161,232 **** #endif /* SUNOS4 ... */ - # if defined(LINUX_THREADS) || defined(SOLARIS_THREADS) \ - || defined(HPUX_THREADS) || defined(IRIX_THREADS) - /* Make sure we're not in the middle of a collection, and make */ - /* sure we don't start any. Returns previous value of GC_dont_gc. */ - /* This is invoked prior to a dlopen call to avoid synchronization */ - /* issues. We can't just acquire the allocation lock, since startup */ - /* code in dlopen may try to allocate. */ - /* This solution risks heap growth in the presence of many dlopen */ - /* calls in either a multithreaded environment, or if the library */ - /* initialization code allocates substantial amounts of GC'ed memory. */ - /* But I don't know of a better solution. */ - /* This can still deadlock if the client explicitly starts a GC */ - /* during the dlopen. He shouldn't do that. */ - static GC_bool disable_gc_for_dlopen() - { - GC_bool result; - LOCK(); - result = GC_dont_gc; - while (GC_incremental && GC_collection_in_progress()) { - GC_collect_a_little_inner(1000); - } - GC_dont_gc = TRUE; - UNLOCK(); - return(result); - } - - /* Redefine dlopen to guarantee mutual exclusion with */ - /* GC_register_dynamic_libraries. */ - /* Should probably happen for other operating systems, too. */ - - #include - - #ifdef USE_LD_WRAP - void * __wrap_dlopen(const char *path, int mode) - #else - void * GC_dlopen(path, mode) - GC_CONST char * path; - int mode; - #endif - { - void * result; - GC_bool dont_gc_save; - - # ifndef USE_PROC_FOR_LIBRARIES - dont_gc_save = disable_gc_for_dlopen(); - # endif - # ifdef USE_LD_WRAP - result = __real_dlopen(path, mode); - # else - result = dlopen(path, mode); - # endif - # ifndef USE_PROC_FOR_LIBRARIES - GC_dont_gc = dont_gc_save; - # endif - return(result); - } - # endif /* SOLARIS_THREADS */ - - /* BTL: added to fix circular dlopen definition if SOLARIS_THREADS defined */ - # if defined(GC_must_restore_redefined_dlopen) - # define dlopen GC_dlopen - # endif - # if defined(SUNOS4) || defined(SUNOS5DL) /* Add dynamic library data sections to the root set. */ ! # if !defined(PCR) && !defined(SOLARIS_THREADS) && defined(THREADS) # ifndef SRC_M3 --> fix mutual exclusion with dlopen # endif /* We assume M3 programs don't call dlopen for now */ --- 190,198 ---- #endif /* SUNOS4 ... */ # if defined(SUNOS4) || defined(SUNOS5DL) /* Add dynamic library data sections to the root set. */ ! # if !defined(PCR) && !defined(GC_SOLARIS_THREADS) && defined(THREADS) # ifndef SRC_M3 --> fix mutual exclusion with dlopen # endif /* We assume M3 programs don't call dlopen for now */ *************** void GC_register_dynamic_libraries() *** 251,264 **** TRUE); # endif # ifdef SUNOS5DL ! Elf32_Ehdr * e; ! Elf32_Phdr * p; unsigned long offset; char * start; register int i; ! e = (Elf32_Ehdr *) lm->l_addr; ! p = ((Elf32_Phdr *)(((char *)(e)) + e->e_phoff)); offset = ((unsigned long)(lm->l_addr)); for( i = 0; i < (int)(e->e_phnum); ((i++),(p++)) ) { switch( p->p_type ) { --- 217,230 ---- TRUE); # endif # ifdef SUNOS5DL ! ElfW(Ehdr) * e; ! ElfW(Phdr) * p; unsigned long offset; char * start; register int i; ! e = (ElfW(Ehdr) *) lm->l_addr; ! p = ((ElfW(Phdr) *)(((char *)(e)) + e->e_phoff)); offset = ((unsigned long)(lm->l_addr)); for( i = 0; i < (int)(e->e_phnum); ((i++),(p++)) ) { switch( p->p_type ) { *************** void GC_register_dynamic_libraries() *** 297,329 **** # endif /* !USE_PROC ... */ # endif /* SUNOS */ ! #if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) /* Dynamic loading code for Linux running ELF. Somewhat tested on * Linux/x86, untested but hopefully should work on Linux/Alpha. * This code was derived from the Solaris/ELF support. Thanks to * whatever kind soul wrote that. - Patrick Bridges */ ! #include #include ! /* Newer versions of Linux/Alpha and Linux/x86 define this macro. We ! * define it for those older versions that don't. */ ! # ifndef ElfW ! # if !defined(ELF_CLASS) || ELF_CLASS == ELFCLASS32 ! # define ElfW(type) Elf32_##type ! # else ! # define ElfW(type) Elf64_##type ! # endif ! # endif static struct link_map * GC_FirstDLOpenedLinkMap() { - # ifdef __GNUC__ - # pragma weak _DYNAMIC - # endif - extern ElfW(Dyn) _DYNAMIC[]; ElfW(Dyn) *dp; struct r_debug *r; static struct link_map *cachedResult = 0; --- 263,542 ---- # endif /* !USE_PROC ... */ # endif /* SUNOS */ ! #if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \ ! (defined(FREEBSD) && defined(__ELF__)) || \ ! (defined(NETBSD) && defined(__ELF__)) || defined(HURD) ! ! ! #ifdef USE_PROC_FOR_LIBRARIES ! ! #include ! ! #include ! #include ! #include ! ! #define MAPS_BUF_SIZE (32*1024) ! ! extern ssize_t GC_repeat_read(int fd, char *buf, size_t count); ! /* Repeatedly read until buffer is filled, or EOF is encountered */ ! /* Defined in os_dep.c. */ ! ! static char *parse_map_entry(char *buf_ptr, word *start, word *end, ! char *prot_buf, unsigned int *maj_dev); ! ! void GC_register_dynamic_libraries() ! { ! int f; ! int result; ! char prot_buf[5]; ! int maps_size; ! char maps_temp[32768]; ! char *maps_buf; ! char *buf_ptr; ! int count; ! word start, end; ! unsigned int maj_dev, min_dev; ! word least_ha, greatest_ha; ! unsigned i; ! word datastart = (word)(DATASTART); ! ! /* Read /proc/self/maps */ ! /* Note that we may not allocate, and thus can't use stdio. */ ! f = open("/proc/self/maps", O_RDONLY); ! if (-1 == f) ABORT("Couldn't open /proc/self/maps"); ! /* stat() doesn't work for /proc/self/maps, so we have to ! read it to find out how large it is... */ ! maps_size = 0; ! do { ! result = GC_repeat_read(f, maps_temp, sizeof(maps_temp)); ! if (result <= 0) ABORT("Couldn't read /proc/self/maps"); ! maps_size += result; ! } while (result == sizeof(maps_temp)); ! ! if (maps_size > sizeof(maps_temp)) { ! /* If larger than our buffer, close and re-read it. */ ! close(f); ! f = open("/proc/self/maps", O_RDONLY); ! if (-1 == f) ABORT("Couldn't open /proc/self/maps"); ! maps_buf = alloca(maps_size); ! if (NULL == maps_buf) ABORT("/proc/self/maps alloca failed"); ! result = GC_repeat_read(f, maps_buf, maps_size); ! if (result <= 0) ABORT("Couldn't read /proc/self/maps"); ! } else { ! /* Otherwise use the fixed size buffer */ ! maps_buf = maps_temp; ! } ! ! close(f); ! maps_buf[result] = '\0'; ! buf_ptr = maps_buf; ! /* Compute heap bounds. Should be done by add_to_heap? */ ! least_ha = (word)(-1); ! greatest_ha = 0; ! for (i = 0; i < GC_n_heap_sects; ++i) { ! word sect_start = (word)GC_heap_sects[i].hs_start; ! word sect_end = sect_start + GC_heap_sects[i].hs_bytes; ! if (sect_start < least_ha) least_ha = sect_start; ! if (sect_end > greatest_ha) greatest_ha = sect_end; ! } ! if (greatest_ha < (word)GC_scratch_last_end_ptr) ! greatest_ha = (word)GC_scratch_last_end_ptr; ! for (;;) { ! ! buf_ptr = parse_map_entry(buf_ptr, &start, &end, prot_buf, &maj_dev); ! if (buf_ptr == NULL) return; ! ! if (prot_buf[1] == 'w') { ! /* This is a writable mapping. Add it to */ ! /* the root set unless it is already otherwise */ ! /* accounted for. */ ! if (start <= (word)GC_stackbottom && end >= (word)GC_stackbottom) { ! /* Stack mapping; discard */ ! continue; ! } ! if (start <= datastart && end > datastart && maj_dev != 0) { ! /* Main data segment; discard */ ! continue; ! } ! # ifdef THREADS ! if (GC_segment_is_thread_stack(start, end)) continue; ! # endif ! /* The rest of this assumes that there is no mapping */ ! /* spanning the beginning of the data segment, or extending */ ! /* beyond the entire heap at both ends. */ ! /* Empirically these assumptions hold. */ ! ! if (start < (word)DATAEND && end > (word)DATAEND) { ! /* Rld may use space at the end of the main data */ ! /* segment. Thus we add that in. */ ! start = (word)DATAEND; ! } ! if (start < least_ha && end > least_ha) { ! end = least_ha; ! } ! if (start < greatest_ha && end > greatest_ha) { ! start = greatest_ha; ! } ! if (start >= least_ha && end <= greatest_ha) continue; ! GC_add_roots_inner((char *)start, (char *)end, TRUE); ! } ! } ! } ! ! // ! // parse_map_entry parses an entry from /proc/self/maps so we can ! // locate all writable data segments that belong to shared libraries. ! // The format of one of these entries and the fields we care about ! // is as follows: ! // XXXXXXXX-XXXXXXXX r-xp 00000000 30:05 260537 name of mapping...\n ! // ^^^^^^^^ ^^^^^^^^ ^^^^ ^^ ! // start end prot maj_dev ! // 0 9 18 32 ! // ! // The parser is called with a pointer to the entry and the return value ! // is either NULL or is advanced to the next entry(the byte after the ! // trailing '\n'.) ! // ! #define OFFSET_MAP_START 0 ! #define OFFSET_MAP_END 9 ! #define OFFSET_MAP_PROT 18 ! #define OFFSET_MAP_MAJDEV 32 ! ! static char *parse_map_entry(char *buf_ptr, word *start, word *end, ! char *prot_buf, unsigned int *maj_dev) ! { ! int i; ! unsigned int val; ! char *tok; ! ! if (buf_ptr == NULL || *buf_ptr == '\0') { ! return NULL; ! } ! ! memcpy(prot_buf, buf_ptr+OFFSET_MAP_PROT, 4); // do the protections first ! prot_buf[4] = '\0'; ! ! if (prot_buf[1] == 'w') { // we can skip all of this if it's not writable ! ! tok = buf_ptr; ! buf_ptr[OFFSET_MAP_START+8] = '\0'; ! *start = strtoul(tok, NULL, 16); ! ! tok = buf_ptr+OFFSET_MAP_END; ! buf_ptr[OFFSET_MAP_END+8] = '\0'; ! *end = strtoul(tok, NULL, 16); ! ! buf_ptr += OFFSET_MAP_MAJDEV; ! tok = buf_ptr; ! while (*buf_ptr != ':') buf_ptr++; ! *buf_ptr++ = '\0'; ! *maj_dev = strtoul(tok, NULL, 16); ! } ! ! while (*buf_ptr && *buf_ptr++ != '\n'); ! ! return buf_ptr; ! } ! ! #endif /* USE_PROC_FOR_LIBRARIES */ ! ! #if !defined(USE_PROC_FOR_LIBRARIES) ! /* The following is the preferred way to walk dynamic libraries */ ! /* For glibc 2.2.4+. Unfortunately, it doesn't work for older */ ! /* versions. Thanks to Jakub Jelinek for most of the code. */ ! ! # if defined(LINUX) /* Are others OK here, too? */ \ ! && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \ ! || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) ! ! /* We have the header files for a glibc that includes dl_iterate_phdr. */ ! /* It may still not be available in the library on the target system. */ ! /* Thus we also treat it as a weak symbol. */ ! #define HAVE_DL_ITERATE_PHDR ! ! static int GC_register_dynlib_callback(info, size, ptr) ! struct dl_phdr_info * info; ! size_t size; ! void * ptr; ! { ! const ElfW(Phdr) * p; ! char * start; ! register int i; ! ! /* Make sure struct dl_phdr_info is at least as big as we need. */ ! if (size < offsetof (struct dl_phdr_info, dlpi_phnum) ! + sizeof (info->dlpi_phnum)) ! return -1; ! ! /* Skip the first object - it is the main program. */ ! if (*(int *)ptr == 0) ! { ! *(int *)ptr = 1; ! return 0; ! } ! ! p = info->dlpi_phdr; ! for( i = 0; i < (int)(info->dlpi_phnum); ((i++),(p++)) ) { ! switch( p->p_type ) { ! case PT_LOAD: ! { ! if( !(p->p_flags & PF_W) ) break; ! start = ((char *)(p->p_vaddr)) + info->dlpi_addr; ! GC_add_roots_inner(start, start + p->p_memsz, TRUE); ! } ! break; ! default: ! break; ! } ! } ! ! return 0; ! } ! ! /* Return TRUE if we succeed, FALSE if dl_iterate_phdr wasn't there. */ ! ! #pragma weak dl_iterate_phdr ! ! GC_bool GC_register_dynamic_libraries_dl_iterate_phdr() ! { ! int tmp = 0; ! ! if (dl_iterate_phdr) { ! dl_iterate_phdr(GC_register_dynlib_callback, &tmp); ! return TRUE; ! } else { ! return FALSE; ! } ! } ! ! # else /* !LINUX || version(glibc) < 2.2.4 */ /* Dynamic loading code for Linux running ELF. Somewhat tested on * Linux/x86, untested but hopefully should work on Linux/Alpha. * This code was derived from the Solaris/ELF support. Thanks to * whatever kind soul wrote that. - Patrick Bridges */ ! /* This doesn't necessarily work in all cases, e.g. with preloaded ! * dynamic libraries. */ ! ! #if defined(NETBSD) ! # include ! #else ! # include ! #endif #include ! # endif ! ! #ifdef __GNUC__ ! # pragma weak _DYNAMIC ! #endif ! extern ElfW(Dyn) _DYNAMIC[]; static struct link_map * GC_FirstDLOpenedLinkMap() { ElfW(Dyn) *dp; struct r_debug *r; static struct link_map *cachedResult = 0; *************** GC_FirstDLOpenedLinkMap() *** 348,356 **** void GC_register_dynamic_libraries() { ! struct link_map *lm = GC_FirstDLOpenedLinkMap(); for (lm = GC_FirstDLOpenedLinkMap(); lm != (struct link_map *) 0; lm = lm->l_next) { --- 561,575 ---- void GC_register_dynamic_libraries() { ! struct link_map *lm; + # ifdef HAVE_DL_ITERATE_PHDR + if (GC_register_dynamic_libraries_dl_iterate_phdr()) { + return; + } + # endif + lm = GC_FirstDLOpenedLinkMap(); for (lm = GC_FirstDLOpenedLinkMap(); lm != (struct link_map *) 0; lm = lm->l_next) { *************** void GC_register_dynamic_libraries() *** 379,402 **** } } ! #endif ! #if defined(IRIX5) || defined(USE_PROC_FOR_LIBRARIES) #include #include #include #include #include extern void * GC_roots_present(); /* The type is a lie, since the real type doesn't make sense here, */ /* and we only test for NULL. */ - #ifndef GC_scratch_last_end_ptr - extern ptr_t GC_scratch_last_end_ptr; /* End of GC_scratch_alloc arena */ - #endif - /* We use /proc to track down all parts of the address space that are */ /* mapped by the process, and throw out regions we know we shouldn't */ /* worry about. This may also work under other SVR4 variants. */ --- 598,623 ---- } } ! #endif /* !USE_PROC_FOR_LIBRARIES */ ! #endif /* LINUX */ ! ! #if defined(IRIX5) || (defined(USE_PROC_FOR_LIBRARIES) && !defined(LINUX)) #include #include #include #include #include + #include /* Only for the following test. */ + #ifndef _sigargs + # define IRIX6 + #endif extern void * GC_roots_present(); /* The type is a lie, since the real type doesn't make sense here, */ /* and we only test for NULL. */ /* We use /proc to track down all parts of the address space that are */ /* mapped by the process, and throw out regions we know we shouldn't */ /* worry about. This may also work under other SVR4 variants. */ *************** void GC_register_dynamic_libraries() *** 452,458 **** if ((flags & (MA_BREAK | MA_STACK | MA_PHYS)) != 0) goto irrelevant; if ((flags & (MA_READ | MA_WRITE)) != (MA_READ | MA_WRITE)) goto irrelevant; ! /* The latter test is empirically useless. Other than the */ /* main data and stack segments, everything appears to be */ /* mapped readable, writable, executable, and shared(!!). */ /* This makes no sense to me. - HB */ --- 673,680 ---- if ((flags & (MA_BREAK | MA_STACK | MA_PHYS)) != 0) goto irrelevant; if ((flags & (MA_READ | MA_WRITE)) != (MA_READ | MA_WRITE)) goto irrelevant; ! /* The latter test is empirically useless in very old Irix */ ! /* versions. Other than the */ /* main data and stack segments, everything appears to be */ /* mapped readable, writable, executable, and shared(!!). */ /* This makes no sense to me. - HB */ *************** void GC_register_dynamic_libraries() *** 465,471 **** # endif /* MMAP_STACKS */ limit = start + addr_map[i].pr_size; ! if (addr_map[i].pr_off == 0 && strncmp(start, ELFMAG, 4) == 0) { /* Discard text segments, i.e. 0-offset mappings against */ /* executable files which appear to have ELF headers. */ caddr_t arg; --- 687,697 ---- # endif /* MMAP_STACKS */ limit = start + addr_map[i].pr_size; ! /* The following seemed to be necessary for very old versions */ ! /* of Irix, but it has been reported to discard relevant */ ! /* segments under Irix 6.5. */ ! # ifndef IRIX6 ! if (addr_map[i].pr_off == 0 && strncmp(start, ELFMAG, 4) == 0) { /* Discard text segments, i.e. 0-offset mappings against */ /* executable files which appear to have ELF headers. */ caddr_t arg; *************** void GC_register_dynamic_libraries() *** 492,498 **** goto irrelevant; } } ! } GC_add_roots_inner(start, limit, TRUE); irrelevant: ; } --- 718,725 ---- goto irrelevant; } } ! } ! # endif /* !IRIX6 */ GC_add_roots_inner(start, limit, TRUE); irrelevant: ; } *************** void GC_register_dynamic_libraries() *** 504,510 **** # endif /* USE_PROC || IRIX5 */ ! # ifdef MSWIN32 # define WIN32_LEAN_AND_MEAN # define NOSERVICE --- 731,737 ---- # endif /* USE_PROC || IRIX5 */ ! # if defined(MSWIN32) || defined(MSWINCE) # define WIN32_LEAN_AND_MEAN # define NOSERVICE *************** void GC_register_dynamic_libraries() *** 513,598 **** /* We traverse the entire address space and register all segments */ /* that could possibly have been written to. */ - DWORD GC_allocation_granularity; extern GC_bool GC_is_heap_base (ptr_t p); ! # ifdef WIN32_THREADS extern void GC_get_next_stack(char *start, char **lo, char **hi); ! # endif ! ! void GC_cond_add_roots(char *base, char * limit) ! { ! char dummy; ! char * stack_top ! = (char *) ((word)(&dummy) & ~(GC_allocation_granularity-1)); ! if (base == limit) return; ! # ifdef WIN32_THREADS { ! char * curr_base = base; ! char * next_stack_lo; ! char * next_stack_hi; ! ! for(;;) { ! GC_get_next_stack(curr_base, &next_stack_lo, &next_stack_hi); ! if (next_stack_lo >= limit) break; ! GC_add_roots_inner(curr_base, next_stack_lo, TRUE); ! curr_base = next_stack_hi; ! } ! if (curr_base < limit) GC_add_roots_inner(curr_base, limit, TRUE); } ! # else ! if (limit > stack_top && base < GC_stackbottom) { ! /* Part of the stack; ignore it. */ ! return; ! } ! GC_add_roots_inner(base, limit, TRUE); ! # endif ! } ! ! extern GC_bool GC_win32s; void GC_register_dynamic_libraries() { MEMORY_BASIC_INFORMATION buf; - SYSTEM_INFO sysinfo; DWORD result; DWORD protect; LPVOID p; char * base; char * limit, * new_limit; ! ! if (GC_win32s) return; ! GetSystemInfo(&sysinfo); ! base = limit = p = sysinfo.lpMinimumApplicationAddress; ! GC_allocation_granularity = sysinfo.dwAllocationGranularity; ! while (p < sysinfo.lpMaximumApplicationAddress) { result = VirtualQuery(p, &buf, sizeof(buf)); ! if (result != sizeof(buf)) { ! ABORT("Weird VirtualQuery result"); ! } ! new_limit = (char *)p + buf.RegionSize; ! protect = buf.Protect; ! if (buf.State == MEM_COMMIT ! && (protect == PAGE_EXECUTE_READWRITE ! || protect == PAGE_READWRITE) ! && !GC_is_heap_base(buf.AllocationBase)) { ! if ((char *)p == limit) { ! limit = new_limit; ! } else { ! GC_cond_add_roots(base, limit); ! base = p; ! limit = new_limit; ! } ! } if (p > (LPVOID)new_limit /* overflow */) break; p = (LPVOID)new_limit; } GC_cond_add_roots(base, limit); } ! #endif /* MSWIN32 */ ! #if defined(ALPHA) && defined(OSF1) #include --- 740,836 ---- /* We traverse the entire address space and register all segments */ /* that could possibly have been written to. */ extern GC_bool GC_is_heap_base (ptr_t p); ! # ifdef GC_WIN32_THREADS extern void GC_get_next_stack(char *start, char **lo, char **hi); ! void GC_cond_add_roots(char *base, char * limit) { ! char * curr_base = base; ! char * next_stack_lo; ! char * next_stack_hi; ! ! if (base == limit) return; ! for(;;) { ! GC_get_next_stack(curr_base, &next_stack_lo, &next_stack_hi); ! if (next_stack_lo >= limit) break; ! GC_add_roots_inner(curr_base, next_stack_lo, TRUE); ! curr_base = next_stack_hi; ! } ! if (curr_base < limit) GC_add_roots_inner(curr_base, limit, TRUE); } ! # else ! void GC_cond_add_roots(char *base, char * limit) ! { ! char dummy; ! char * stack_top ! = (char *) ((word)(&dummy) & ~(GC_sysinfo.dwAllocationGranularity-1)); ! if (base == limit) return; ! if (limit > stack_top && base < GC_stackbottom) { ! /* Part of the stack; ignore it. */ ! return; ! } ! GC_add_roots_inner(base, limit, TRUE); ! } ! # endif ! ! # ifndef MSWINCE ! extern GC_bool GC_no_win32_dlls; ! # endif void GC_register_dynamic_libraries() { MEMORY_BASIC_INFORMATION buf; DWORD result; DWORD protect; LPVOID p; char * base; char * limit, * new_limit; ! ! # ifdef MSWIN32 ! if (GC_no_win32_dlls) return; ! # endif ! base = limit = p = GC_sysinfo.lpMinimumApplicationAddress; ! # if defined(MSWINCE) && !defined(_WIN32_WCE_EMULATION) ! /* Only the first 32 MB of address space belongs to the current process */ ! while (p < (LPVOID)0x02000000) { result = VirtualQuery(p, &buf, sizeof(buf)); ! if (result == 0) { ! /* Page is free; advance to the next possible allocation base */ ! new_limit = (char *) ! (((DWORD) p + GC_sysinfo.dwAllocationGranularity) ! & ~(GC_sysinfo.dwAllocationGranularity-1)); ! } else ! # else ! while (p < GC_sysinfo.lpMaximumApplicationAddress) { ! result = VirtualQuery(p, &buf, sizeof(buf)); ! # endif ! { ! if (result != sizeof(buf)) { ! ABORT("Weird VirtualQuery result"); ! } ! new_limit = (char *)p + buf.RegionSize; ! protect = buf.Protect; ! if (buf.State == MEM_COMMIT ! && (protect == PAGE_EXECUTE_READWRITE ! || protect == PAGE_READWRITE) ! && !GC_is_heap_base(buf.AllocationBase)) { ! if ((char *)p != limit) { ! GC_cond_add_roots(base, limit); ! base = p; ! } ! limit = new_limit; ! } ! } if (p > (LPVOID)new_limit /* overflow */) break; p = (LPVOID)new_limit; } GC_cond_add_roots(base, limit); } ! #endif /* MSWIN32 || MSWINCE */ ! #if defined(ALPHA) && defined(OSF1) #include *************** void GC_register_dynamic_libraries() *** 720,726 **** /* Check if this is the end of the list or if some error occured */ if (status != 0) { ! # ifdef HPUX_THREADS /* I've seen errno values of 0. The man page is not clear */ /* as to whether errno should get set on a -1 return. */ break; --- 958,964 ---- /* Check if this is the end of the list or if some error occured */ if (status != 0) { ! # ifdef GC_HPUX_THREADS /* I've seen errno values of 0. The man page is not clear */ /* as to whether errno should get set on a -1 return. */ break; diff -Nrc3pad gcc-3.0.4/boehm-gc/finalize.c gcc-3.1/boehm-gc/finalize.c *** gcc-3.0.4/boehm-gc/finalize.c Thu Apr 5 00:13:13 2001 --- gcc-3.1/boehm-gc/finalize.c Tue Feb 12 04:37:53 2002 *************** *** 14,21 **** */ /* Boehm, February 1, 1996 1:19 pm PST */ # define I_HIDE_POINTERS ! # include "gc_priv.h" ! # include "gc_mark.h" # ifdef FINALIZE_ON_DEMAND int GC_finalize_on_demand = 1; --- 14,20 ---- */ /* Boehm, February 1, 1996 1:19 pm PST */ # define I_HIDE_POINTERS ! # include "private/gc_pmark.h" # ifdef FINALIZE_ON_DEMAND int GC_finalize_on_demand = 1; *************** static signed_word log_fo_table_size = - *** 86,98 **** word GC_fo_entries = 0; ! # ifdef SRC_M3 ! void GC_push_finalizer_structures() { GC_push_all((ptr_t)(&dl_head), (ptr_t)(&dl_head) + sizeof(word)); GC_push_all((ptr_t)(&fo_head), (ptr_t)(&fo_head) + sizeof(word)); } - # endif /* Double the size of a hash table. *size_ptr is the log of its current */ /* size. May be a noop. */ --- 85,97 ---- word GC_fo_entries = 0; ! void GC_push_finalizer_structures GC_PROTO((void)) { GC_push_all((ptr_t)(&dl_head), (ptr_t)(&dl_head) + sizeof(word)); GC_push_all((ptr_t)(&fo_head), (ptr_t)(&fo_head) + sizeof(word)); + GC_push_all((ptr_t)(&GC_finalize_now), + (ptr_t)(&GC_finalize_now) + sizeof(word)); } /* Double the size of a hash table. *size_ptr is the log of its current */ /* size. May be a noop. */ *************** signed_word * log_size_ptr; *** 110,116 **** word old_size = ((log_old_size == -1)? 0: (1 << log_old_size)); register word new_size = 1 << log_new_size; struct hash_chain_entry **new_table = (struct hash_chain_entry **) ! GC_generic_malloc_inner_ignore_off_page( (size_t)new_size * sizeof(struct hash_chain_entry *), NORMAL); if (new_table == 0) { --- 109,115 ---- word old_size = ((log_old_size == -1)? 0: (1 << log_old_size)); register word new_size = 1 << log_new_size; struct hash_chain_entry **new_table = (struct hash_chain_entry **) ! GC_INTERNAL_MALLOC_IGNORE_OFF_PAGE( (size_t)new_size * sizeof(struct hash_chain_entry *), NORMAL); if (new_table == 0) { *************** signed_word * log_size_ptr; *** 179,187 **** # endif GC_grow_table((struct hash_chain_entry ***)(&dl_head), &log_dl_table_size); ! # ifdef PRINTSTATS GC_printf1("Grew dl table to %lu entries\n", (unsigned long)(1 << log_dl_table_size)); # endif # ifndef THREADS ENABLE_SIGNALS(); --- 178,188 ---- # endif GC_grow_table((struct hash_chain_entry ***)(&dl_head), &log_dl_table_size); ! # ifdef CONDPRINT ! if (GC_print_stats) { GC_printf1("Grew dl table to %lu entries\n", (unsigned long)(1 << log_dl_table_size)); + } # endif # ifndef THREADS ENABLE_SIGNALS(); *************** signed_word * log_size_ptr; *** 199,220 **** return(1); } } ! # ifdef THREADS ! new_dl = (struct disappearing_link *) ! GC_generic_malloc_inner(sizeof(struct disappearing_link),NORMAL); ! # else ! new_dl = (struct disappearing_link *) ! GC_malloc(sizeof(struct disappearing_link)); ! # endif ! if (new_dl != 0) { ! new_dl -> dl_hidden_obj = HIDE_POINTER(obj); ! new_dl -> dl_hidden_link = HIDE_POINTER(link); ! dl_set_next(new_dl, dl_head[index]); ! dl_head[index] = new_dl; ! GC_dl_entries++; ! } else { ! GC_finalization_failures++; } # ifdef THREADS UNLOCK(); ENABLE_SIGNALS(); --- 200,228 ---- return(1); } } ! new_dl = (struct disappearing_link *) ! GC_INTERNAL_MALLOC(sizeof(struct disappearing_link),NORMAL); ! if (0 == new_dl) { ! # ifdef THREADS ! UNLOCK(); ! ENABLE_SIGNALS(); ! # endif ! new_dl = GC_oom_fn(sizeof(struct disappearing_link)); ! if (0 == new_dl) { ! GC_finalization_failures++; ! return(0); ! } ! /* It's not likely we'll make it here, but ... */ ! # ifdef THREADS ! DISABLE_SIGNALS(); ! LOCK(); ! # endif } + new_dl -> dl_hidden_obj = HIDE_POINTER(obj); + new_dl -> dl_hidden_link = HIDE_POINTER(link); + dl_set_next(new_dl, dl_head[index]); + dl_head[index] = new_dl; + GC_dl_entries++; # ifdef THREADS UNLOCK(); ENABLE_SIGNALS(); *************** signed_word * log_size_ptr; *** 248,254 **** GC_dl_entries--; UNLOCK(); ENABLE_SIGNALS(); ! GC_free((GC_PTR)curr_dl); return(1); } prev_dl = curr_dl; --- 256,266 ---- GC_dl_entries--; UNLOCK(); ENABLE_SIGNALS(); ! # ifdef DBG_HDRS_ALL ! dl_set_next(curr_dl, 0); ! # else ! GC_free((GC_PTR)curr_dl); ! # endif return(1); } prev_dl = curr_dl; *************** ptr_t p; *** 283,289 **** ptr_t scan_limit; ptr_t target_limit = p + WORDS_TO_BYTES(hhdr -> hb_sz) - 1; ! if ((descr & DS_TAGS) == DS_LENGTH) { scan_limit = p + descr - sizeof(word); } else { scan_limit = target_limit + 1 - sizeof(word); --- 295,301 ---- ptr_t scan_limit; ptr_t target_limit = p + WORDS_TO_BYTES(hhdr -> hb_sz) - 1; ! if ((descr & GC_DS_TAGS) == GC_DS_LENGTH) { scan_limit = p + descr - sizeof(word); } else { scan_limit = target_limit + 1 - sizeof(word); *************** finalization_mark_proc * mp; *** 338,346 **** # endif GC_grow_table((struct hash_chain_entry ***)(&fo_head), &log_fo_table_size); ! # ifdef PRINTSTATS GC_printf1("Grew fo table to %lu entries\n", (unsigned long)(1 << log_fo_table_size)); # endif # ifndef THREADS ENABLE_SIGNALS(); --- 350,360 ---- # endif GC_grow_table((struct hash_chain_entry ***)(&fo_head), &log_fo_table_size); ! # ifdef CONDPRINT ! if (GC_print_stats) { GC_printf1("Grew fo table to %lu entries\n", (unsigned long)(1 << log_fo_table_size)); + } # endif # ifndef THREADS ENABLE_SIGNALS(); *************** finalization_mark_proc * mp; *** 370,376 **** /* May not happen if we get a signal. But a high */ /* estimate will only make the table larger than */ /* necessary. */ ! # ifndef THREADS GC_free((GC_PTR)curr_fo); # endif } else { --- 384,390 ---- /* May not happen if we get a signal. But a high */ /* estimate will only make the table larger than */ /* necessary. */ ! # if !defined(THREADS) && !defined(DBG_HDRS_ALL) GC_free((GC_PTR)curr_fo); # endif } else { *************** finalization_mark_proc * mp; *** 406,440 **** GET_HDR(base, hhdr); if (0 == hhdr) { /* We won't collect it, hence finalizer wouldn't be run. */ - /* This is changed for gcj, but it will be in version 6.0 of the */ - /* standard collector distribution. It costs virtually nothing */ - /* here, but it's expensive to check in the hash synchronization */ - /* code, where it matters. -HB */ # ifdef THREADS UNLOCK(); ENABLE_SIGNALS(); # endif return; } ! # ifdef THREADS ! new_fo = (struct finalizable_object *) ! GC_generic_malloc_inner(sizeof(struct finalizable_object),NORMAL); ! # else ! new_fo = (struct finalizable_object *) ! GC_malloc(sizeof(struct finalizable_object)); ! # endif ! if (new_fo != 0) { ! new_fo -> fo_hidden_base = (word)HIDE_POINTER(base); ! new_fo -> fo_fn = fn; ! new_fo -> fo_client_data = (ptr_t)cd; ! new_fo -> fo_object_size = hhdr -> hb_sz; ! new_fo -> fo_mark_proc = mp; ! fo_set_next(new_fo, fo_head[index]); ! GC_fo_entries++; ! fo_head[index] = new_fo; ! } else { ! GC_finalization_failures++; } # ifdef THREADS UNLOCK(); ENABLE_SIGNALS(); --- 420,457 ---- GET_HDR(base, hhdr); if (0 == hhdr) { /* We won't collect it, hence finalizer wouldn't be run. */ # ifdef THREADS UNLOCK(); ENABLE_SIGNALS(); # endif return; } ! new_fo = (struct finalizable_object *) ! GC_INTERNAL_MALLOC(sizeof(struct finalizable_object),NORMAL); ! if (0 == new_fo) { ! # ifdef THREADS ! UNLOCK(); ! ENABLE_SIGNALS(); ! # endif ! new_fo = GC_oom_fn(sizeof(struct finalizable_object)); ! if (0 == new_fo) { ! GC_finalization_failures++; ! return; ! } ! /* It's not likely we'll make it here, but ... */ ! # ifdef THREADS ! DISABLE_SIGNALS(); ! LOCK(); ! # endif } + new_fo -> fo_hidden_base = (word)HIDE_POINTER(base); + new_fo -> fo_fn = fn; + new_fo -> fo_client_data = (ptr_t)cd; + new_fo -> fo_object_size = hhdr -> hb_sz; + new_fo -> fo_mark_proc = mp; + fo_set_next(new_fo, fo_head[index]); + GC_fo_entries++; + fo_head[index] = new_fo; # ifdef THREADS UNLOCK(); ENABLE_SIGNALS(); *************** finalization_mark_proc * mp; *** 492,497 **** --- 509,542 ---- ocd, GC_null_finalize_mark_proc); } + #ifndef NO_DEBUGGING + void GC_dump_finalization() + { + struct disappearing_link * curr_dl; + struct finalizable_object * curr_fo; + ptr_t real_ptr, real_link; + int dl_size = (log_dl_table_size == -1 ) ? 0 : (1 << log_dl_table_size); + int fo_size = (log_fo_table_size == -1 ) ? 0 : (1 << log_fo_table_size); + int i; + + GC_printf0("Disappearing links:\n"); + for (i = 0; i < dl_size; i++) { + for (curr_dl = dl_head[i]; curr_dl != 0; curr_dl = dl_next(curr_dl)) { + real_ptr = (ptr_t)REVEAL_POINTER(curr_dl -> dl_hidden_obj); + real_link = (ptr_t)REVEAL_POINTER(curr_dl -> dl_hidden_link); + GC_printf2("Object: 0x%lx, Link:0x%lx\n", real_ptr, real_link); + } + } + GC_printf0("Finalizers:\n"); + for (i = 0; i < fo_size; i++) { + for (curr_fo = fo_head[i]; curr_fo != 0; curr_fo = fo_next(curr_fo)) { + real_ptr = (ptr_t)REVEAL_POINTER(curr_fo -> fo_hidden_base); + GC_printf1("Finalizable object: 0x%lx\n", real_ptr); + } + } + } + #endif + /* Called with world stopped. Cause disappearing links to disappear, */ /* and invoke finalizers. */ void GC_finalize() *************** void GC_finalize() *** 529,537 **** } /* Mark all objects reachable via chains of 1 or more pointers */ /* from finalizable objects. */ ! # ifdef PRINTSTATS ! if (GC_mark_state != MS_NONE) ABORT("Bad mark state"); ! # endif for (i = 0; i < fo_size; i++) { for (curr_fo = fo_head[i]; curr_fo != 0; curr_fo = fo_next(curr_fo)) { real_ptr = (ptr_t)REVEAL_POINTER(curr_fo -> fo_hidden_base); --- 574,580 ---- } /* Mark all objects reachable via chains of 1 or more pointers */ /* from finalizable objects. */ ! GC_ASSERT(GC_mark_state == MS_NONE); for (i = 0; i < fo_size; i++) { for (curr_fo = fo_head[i]; curr_fo != 0; curr_fo = fo_next(curr_fo)) { real_ptr = (ptr_t)REVEAL_POINTER(curr_fo -> fo_hidden_base); *************** void GC_finalize() *** 574,584 **** GC_words_finalized += ALIGNED_WORDS(curr_fo -> fo_object_size) + ALIGNED_WORDS(sizeof(struct finalizable_object)); ! # ifdef PRINTSTATS ! if (!GC_is_marked((ptr_t)curr_fo)) { ! ABORT("GC_finalize: found accessible unmarked object\n"); ! } ! # endif curr_fo = next_fo; } else { prev_fo = curr_fo; --- 617,623 ---- GC_words_finalized += ALIGNED_WORDS(curr_fo -> fo_object_size) + ALIGNED_WORDS(sizeof(struct finalizable_object)); ! GC_ASSERT(GC_is_marked(GC_base((ptr_t)curr_fo))); curr_fo = next_fo; } else { prev_fo = curr_fo; *************** int GC_invoke_finalizers() *** 753,758 **** --- 792,816 ---- return count; } + void (* GC_finalizer_notifier)() = (void (*) GC_PROTO((void)))0; + + static GC_word last_finalizer_notification = 0; + + void GC_notify_or_invoke_finalizers GC_PROTO((void)) + { + if (GC_finalize_now == 0) return; + if (!GC_finalize_on_demand) { + (void) GC_invoke_finalizers(); + GC_ASSERT(GC_finalize_now == 0); + return; + } + if (GC_finalizer_notifier != (void (*) GC_PROTO((void)))0 + && last_finalizer_notification != GC_gc_no) { + last_finalizer_notification = GC_gc_no; + GC_finalizer_notifier(); + } + } + # ifdef __STDC__ GC_PTR GC_call_with_alloc_lock(GC_fn_type fn, GC_PTR client_data) *************** int GC_invoke_finalizers() *** 772,780 **** # endif result = (*fn)(client_data); # ifdef THREADS ! UNSET_LOCK_HOLDER(); UNLOCK(); ENABLE_SIGNALS(); # endif return(result); } --- 830,841 ---- # endif result = (*fn)(client_data); # ifdef THREADS ! # ifndef GC_ASSERTIONS ! UNSET_LOCK_HOLDER(); ! # endif /* o.w. UNLOCK() does it implicitly */ UNLOCK(); ENABLE_SIGNALS(); # endif return(result); } + diff -Nrc3pad gcc-3.0.4/boehm-gc/gc.h gcc-3.1/boehm-gc/gc.h *** gcc-3.0.4/boehm-gc/gc.h Tue Jun 20 01:04:58 2000 --- gcc-3.1/boehm-gc/gc.h Thu Jan 1 00:00:00 1970 *************** *** 1,804 **** - /* - * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers - * Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved. - * Copyright 1996-1999 by Silicon Graphics. All rights reserved. - * Copyright 1999 by Hewlett-Packard Company. All rights reserved. - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - */ - - /* - * Note that this defines a large number of tuning hooks, which can - * safely be ignored in nearly all cases. For normal use it suffices - * to call only GC_MALLOC and perhaps GC_REALLOC. - * For better performance, also look at GC_MALLOC_ATOMIC, and - * GC_enable_incremental. If you need an action to be performed - * immediately before an object is collected, look at GC_register_finalizer. - * If you are using Solaris threads, look at the end of this file. - * Everything else is best ignored unless you encounter performance - * problems. - */ - - #ifndef _GC_H - - # define _GC_H - # define __GC - # include - - #if defined(__CYGWIN32__) && defined(GC_USE_DLL) - #include "libgc_globals.h" - #endif - - #if defined(__MINGW32__) && defined(WIN32_THREADS) - # ifdef GC_BUILD - # define GC_API __declspec(dllexport) - # else - # define GC_API __declspec(dllimport) - # endif - #endif - - #if defined(_MSC_VER) && defined(_DLL) - # ifdef GC_BUILD - # define GC_API __declspec(dllexport) - # else - # define GC_API __declspec(dllimport) - # endif - #endif - - #if defined(__WATCOMC__) && defined(GC_DLL) - # ifdef GC_BUILD - # define GC_API extern __declspec(dllexport) - # else - # define GC_API extern __declspec(dllimport) - # endif - #endif - - #ifndef GC_API - #define GC_API extern - #endif - - # if defined(__STDC__) || defined(__cplusplus) - # define GC_PROTO(args) args - typedef void * GC_PTR; - # define GC_CONST const - # else - # define GC_PROTO(args) () - typedef char * GC_PTR; - # define GC_CONST - # endif - - # ifdef __cplusplus - extern "C" { - # endif - - - /* Define word and signed_word to be unsigned and signed types of the */ - /* size as char * or void *. There seems to be no way to do this */ - /* even semi-portably. The following is probably no better/worse */ - /* than almost anything else. */ - /* The ANSI standard suggests that size_t and ptr_diff_t might be */ - /* better choices. But those appear to have incorrect definitions */ - /* on may systems. Notably "typedef int size_t" seems to be both */ - /* frequent and WRONG. */ - typedef unsigned long GC_word; - typedef long GC_signed_word; - - /* Public read-only variables */ - - GC_API GC_word GC_gc_no;/* Counter incremented per collection. */ - /* Includes empty GCs at startup. */ - - - /* Public R/W variables */ - - GC_API GC_PTR (*GC_oom_fn) GC_PROTO((size_t bytes_requested)); - /* When there is insufficient memory to satisfy */ - /* an allocation request, we return */ - /* (*GC_oom_fn)(). By default this just */ - /* returns 0. */ - /* If it returns, it must return 0 or a valid */ - /* pointer to a previously allocated heap */ - /* object. */ - - GC_API int GC_find_leak; - /* Do not actually garbage collect, but simply */ - /* report inaccessible memory that was not */ - /* deallocated with GC_free. Initial value */ - /* is determined by FIND_LEAK macro. */ - - GC_API int GC_quiet; /* Disable statistics output. Only matters if */ - /* collector has been compiled with statistics */ - /* enabled. This involves a performance cost, */ - /* and is thus not the default. */ - - GC_API int GC_finalize_on_demand; - /* If nonzero, finalizers will only be run in */ - /* response to an eplit GC_invoke_finalizers */ - /* call. The default is determined by whether */ - /* the FINALIZE_ON_DEMAND macro is defined */ - /* when the collector is built. */ - - GC_API int GC_java_finalization; - /* Mark objects reachable from finalizable */ - /* objects in a separate postpass. This makes */ - /* it a bit safer to use non-topologically- */ - /* ordered finalization. Default value is */ - /* determined by JAVA_FINALIZATION macro. */ - - GC_API int GC_dont_gc; /* Dont collect unless explicitly requested, e.g. */ - /* because it's not safe. */ - - GC_API int GC_dont_expand; - /* Dont expand heap unless explicitly requested */ - /* or forced to. */ - - GC_API int GC_use_entire_heap; - /* Causes the nonincremental collector to use the */ - /* entire heap before collecting. This was the only */ - /* option for GC versions < 5.0. This sometimes */ - /* results in more large block fragmentation, since */ - /* very larg blocks will tend to get broken up */ - /* during each GC cycle. It is likely to result in a */ - /* larger working set, but lower collection */ - /* frequencies, and hence fewer instructions executed */ - /* in the collector. */ - - GC_API int GC_full_freq; /* Number of partial collections between */ - /* full collections. Matters only if */ - /* GC_incremental is set. */ - /* Full collections are also triggered if */ - /* the collector detects a substantial */ - /* increase in the number of in-use heap */ - /* blocks. Values in the tens are now */ - /* perfectly reasonable, unlike for */ - /* earlier GC versions. */ - - GC_API GC_word GC_non_gc_bytes; - /* Bytes not considered candidates for collection. */ - /* Used only to control scheduling of collections. */ - - GC_API GC_word GC_free_space_divisor; - /* We try to make sure that we allocate at */ - /* least N/GC_free_space_divisor bytes between */ - /* collections, where N is the heap size plus */ - /* a rough estimate of the root set size. */ - /* Initially, GC_free_space_divisor = 4. */ - /* Increasing its value will use less space */ - /* but more collection time. Decreasing it */ - /* will appreciably decrease collection time */ - /* at the expense of space. */ - /* GC_free_space_divisor = 1 will effectively */ - /* disable collections. */ - - GC_API GC_word GC_max_retries; - /* The maximum number of GCs attempted before */ - /* reporting out of memory after heap */ - /* expansion fails. Initially 0. */ - - - GC_API char *GC_stackbottom; /* Cool end of user stack. */ - /* May be set in the client prior to */ - /* calling any GC_ routines. This */ - /* avoids some overhead, and */ - /* potentially some signals that can */ - /* confuse debuggers. Otherwise the */ - /* collector attempts to set it */ - /* automatically. */ - /* For multithreaded code, this is the */ - /* cold end of the stack for the */ - /* primordial thread. */ - - /* Public procedures */ - /* - * general purpose allocation routines, with roughly malloc calling conv. - * The atomic versions promise that no relevant pointers are contained - * in the object. The nonatomic versions guarantee that the new object - * is cleared. GC_malloc_stubborn promises that no changes to the object - * will occur after GC_end_stubborn_change has been called on the - * result of GC_malloc_stubborn. GC_malloc_uncollectable allocates an object - * that is scanned for pointers to collectable objects, but is not itself - * collectable. GC_malloc_uncollectable and GC_free called on the resulting - * object implicitly update GC_non_gc_bytes appropriately. - */ - GC_API GC_PTR GC_malloc GC_PROTO((size_t size_in_bytes)); - GC_API GC_PTR GC_malloc_atomic GC_PROTO((size_t size_in_bytes)); - GC_API GC_PTR GC_malloc_uncollectable GC_PROTO((size_t size_in_bytes)); - GC_API GC_PTR GC_malloc_stubborn GC_PROTO((size_t size_in_bytes)); - - /* The following is only defined if the library has been suitably */ - /* compiled: */ - GC_API GC_PTR GC_malloc_atomic_uncollectable GC_PROTO((size_t size_in_bytes)); - - /* Explicitly deallocate an object. Dangerous if used incorrectly. */ - /* Requires a pointer to the base of an object. */ - /* If the argument is stubborn, it should not be changeable when freed. */ - /* An object should not be enable for finalization when it is */ - /* explicitly deallocated. */ - /* GC_free(0) is a no-op, as required by ANSI C for free. */ - GC_API void GC_free GC_PROTO((GC_PTR object_addr)); - - /* - * Stubborn objects may be changed only if the collector is explicitly informed. - * The collector is implicitly informed of coming change when such - * an object is first allocated. The following routines inform the - * collector that an object will no longer be changed, or that it will - * once again be changed. Only nonNIL pointer stores into the object - * are considered to be changes. The argument to GC_end_stubborn_change - * must be exacly the value returned by GC_malloc_stubborn or passed to - * GC_change_stubborn. (In the second case it may be an interior pointer - * within 512 bytes of the beginning of the objects.) - * There is a performance penalty for allowing more than - * one stubborn object to be changed at once, but it is acceptable to - * do so. The same applies to dropping stubborn objects that are still - * changeable. - */ - GC_API void GC_change_stubborn GC_PROTO((GC_PTR)); - GC_API void GC_end_stubborn_change GC_PROTO((GC_PTR)); - - /* Return a pointer to the base (lowest address) of an object given */ - /* a pointer to a location within the object. */ - /* Return 0 if displaced_pointer doesn't point to within a valid */ - /* object. */ - GC_API GC_PTR GC_base GC_PROTO((GC_PTR displaced_pointer)); - - /* Given a pointer to the base of an object, return its size in bytes. */ - /* The returned size may be slightly larger than what was originally */ - /* requested. */ - GC_API size_t GC_size GC_PROTO((GC_PTR object_addr)); - - /* For compatibility with C library. This is occasionally faster than */ - /* a malloc followed by a bcopy. But if you rely on that, either here */ - /* or with the standard C library, your code is broken. In my */ - /* opinion, it shouldn't have been invented, but now we're stuck. -HB */ - /* The resulting object has the same kind as the original. */ - /* If the argument is stubborn, the result will have changes enabled. */ - /* It is an error to have changes enabled for the original object. */ - /* Follows ANSI comventions for NULL old_object. */ - GC_API GC_PTR GC_realloc - GC_PROTO((GC_PTR old_object, size_t new_size_in_bytes)); - - /* Explicitly increase the heap size. */ - /* Returns 0 on failure, 1 on success. */ - GC_API int GC_expand_hp GC_PROTO((size_t number_of_bytes)); - - /* Limit the heap size to n bytes. Useful when you're debugging, */ - /* especially on systems that don't handle running out of memory well. */ - /* n == 0 ==> unbounded. This is the default. */ - GC_API void GC_set_max_heap_size GC_PROTO((GC_word n)); - - /* Inform the collector that a certain section of statically allocated */ - /* memory contains no pointers to garbage collected memory. Thus it */ - /* need not be scanned. This is sometimes important if the application */ - /* maps large read/write files into the address space, which could be */ - /* mistaken for dynamic library data segments on some systems. */ - GC_API void GC_exclude_static_roots GC_PROTO((GC_PTR start, GC_PTR finish)); - - /* Clear the set of root segments. Wizards only. */ - GC_API void GC_clear_roots GC_PROTO((void)); - - /* Add a root segment. Wizards only. */ - GC_API void GC_add_roots GC_PROTO((char * low_address, - char * high_address_plus_1)); - - /* Add a displacement to the set of those considered valid by the */ - /* collector. GC_register_displacement(n) means that if p was returned */ - /* by GC_malloc, then (char *)p + n will be considered to be a valid */ - /* pointer to n. N must be small and less than the size of p. */ - /* (All pointers to the interior of objects from the stack are */ - /* considered valid in any case. This applies to heap objects and */ - /* static data.) */ - /* Preferably, this should be called before any other GC procedures. */ - /* Calling it later adds to the probability of excess memory */ - /* retention. */ - /* This is a no-op if the collector was compiled with recognition of */ - /* arbitrary interior pointers enabled, which is now the default. */ - GC_API void GC_register_displacement GC_PROTO((GC_word n)); - - /* The following version should be used if any debugging allocation is */ - /* being done. */ - GC_API void GC_debug_register_displacement GC_PROTO((GC_word n)); - - /* Explicitly trigger a full, world-stop collection. */ - GC_API void GC_gcollect GC_PROTO((void)); - - /* Trigger a full world-stopped collection. Abort the collection if */ - /* and when stop_func returns a nonzero value. Stop_func will be */ - /* called frequently, and should be reasonably fast. This works even */ - /* if virtual dirty bits, and hence incremental collection is not */ - /* available for this architecture. Collections can be aborted faster */ - /* than normal pause times for incremental collection. However, */ - /* aborted collections do no useful work; the next collection needs */ - /* to start from the beginning. */ - /* Return 0 if the collection was aborted, 1 if it succeeded. */ - typedef int (* GC_stop_func) GC_PROTO((void)); - GC_API int GC_try_to_collect GC_PROTO((GC_stop_func stop_func)); - - /* Return the number of bytes in the heap. Excludes collector private */ - /* data structures. Includes empty blocks and fragmentation loss. */ - /* Includes some pages that were allocated but never written. */ - GC_API size_t GC_get_heap_size GC_PROTO((void)); - - /* Return a lower bound on the number of free bytes in the heap. */ - GC_API size_t GC_get_free_bytes GC_PROTO((void)); - - /* Return the number of bytes allocated since the last collection. */ - GC_API size_t GC_get_bytes_since_gc GC_PROTO((void)); - - /* Enable incremental/generational collection. */ - /* Not advisable unless dirty bits are */ - /* available or most heap objects are */ - /* pointerfree(atomic) or immutable. */ - /* Don't use in leak finding mode. */ - /* Ignored if GC_dont_gc is true. */ - GC_API void GC_enable_incremental GC_PROTO((void)); - - /* Perform some garbage collection work, if appropriate. */ - /* Return 0 if there is no more work to be done. */ - /* Typically performs an amount of work corresponding roughly */ - /* to marking from one page. May do more work if further */ - /* progress requires it, e.g. if incremental collection is */ - /* disabled. It is reasonable to call this in a wait loop */ - /* until it returns 0. */ - GC_API int GC_collect_a_little GC_PROTO((void)); - - /* Allocate an object of size lb bytes. The client guarantees that */ - /* as long as the object is live, it will be referenced by a pointer */ - /* that points to somewhere within the first 256 bytes of the object. */ - /* (This should normally be declared volatile to prevent the compiler */ - /* from invalidating this assertion.) This routine is only useful */ - /* if a large array is being allocated. It reduces the chance of */ - /* accidentally retaining such an array as a result of scanning an */ - /* integer that happens to be an address inside the array. (Actually, */ - /* it reduces the chance of the allocator not finding space for such */ - /* an array, since it will try hard to avoid introducing such a false */ - /* reference.) On a SunOS 4.X or MS Windows system this is recommended */ - /* for arrays likely to be larger than 100K or so. For other systems, */ - /* or if the collector is not configured to recognize all interior */ - /* pointers, the threshold is normally much higher. */ - GC_API GC_PTR GC_malloc_ignore_off_page GC_PROTO((size_t lb)); - GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb)); - - #if defined(__sgi) && !defined(__GNUC__) && _COMPILER_VERSION >= 720 - # define GC_ADD_CALLER - # define GC_RETURN_ADDR (GC_word)__return_address - #endif - - #ifdef GC_ADD_CALLER - # define GC_EXTRAS GC_RETURN_ADDR, __FILE__, __LINE__ - # define GC_EXTRA_PARAMS GC_word ra, GC_CONST char * s, int i - #else - # define GC_EXTRAS __FILE__, __LINE__ - # define GC_EXTRA_PARAMS GC_CONST char * s, int i - #endif - - /* Debugging (annotated) allocation. GC_gcollect will check */ - /* objects allocated in this way for overwrites, etc. */ - GC_API GC_PTR GC_debug_malloc - GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS)); - GC_API GC_PTR GC_debug_malloc_atomic - GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS)); - GC_API GC_PTR GC_debug_malloc_uncollectable - GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS)); - GC_API GC_PTR GC_debug_malloc_stubborn - GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS)); - GC_API void GC_debug_free GC_PROTO((GC_PTR object_addr)); - GC_API GC_PTR GC_debug_realloc - GC_PROTO((GC_PTR old_object, size_t new_size_in_bytes, - GC_EXTRA_PARAMS)); - - GC_API void GC_debug_change_stubborn GC_PROTO((GC_PTR)); - GC_API void GC_debug_end_stubborn_change GC_PROTO((GC_PTR)); - # ifdef GC_DEBUG - # define GC_MALLOC(sz) GC_debug_malloc(sz, GC_EXTRAS) - # define GC_MALLOC_ATOMIC(sz) GC_debug_malloc_atomic(sz, GC_EXTRAS) - # define GC_MALLOC_UNCOLLECTABLE(sz) GC_debug_malloc_uncollectable(sz, \ - GC_EXTRAS) - # define GC_REALLOC(old, sz) GC_debug_realloc(old, sz, GC_EXTRAS) - # define GC_FREE(p) GC_debug_free(p) - # define GC_REGISTER_FINALIZER(p, f, d, of, od) \ - GC_debug_register_finalizer(p, f, d, of, od) - # define GC_REGISTER_FINALIZER_IGNORE_SELF(p, f, d, of, od) \ - GC_debug_register_finalizer_ignore_self(p, f, d, of, od) - # define GC_REGISTER_FINALIZER_NO_ORDER(p, f, d, of, od) \ - GC_debug_register_finalizer_no_order(p, f, d, of, od) - # define GC_MALLOC_STUBBORN(sz) GC_debug_malloc_stubborn(sz, GC_EXTRAS); - # define GC_CHANGE_STUBBORN(p) GC_debug_change_stubborn(p) - # define GC_END_STUBBORN_CHANGE(p) GC_debug_end_stubborn_change(p) - # define GC_GENERAL_REGISTER_DISAPPEARING_LINK(link, obj) \ - GC_general_register_disappearing_link(link, GC_base(obj)) - # define GC_REGISTER_DISPLACEMENT(n) GC_debug_register_displacement(n) - # else - # define GC_MALLOC(sz) GC_malloc(sz) - # define GC_MALLOC_ATOMIC(sz) GC_malloc_atomic(sz) - # define GC_MALLOC_UNCOLLECTABLE(sz) GC_malloc_uncollectable(sz) - # define GC_REALLOC(old, sz) GC_realloc(old, sz) - # define GC_FREE(p) GC_free(p) - # define GC_REGISTER_FINALIZER(p, f, d, of, od) \ - GC_register_finalizer(p, f, d, of, od) - # define GC_REGISTER_FINALIZER_IGNORE_SELF(p, f, d, of, od) \ - GC_register_finalizer_ignore_self(p, f, d, of, od) - # define GC_REGISTER_FINALIZER_NO_ORDER(p, f, d, of, od) \ - GC_register_finalizer_no_order(p, f, d, of, od) - # define GC_MALLOC_STUBBORN(sz) GC_malloc_stubborn(sz) - # define GC_CHANGE_STUBBORN(p) GC_change_stubborn(p) - # define GC_END_STUBBORN_CHANGE(p) GC_end_stubborn_change(p) - # define GC_GENERAL_REGISTER_DISAPPEARING_LINK(link, obj) \ - GC_general_register_disappearing_link(link, obj) - # define GC_REGISTER_DISPLACEMENT(n) GC_register_displacement(n) - # endif - /* The following are included because they are often convenient, and */ - /* reduce the chance for a misspecifed size argument. But calls may */ - /* expand to something syntactically incorrect if t is a complicated */ - /* type expression. */ - # define GC_NEW(t) (t *)GC_MALLOC(sizeof (t)) - # define GC_NEW_ATOMIC(t) (t *)GC_MALLOC_ATOMIC(sizeof (t)) - # define GC_NEW_STUBBORN(t) (t *)GC_MALLOC_STUBBORN(sizeof (t)) - # define GC_NEW_UNCOLLECTABLE(t) (t *)GC_MALLOC_UNCOLLECTABLE(sizeof (t)) - - /* Finalization. Some of these primitives are grossly unsafe. */ - /* The idea is to make them both cheap, and sufficient to build */ - /* a safer layer, closer to PCedar finalization. */ - /* The interface represents my conclusions from a long discussion */ - /* with Alan Demers, Dan Greene, Carl Hauser, Barry Hayes, */ - /* Christian Jacobi, and Russ Atkinson. It's not perfect, and */ - /* probably nobody else agrees with it. Hans-J. Boehm 3/13/92 */ - typedef void (*GC_finalization_proc) - GC_PROTO((GC_PTR obj, GC_PTR client_data)); - - GC_API void GC_register_finalizer - GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, - GC_finalization_proc *ofn, GC_PTR *ocd)); - GC_API void GC_debug_register_finalizer - GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, - GC_finalization_proc *ofn, GC_PTR *ocd)); - /* When obj is no longer accessible, invoke */ - /* (*fn)(obj, cd). If a and b are inaccessible, and */ - /* a points to b (after disappearing links have been */ - /* made to disappear), then only a will be */ - /* finalized. (If this does not create any new */ - /* pointers to b, then b will be finalized after the */ - /* next collection.) Any finalizable object that */ - /* is reachable from itself by following one or more */ - /* pointers will not be finalized (or collected). */ - /* Thus cycles involving finalizable objects should */ - /* be avoided, or broken by disappearing links. */ - /* All but the last finalizer registered for an object */ - /* is ignored. */ - /* Finalization may be removed by passing 0 as fn. */ - /* Finalizers are implicitly unregistered just before */ - /* they are invoked. */ - /* The old finalizer and client data are stored in */ - /* *ofn and *ocd. */ - /* Fn is never invoked on an accessible object, */ - /* provided hidden pointers are converted to real */ - /* pointers only if the allocation lock is held, and */ - /* such conversions are not performed by finalization */ - /* routines. */ - /* If GC_register_finalizer is aborted as a result of */ - /* a signal, the object may be left with no */ - /* finalization, even if neither the old nor new */ - /* finalizer were NULL. */ - /* Obj should be the nonNULL starting address of an */ - /* object allocated by GC_malloc or friends. */ - /* Note that any garbage collectable object referenced */ - /* by cd will be considered accessible until the */ - /* finalizer is invoked. */ - - /* Another versions of the above follow. It ignores */ - /* self-cycles, i.e. pointers from a finalizable object to */ - /* itself. There is a stylistic argument that this is wrong, */ - /* but it's unavoidable for C++, since the compiler may */ - /* silently introduce these. It's also benign in that specific */ - /* case. */ - GC_API void GC_register_finalizer_ignore_self - GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, - GC_finalization_proc *ofn, GC_PTR *ocd)); - GC_API void GC_debug_register_finalizer_ignore_self - GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, - GC_finalization_proc *ofn, GC_PTR *ocd)); - - /* Another version of the above. It ignores all cycles. */ - /* It should probably only be used by Java implementations. */ - GC_API void GC_register_finalizer_no_order - GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, - GC_finalization_proc *ofn, GC_PTR *ocd)); - GC_API void GC_debug_register_finalizer_no_order - GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, - GC_finalization_proc *ofn, GC_PTR *ocd)); - - - /* The following routine may be used to break cycles between */ - /* finalizable objects, thus causing cyclic finalizable */ - /* objects to be finalized in the correct order. Standard */ - /* use involves calling GC_register_disappearing_link(&p), */ - /* where p is a pointer that is not followed by finalization */ - /* code, and should not be considered in determining */ - /* finalization order. */ - GC_API int GC_register_disappearing_link GC_PROTO((GC_PTR * /* link */)); - /* Link should point to a field of a heap allocated */ - /* object obj. *link will be cleared when obj is */ - /* found to be inaccessible. This happens BEFORE any */ - /* finalization code is invoked, and BEFORE any */ - /* decisions about finalization order are made. */ - /* This is useful in telling the finalizer that */ - /* some pointers are not essential for proper */ - /* finalization. This may avoid finalization cycles. */ - /* Note that obj may be resurrected by another */ - /* finalizer, and thus the clearing of *link may */ - /* be visible to non-finalization code. */ - /* There's an argument that an arbitrary action should */ - /* be allowed here, instead of just clearing a pointer. */ - /* But this causes problems if that action alters, or */ - /* examines connectivity. */ - /* Returns 1 if link was already registered, 0 */ - /* otherwise. */ - /* Only exists for backward compatibility. See below: */ - - GC_API int GC_general_register_disappearing_link - GC_PROTO((GC_PTR * /* link */, GC_PTR obj)); - /* A slight generalization of the above. *link is */ - /* cleared when obj first becomes inaccessible. This */ - /* can be used to implement weak pointers easily and */ - /* safely. Typically link will point to a location */ - /* holding a disguised pointer to obj. (A pointer */ - /* inside an "atomic" object is effectively */ - /* disguised.) In this way soft */ - /* pointers are broken before any object */ - /* reachable from them are finalized. Each link */ - /* May be registered only once, i.e. with one obj */ - /* value. This was added after a long email discussion */ - /* with John Ellis. */ - /* Obj must be a pointer to the first word of an object */ - /* we allocated. It is unsafe to explicitly deallocate */ - /* the object containing link. Explicitly deallocating */ - /* obj may or may not cause link to eventually be */ - /* cleared. */ - GC_API int GC_unregister_disappearing_link GC_PROTO((GC_PTR * /* link */)); - /* Returns 0 if link was not actually registered. */ - /* Undoes a registration by either of the above two */ - /* routines. */ - - /* Auxiliary fns to make finalization work correctly with displaced */ - /* pointers introduced by the debugging allocators. */ - GC_API GC_PTR GC_make_closure GC_PROTO((GC_finalization_proc fn, GC_PTR data)); - GC_API void GC_debug_invoke_finalizer GC_PROTO((GC_PTR obj, GC_PTR data)); - - /* Returns !=0 if GC_invoke_finalizers has something to do. */ - GC_API int GC_should_invoke_finalizers GC_PROTO((void)); - - GC_API int GC_invoke_finalizers GC_PROTO((void)); - /* Run finalizers for all objects that are ready to */ - /* be finalized. Return the number of finalizers */ - /* that were run. Normally this is also called */ - /* implicitly during some allocations. If */ - /* GC-finalize_on_demand is nonzero, it must be called */ - /* explicitly. */ - - /* GC_set_warn_proc can be used to redirect or filter warning messages. */ - /* p may not be a NULL pointer. */ - typedef void (*GC_warn_proc) GC_PROTO((char *msg, GC_word arg)); - GC_API GC_warn_proc GC_set_warn_proc GC_PROTO((GC_warn_proc p)); - /* Returns old warning procedure. */ - - /* The following is intended to be used by a higher level */ - /* (e.g. cedar-like) finalization facility. It is expected */ - /* that finalization code will arrange for hidden pointers to */ - /* disappear. Otherwise objects can be accessed after they */ - /* have been collected. */ - /* Note that putting pointers in atomic objects or in */ - /* nonpointer slots of "typed" objects is equivalent to */ - /* disguising them in this way, and may have other advantages. */ - # if defined(I_HIDE_POINTERS) || defined(GC_I_HIDE_POINTERS) - typedef GC_word GC_hidden_pointer; - # define HIDE_POINTER(p) (~(GC_hidden_pointer)(p)) - # define REVEAL_POINTER(p) ((GC_PTR)(HIDE_POINTER(p))) - /* Converting a hidden pointer to a real pointer requires verifying */ - /* that the object still exists. This involves acquiring the */ - /* allocator lock to avoid a race with the collector. */ - # endif /* I_HIDE_POINTERS */ - - typedef GC_PTR (*GC_fn_type) GC_PROTO((GC_PTR client_data)); - GC_API GC_PTR GC_call_with_alloc_lock - GC_PROTO((GC_fn_type fn, GC_PTR client_data)); - - /* Check that p and q point to the same object. */ - /* Fail conspicuously if they don't. */ - /* Returns the first argument. */ - /* Succeeds if neither p nor q points to the heap. */ - /* May succeed if both p and q point to between heap objects. */ - GC_API GC_PTR GC_same_obj GC_PROTO((GC_PTR p, GC_PTR q)); - - /* Checked pointer pre- and post- increment operations. Note that */ - /* the second argument is in units of bytes, not multiples of the */ - /* object size. This should either be invoked from a macro, or the */ - /* call should be automatically generated. */ - GC_API GC_PTR GC_pre_incr GC_PROTO((GC_PTR *p, size_t how_much)); - GC_API GC_PTR GC_post_incr GC_PROTO((GC_PTR *p, size_t how_much)); - - /* Check that p is visible */ - /* to the collector as a possibly pointer containing location. */ - /* If it isn't fail conspicuously. */ - /* Returns the argument in all cases. May erroneously succeed */ - /* in hard cases. (This is intended for debugging use with */ - /* untyped allocations. The idea is that it should be possible, though */ - /* slow, to add such a call to all indirect pointer stores.) */ - /* Currently useless for multithreaded worlds. */ - GC_API GC_PTR GC_is_visible GC_PROTO((GC_PTR p)); - - /* Check that if p is a pointer to a heap page, then it points to */ - /* a valid displacement within a heap object. */ - /* Fail conspicuously if this property does not hold. */ - /* Uninteresting with ALL_INTERIOR_POINTERS. */ - /* Always returns its argument. */ - GC_API GC_PTR GC_is_valid_displacement GC_PROTO((GC_PTR p)); - - /* Safer, but slow, pointer addition. Probably useful mainly with */ - /* a preprocessor. Useful only for heap pointers. */ - #ifdef GC_DEBUG - # define GC_PTR_ADD3(x, n, type_of_result) \ - ((type_of_result)GC_same_obj((x)+(n), (x))) - # define GC_PRE_INCR3(x, n, type_of_result) \ - ((type_of_result)GC_pre_incr(&(x), (n)*sizeof(*x)) - # define GC_POST_INCR2(x, type_of_result) \ - ((type_of_result)GC_post_incr(&(x), sizeof(*x)) - # ifdef __GNUC__ - # define GC_PTR_ADD(x, n) \ - GC_PTR_ADD3(x, n, typeof(x)) - # define GC_PRE_INCR(x, n) \ - GC_PRE_INCR3(x, n, typeof(x)) - # define GC_POST_INCR(x, n) \ - GC_POST_INCR3(x, typeof(x)) - # else - /* We can't do this right without typeof, which ANSI */ - /* decided was not sufficiently useful. Repeatedly */ - /* mentioning the arguments seems too dangerous to be */ - /* useful. So does not casting the result. */ - # define GC_PTR_ADD(x, n) ((x)+(n)) - # endif - #else /* !GC_DEBUG */ - # define GC_PTR_ADD3(x, n, type_of_result) ((x)+(n)) - # define GC_PTR_ADD(x, n) ((x)+(n)) - # define GC_PRE_INCR3(x, n, type_of_result) ((x) += (n)) - # define GC_PRE_INCR(x, n) ((x) += (n)) - # define GC_POST_INCR2(x, n, type_of_result) ((x)++) - # define GC_POST_INCR(x, n) ((x)++) - #endif - - /* Safer assignment of a pointer to a nonstack location. */ - #ifdef GC_DEBUG - # ifdef __STDC__ - # define GC_PTR_STORE(p, q) \ - (*(void **)GC_is_visible(p) = GC_is_valid_displacement(q)) - # else - # define GC_PTR_STORE(p, q) \ - (*(char **)GC_is_visible(p) = GC_is_valid_displacement(q)) - # endif - #else /* !GC_DEBUG */ - # define GC_PTR_STORE(p, q) *((p) = (q)) - #endif - - /* Fynctions called to report pointer checking errors */ - GC_API void (*GC_same_obj_print_proc) GC_PROTO((GC_PTR p, GC_PTR q)); - - GC_API void (*GC_is_valid_displacement_print_proc) - GC_PROTO((GC_PTR p)); - - GC_API void (*GC_is_visible_print_proc) - GC_PROTO((GC_PTR p)); - - #if defined(_SOLARIS_PTHREADS) && !defined(SOLARIS_THREADS) - # define SOLARIS_THREADS - #endif - - #ifdef SOLARIS_THREADS - /* We need to intercept calls to many of the threads primitives, so */ - /* that we can locate thread stacks and stop the world. */ - /* Note also that the collector cannot see thread specific data. */ - /* Thread specific data should generally consist of pointers to */ - /* uncollectable objects, which are deallocated using the destructor */ - /* facility in thr_keycreate. */ - # include - # include - int GC_thr_create(void *stack_base, size_t stack_size, - void *(*start_routine)(void *), void *arg, long flags, - thread_t *new_thread); - int GC_thr_join(thread_t wait_for, thread_t *departed, void **status); - int GC_thr_suspend(thread_t target_thread); - int GC_thr_continue(thread_t target_thread); - void * GC_dlopen(const char *path, int mode); - - # ifdef _SOLARIS_PTHREADS - # include - extern int GC_pthread_create(pthread_t *new_thread, - const pthread_attr_t *attr, - void * (*thread_execp)(void *), void *arg); - extern int GC_pthread_join(pthread_t wait_for, void **status); - - # undef thread_t - - # define pthread_join GC_pthread_join - # define pthread_create GC_pthread_create - #endif - - # define thr_create GC_thr_create - # define thr_join GC_thr_join - # define thr_suspend GC_thr_suspend - # define thr_continue GC_thr_continue - # define dlopen GC_dlopen - - # endif /* SOLARIS_THREADS */ - - - #if !defined(USE_LD_WRAP) && \ - (defined(IRIX_THREADS) || defined(LINUX_THREADS) || defined(HPUX_THREADS)) - /* We treat these similarly. */ - # include - # include - - int GC_pthread_create(pthread_t *new_thread, - const pthread_attr_t *attr, - void *(*start_routine)(void *), void *arg); - int GC_pthread_sigmask(int how, const sigset_t *set, sigset_t *oset); - int GC_pthread_join(pthread_t thread, void **retval); - - # define pthread_create GC_pthread_create - # define pthread_sigmask GC_pthread_sigmask - # define pthread_join GC_pthread_join - # define dlopen GC_dlopen - - #endif /* xxxxx_THREADS */ - - # if defined(PCR) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || \ - defined(IRIX_THREADS) || defined(LINUX_THREADS) || \ - defined(IRIX_JDK_THREADS) || defined(HPUX_THREADS) - /* Any flavor of threads except SRC_M3. */ - /* This returns a list of objects, linked through their first */ - /* word. Its use can greatly reduce lock contention problems, since */ - /* the allocation lock can be acquired and released many fewer times. */ - /* lb must be large enough to hold the pointer field. */ - GC_PTR GC_malloc_many(size_t lb); - #define GC_NEXT(p) (*(GC_PTR *)(p)) /* Retrieve the next element */ - /* in returned list. */ - extern void GC_thr_init(); /* Needed for Solaris/X86 */ - - #endif /* THREADS && !SRC_M3 */ - - /* - * If you are planning on putting - * the collector in a SunOS 5 dynamic library, you need to call GC_INIT() - * from the statically loaded program section. - * This circumvents a Solaris 2.X (X<=4) linker bug. - */ - #if defined(sparc) || defined(__sparc) - # define GC_INIT() { extern end, etext; \ - GC_noop(&end, &etext); } - #else - # if defined(__CYGWIN32__) && defined(GC_USE_DLL) - /* - * Similarly gnu-win32 DLLs need explicit initialization - */ - # define GC_INIT() { GC_add_roots(DATASTART, DATAEND); } - # else - # define GC_INIT() - # endif - #endif - - #if (defined(_MSDOS) || defined(_MSC_VER)) && (_M_IX86 >= 300) \ - || defined(_WIN32) - /* win32S may not free all resources on process exit. */ - /* This explicitly deallocates the heap. */ - GC_API void GC_win32_free_heap (); - #endif - - #ifdef __cplusplus - } /* end of extern "C" */ - #endif - - #endif /* _GC_H */ --- 0 ---- diff -Nrc3pad gcc-3.0.4/boehm-gc/gc.mak gcc-3.1/boehm-gc/gc.mak *** gcc-3.0.4/boehm-gc/gc.mak Mon Nov 1 23:15:51 1999 --- gcc-3.1/boehm-gc/gc.mak Tue Oct 16 09:01:35 2001 *************** *** 1,5 **** # Microsoft Developer Studio Generated NMAKE File, Format Version 4.10 ! # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 --- 1,6 ---- # Microsoft Developer Studio Generated NMAKE File, Format Version 4.10 ! # This has been hand-edited way too many times. ! # A clean, manually generated makefile would be an improvement. # TARGTYPE "Win32 (x86) Application" 0x0101 # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 *************** CLEAN : *** 72,77 **** --- 73,80 ---- -@erase ".\Release\finalize.obj" -@erase ".\Release\finalize.sbr" -@erase ".\Release\gc.bsc" + -@erase ".\Release\gc_cpp.obj" + -@erase ".\Release\gc_cpp.sbr" -@erase ".\Release\gc.dll" -@erase ".\Release\gc.exp" -@erase ".\Release\gc.lib" *************** CLEAN : *** 111,120 **** CPP=cl.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "SILENT" /D "GC_BUILD" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "WIN32_THREADS" /FR /YX /c ! CPP_PROJ=/nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "SILENT" /D "GC_BUILD" /D\ "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D\ ! "WIN32_THREADS" /FR"$(INTDIR)/" /Fp"$(INTDIR)/gc.pch" /YX /Fo"$(INTDIR)/" /c CPP_OBJS=.\Release/ CPP_SBRS=.\Release/ --- 114,123 ---- CPP=cl.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I include /D "NDEBUG" /D "SILENT" /D "GC_BUILD" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "GC_WIN32_THREADS" /FR /YX /c ! CPP_PROJ=/nologo /MD /W3 /GX /O2 /I include /D "NDEBUG" /D "SILENT" /D "GC_BUILD" /D\ "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D\ ! "GC_WIN32_THREADS" /FR"$(INTDIR)/" /Fp"$(INTDIR)/gc.pch" /YX /Fo"$(INTDIR)/" /c CPP_OBJS=.\Release/ CPP_SBRS=.\Release/ *************** BSC32_SBRS= \ *** 155,160 **** --- 158,164 ---- ".\Release\dbg_mlc.sbr" \ ".\Release\dyn_load.sbr" \ ".\Release\finalize.sbr" \ + ".\Release\gc_cpp.sbr" \ ".\Release\headers.sbr" \ ".\Release\mach_dep.sbr" \ ".\Release\malloc.sbr" \ *************** LINK32_OBJS= \ *** 192,197 **** --- 196,202 ---- ".\Release\dbg_mlc.obj" \ ".\Release\dyn_load.obj" \ ".\Release\finalize.obj" \ + ".\Release\gc_cpp.obj" \ ".\Release\headers.obj" \ ".\Release\mach_dep.obj" \ ".\Release\malloc.obj" \ *************** CLEAN : *** 245,250 **** --- 250,257 ---- -@erase ".\Debug\dyn_load.sbr" -@erase ".\Debug\finalize.obj" -@erase ".\Debug\finalize.sbr" + -@erase ".\Debug\gc_cpp.obj" + -@erase ".\Debug\gc_cpp.sbr" -@erase ".\Debug\gc.bsc" -@erase ".\Debug\gc.dll" -@erase ".\Debug\gc.exp" *************** CLEAN : *** 289,298 **** CPP=cl.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "SILENT" /D "GC_BUILD" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "WIN32_THREADS" /FR /YX /c ! CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "SILENT" /D "GC_BUILD"\ /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D\ ! "WIN32_THREADS" /FR"$(INTDIR)/" /Fp"$(INTDIR)/gc.pch" /YX /Fo"$(INTDIR)/"\ /Fd"$(INTDIR)/" /c CPP_OBJS=.\Debug/ CPP_SBRS=.\Debug/ --- 296,305 ---- CPP=cl.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I include /D "_DEBUG" /D "SILENT" /D "GC_BUILD" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "GC_WIN32_THREADS" /FR /YX /c ! CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I include /D "_DEBUG" /D "SILENT" /D "GC_BUILD"\ /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D\ ! "GC_WIN32_THREADS" /FR"$(INTDIR)/" /Fp"$(INTDIR)/gc.pch" /YX /Fo"$(INTDIR)/"\ /Fd"$(INTDIR)/" /c CPP_OBJS=.\Debug/ CPP_SBRS=.\Debug/ *************** BSC32_SBRS= \ *** 334,339 **** --- 341,347 ---- ".\Debug\dbg_mlc.sbr" \ ".\Debug\dyn_load.sbr" \ ".\Debug\finalize.sbr" \ + ".\Debug\gc_cpp.sbr" \ ".\Debug\headers.sbr" \ ".\Debug\mach_dep.sbr" \ ".\Debug\malloc.sbr" \ *************** LINK32_OBJS= \ *** 371,376 **** --- 379,385 ---- ".\Debug\dbg_mlc.obj" \ ".\Debug\dyn_load.obj" \ ".\Debug\finalize.obj" \ + ".\Debug\gc_cpp.obj" \ ".\Debug\headers.obj" \ ".\Debug\mach_dep.obj" \ ".\Debug\malloc.obj" \ *************** CLEAN : *** 416,426 **** "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "WIN32_THREADS" /YX /c ! CPP_PROJ=/nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D\ ! "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "WIN32_THREADS"\ /Fp"$(INTDIR)/gctest.pch" /YX /Fo"$(INTDIR)/" /c CPP_OBJS=.\gctest\Release/ CPP_SBRS=.\. --- 425,438 ---- "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + test.c : tests\test.c + copy tests\test.c test.c + CPP=cl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I include /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "GC_WIN32_THREADS" /YX /c ! CPP_PROJ=/nologo /MD /W3 /GX /O2 /I include /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D\ ! "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "GC_WIN32_THREADS"\ /Fp"$(INTDIR)/gctest.pch" /YX /Fo"$(INTDIR)/" /c CPP_OBJS=.\gctest\Release/ CPP_SBRS=.\. *************** CLEAN : *** 504,512 **** CPP=cl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "WIN32_THREADS" /FR /YX /c ! CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS"\ ! /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "WIN32_THREADS" /FR"$(INTDIR)/"\ /Fp"$(INTDIR)/gctest.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c CPP_OBJS=.\gctest\Debug/ CPP_SBRS=.\gctest\Debug/ --- 516,524 ---- CPP=cl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "GC_WIN32_THREADS" /FR /YX /c ! CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I include /D "_DEBUG" /D "WIN32" /D "_WINDOWS"\ ! /D "ALL_INTERIOR_POINTERS" /D "__STDC__" /D "GC_WIN32_THREADS" /FR"$(INTDIR)/"\ /Fp"$(INTDIR)/gctest.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c CPP_OBJS=.\gctest\Debug/ CPP_SBRS=.\gctest\Debug/ *************** CLEAN : *** 596,602 **** CPP=cl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /YX /c ! CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D\ "ALL_INTERIOR_POINTERS" /Fp"$(INTDIR)/cord.pch" /YX /Fo"$(INTDIR)/" /c CPP_OBJS=.\cord\Release/ CPP_SBRS=.\. --- 608,614 ---- CPP=cl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /YX /c ! CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "." /I include /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D\ "ALL_INTERIOR_POINTERS" /Fp"$(INTDIR)/cord.pch" /YX /Fo"$(INTDIR)/" /c CPP_OBJS=.\cord\Release/ CPP_SBRS=.\. *************** CLEAN : *** 688,694 **** CPP=cl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /YX /c ! CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /D "_DEBUG" /D "WIN32" /D\ "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /Fp"$(INTDIR)/cord.pch" /YX\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c CPP_OBJS=.\cord\Debug/ --- 700,706 ---- CPP=cl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /YX /c ! CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I include /D "_DEBUG" /D "WIN32" /D\ "_WINDOWS" /D "ALL_INTERIOR_POINTERS" /Fp"$(INTDIR)/cord.pch" /YX\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c CPP_OBJS=.\cord\Debug/ *************** LINK32_OBJS= \ *** 763,777 **** ################################################################################ # Begin Source File SOURCE=.\reclaim.c !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_RECLA=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_RECLA=\ --- 775,839 ---- ################################################################################ # Begin Source File + SOURCE=.\gc_cpp.cpp + + !IF "$(CFG)" == "gc - Win32 Release" + + DEP_CPP_RECLA=\ + ".\include\private\gcconfig.h"\ + ".\include\gc.h"\ + ".\include\private\gc_hdrs.h"\ + ".\include\private\gc_priv.h"\ + ".\include\gc_cpp.h"\ + {$(INCLUDE)}"\sys\TYPES.H"\ + + NODEP_CPP_RECLA=\ + ".\th\PCR_Th.h"\ + ".\th\PCR_ThCrSec.h"\ + ".\th\PCR_ThCtl.h"\ + + + ".\Release\gc_cpp.obj" : $(SOURCE) $(DEP_CPP_RECLA) "$(INTDIR)" + + ".\Release\gc_cpp.sbr" : $(SOURCE) $(DEP_CPP_RECLA) "$(INTDIR)" + + + !ELSEIF "$(CFG)" == "gc - Win32 Debug" + + DEP_CPP_RECLA=\ + ".\include\private\gcconfig.h"\ + ".\include\gc.h"\ + ".\include\private\gc_hdrs.h"\ + ".\include\private\gc_priv.h"\ + ".\include\gc_cpp.h"\ + {$(INCLUDE)}"\sys\TYPES.H"\ + + NODEP_CPP_RECLA=\ + ".\th\PCR_Th.h"\ + ".\th\PCR_ThCrSec.h"\ + ".\th\PCR_ThCtl.h"\ + + + ".\Debug\gc_cpp.obj" : $(SOURCE) $(DEP_CPP_RECLA) "$(INTDIR)" + + ".\Debug\gc_cpp.sbr" : $(SOURCE) $(DEP_CPP_RECLA) "$(INTDIR)" + + + !ENDIF + + # End Source File + ################################################################################ + # Begin Source File + SOURCE=.\reclaim.c !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_RECLA=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_RECLA=\ *************** NODEP_CPP_RECLA=\ *** 788,797 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_RECLA=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_RECLA=\ --- 850,859 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_RECLA=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_RECLA=\ *************** NODEP_CPP_RECLA=\ *** 808,813 **** --- 870,876 ---- !ENDIF # End Source File + ################################################################################ # Begin Source File *************** SOURCE=.\os_dep.c *** 816,825 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_OS_DE=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ --- 879,888 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_OS_DE=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ *************** NODEP_CPP_OS_DE=\ *** 840,849 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_OS_DE=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ --- 903,912 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_OS_DE=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ *************** SOURCE=.\misc.c *** 872,881 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MISC_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MISC_=\ --- 935,944 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MISC_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MISC_=\ *************** NODEP_CPP_MISC_=\ *** 893,902 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MISC_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MISC_=\ --- 956,965 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MISC_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MISC_=\ *************** SOURCE=.\mark_rts.c *** 922,931 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MARK_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_=\ --- 985,994 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MARK_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_=\ *************** NODEP_CPP_MARK_=\ *** 942,951 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MARK_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_=\ --- 1005,1014 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MARK_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_=\ *************** SOURCE=.\mach_dep.c *** 970,979 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MACH_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MACH_=\ --- 1033,1042 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MACH_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MACH_=\ *************** NODEP_CPP_MACH_=\ *** 990,999 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MACH_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MACH_=\ --- 1053,1062 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MACH_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MACH_=\ *************** SOURCE=.\headers.c *** 1018,1027 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_HEADE=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_HEADE=\ --- 1081,1090 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_HEADE=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_HEADE=\ *************** NODEP_CPP_HEADE=\ *** 1038,1047 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_HEADE=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_HEADE=\ --- 1101,1110 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_HEADE=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_HEADE=\ *************** SOURCE=.\alloc.c *** 1066,1075 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_ALLOC=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLOC=\ --- 1129,1138 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_ALLOC=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLOC=\ *************** NODEP_CPP_ALLOC=\ *** 1086,1095 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_ALLOC=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLOC=\ --- 1149,1158 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_ALLOC=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLOC=\ *************** SOURCE=.\allchblk.c *** 1114,1123 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_ALLCH=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLCH=\ --- 1177,1186 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_ALLCH=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLCH=\ *************** NODEP_CPP_ALLCH=\ *** 1134,1143 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_ALLCH=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLCH=\ --- 1197,1206 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_ALLCH=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_ALLCH=\ *************** SOURCE=.\stubborn.c *** 1162,1171 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_STUBB=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_STUBB=\ --- 1225,1234 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_STUBB=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_STUBB=\ *************** NODEP_CPP_STUBB=\ *** 1182,1191 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_STUBB=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_STUBB=\ --- 1245,1254 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_STUBB=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_STUBB=\ *************** SOURCE=.\obj_map.c *** 1210,1219 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_OBJ_M=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_OBJ_M=\ --- 1273,1282 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_OBJ_M=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_OBJ_M=\ *************** NODEP_CPP_OBJ_M=\ *** 1230,1239 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_OBJ_M=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_OBJ_M=\ --- 1293,1302 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_OBJ_M=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_OBJ_M=\ *************** SOURCE=.\new_hblk.c *** 1258,1267 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_NEW_H=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_NEW_H=\ --- 1321,1330 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_NEW_H=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_NEW_H=\ *************** NODEP_CPP_NEW_H=\ *** 1278,1287 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_NEW_H=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_NEW_H=\ --- 1341,1350 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_NEW_H=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_NEW_H=\ *************** SOURCE=.\mark.c *** 1306,1316 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MARK_C=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_C=\ --- 1369,1380 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MARK_C=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_C=\ *************** NODEP_CPP_MARK_C=\ *** 1327,1337 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MARK_C=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_C=\ --- 1391,1402 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MARK_C=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MARK_C=\ *************** SOURCE=.\malloc.c *** 1356,1365 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MALLO=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLO=\ --- 1421,1430 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MALLO=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLO=\ *************** NODEP_CPP_MALLO=\ *** 1376,1385 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MALLO=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLO=\ --- 1441,1450 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MALLO=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLO=\ *************** SOURCE=.\mallocx.c *** 1404,1413 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MALLX=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLX=\ --- 1469,1478 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_MALLX=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLX=\ *************** NODEP_CPP_MALLX=\ *** 1424,1433 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MALLX=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLX=\ --- 1489,1498 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_MALLX=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_MALLX=\ *************** SOURCE=.\finalize.c *** 1452,1462 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_FINAL=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_FINAL=\ --- 1517,1528 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_FINAL=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_FINAL=\ *************** NODEP_CPP_FINAL=\ *** 1473,1483 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_FINAL=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_FINAL=\ --- 1539,1550 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_FINAL=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_FINAL=\ *************** SOURCE=.\dbg_mlc.c *** 1502,1511 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_DBG_M=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_DBG_M=\ --- 1569,1578 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_DBG_M=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_DBG_M=\ *************** NODEP_CPP_DBG_M=\ *** 1522,1531 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_DBG_M=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_DBG_M=\ --- 1589,1598 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_DBG_M=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_DBG_M=\ *************** SOURCE=.\blacklst.c *** 1550,1559 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_BLACK=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_BLACK=\ --- 1617,1626 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_BLACK=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_BLACK=\ *************** NODEP_CPP_BLACK=\ *** 1570,1579 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_BLACK=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_BLACK=\ --- 1637,1646 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_BLACK=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_BLACK=\ *************** SOURCE=.\typd_mlc.c *** 1598,1609 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_TYPD_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ ! ".\gc_typed.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_TYPD_=\ --- 1665,1677 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_TYPD_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ ! ".\include\gc_typed.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_TYPD_=\ *************** NODEP_CPP_TYPD_=\ *** 1620,1631 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_TYPD_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ ! ".\gc_typed.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_TYPD_=\ --- 1688,1700 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_TYPD_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ ! ".\include\gc_typed.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_TYPD_=\ *************** SOURCE=.\ptr_chck.c *** 1650,1660 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_PTR_C=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_PTR_C=\ --- 1719,1730 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_PTR_C=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_PTR_C=\ *************** NODEP_CPP_PTR_C=\ *** 1671,1681 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_PTR_C=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_mark.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_PTR_C=\ --- 1741,1752 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_PTR_C=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_pmark.h"\ ! ".\include\gc_mark.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_PTR_C=\ *************** SOURCE=.\dyn_load.c *** 1700,1709 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_DYN_L=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ --- 1771,1780 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_DYN_L=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ *************** NODEP_CPP_DYN_L=\ *** 1723,1732 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_DYN_L=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ --- 1794,1803 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_DYN_L=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\STAT.H"\ {$(INCLUDE)}"\sys\TYPES.H"\ *************** SOURCE=.\win32_threads.c *** 1754,1763 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_WIN32=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_WIN32=\ --- 1825,1834 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_WIN32=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_WIN32=\ *************** NODEP_CPP_WIN32=\ *** 1774,1783 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_WIN32=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_WIN32=\ --- 1845,1854 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_WIN32=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_WIN32=\ *************** SOURCE=.\checksums.c *** 1802,1811 **** !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_CHECK=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_CHECK=\ --- 1873,1882 ---- !IF "$(CFG)" == "gc - Win32 Release" DEP_CPP_CHECK=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_CHECK=\ *************** NODEP_CPP_CHECK=\ *** 1822,1831 **** !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_CHECK=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_CHECK=\ --- 1893,1902 ---- !ELSEIF "$(CFG)" == "gc - Win32 Debug" DEP_CPP_CHECK=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_CHECK=\ *************** NODEP_CPP_CHECK=\ *** 1876,1888 **** ################################################################################ # Begin Source File ! SOURCE=.\test.c DEP_CPP_TEST_=\ ! ".\gcconfig.h"\ ! ".\gc.h"\ ! ".\gc_hdrs.h"\ ! ".\gc_priv.h"\ ! ".\gc_typed.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_TEST_=\ --- 1947,1959 ---- ################################################################################ # Begin Source File ! SOURCE=.\tests\test.c DEP_CPP_TEST_=\ ! ".\include\private\gcconfig.h"\ ! ".\include\gc.h"\ ! ".\include\private\gc_hdrs.h"\ ! ".\include\private\gc_priv.h"\ ! ".\include\gc_typed.h"\ {$(INCLUDE)}"\sys\TYPES.H"\ NODEP_CPP_TEST_=\ *************** NODEP_CPP_TEST_=\ *** 1944,1956 **** SOURCE=.\cord\de_win.c DEP_CPP_DE_WI=\ ! ".\cord\cord.h"\ ".\cord\de_cmds.h"\ ".\cord\de_win.h"\ ! ".\cord\private\cord_pos.h"\ NODEP_CPP_DE_WI=\ ! ".\cord\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" --- 2015,2027 ---- SOURCE=.\cord\de_win.c DEP_CPP_DE_WI=\ ! ".\include\cord.h"\ ".\cord\de_cmds.h"\ ".\cord\de_win.h"\ ! ".\include\private\cord_pos.h"\ NODEP_CPP_DE_WI=\ ! ".\include\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" *************** NODEP_CPP_DE_WI=\ *** 1975,1987 **** SOURCE=.\cord\de.c DEP_CPP_DE_C2e=\ ! ".\cord\cord.h"\ ".\cord\de_cmds.h"\ ".\cord\de_win.h"\ ! ".\cord\private\cord_pos.h"\ NODEP_CPP_DE_C2e=\ ! ".\cord\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" --- 2046,2058 ---- SOURCE=.\cord\de.c DEP_CPP_DE_C2e=\ ! ".\include\cord.h"\ ".\cord\de_cmds.h"\ ".\cord\de_win.h"\ ! ".\include\private\cord_pos.h"\ NODEP_CPP_DE_C2e=\ ! ".\include\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" *************** NODEP_CPP_DE_C2e=\ *** 2006,2017 **** SOURCE=.\cord\cordxtra.c DEP_CPP_CORDX=\ ! ".\cord\cord.h"\ ! ".\cord\ec.h"\ ! ".\cord\private\cord_pos.h"\ NODEP_CPP_CORDX=\ ! ".\cord\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" --- 2077,2088 ---- SOURCE=.\cord\cordxtra.c DEP_CPP_CORDX=\ ! ".\include\cord.h"\ ! ".\include\ec.h"\ ! ".\include\private\cord_pos.h"\ NODEP_CPP_CORDX=\ ! ".\include\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" *************** NODEP_CPP_CORDX=\ *** 2036,2046 **** SOURCE=.\cord\cordbscs.c DEP_CPP_CORDB=\ ! ".\cord\cord.h"\ ! ".\cord\private\cord_pos.h"\ NODEP_CPP_CORDB=\ ! ".\cord\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" --- 2107,2117 ---- SOURCE=.\cord\cordbscs.c DEP_CPP_CORDB=\ ! ".\include\cord.h"\ ! ".\include\private\cord_pos.h"\ NODEP_CPP_CORDB=\ ! ".\include\gc.h"\ !IF "$(CFG)" == "cord - Win32 Release" diff -Nrc3pad gcc-3.0.4/boehm-gc/gc.man gcc-3.1/boehm-gc/gc.man *** gcc-3.0.4/boehm-gc/gc.man Wed Jun 30 12:43:33 1999 --- gcc-3.1/boehm-gc/gc.man Thu Jan 1 00:00:00 1970 *************** *** 1,80 **** - .TH GC_MALLOC 1L "12 February 1996" - .SH NAME - GC_malloc, GC_malloc_atomic, GC_free, GC_realloc, GC_enable_incremental, GC_register_finalizer, GC_malloc_ignore_off_page, GC_malloc_atomic_ignore_off_page, GC_set_warn_proc \- Garbage collecting malloc replacement - .SH SYNOPSIS - #include "gc.h" - .br - # define malloc(n) GC_malloc(n) - .br - ... malloc(...) ... - .br - .sp - cc ... gc.a - .LP - .SH DESCRIPTION - .I GC_malloc - and - .I GC_free - are plug-in replacements for standard malloc and free. However, - .I - GC_malloc - will attempt to reclaim inaccessible space automatically by invoking a conservative garbage collector at appropriate points. The collector traverses all data structures accessible by following pointers from the machines registers, stac