From db2b9f1bbde88b932022a02a9d33fd54284851ab Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Fri, 27 May 2005 21:53:51 +0000 Subject: [PATCH] Added src, set properties for all DOS files. svn: r4 --- MacOS.c | 135 +-- Makefile | 680 --------------- Makefile.in | 1626 ++++++++++++++++-------------------- allchblk.c | 3 + alloc.c | 21 +- alpha_mach_dep.S | 2 +- configure.in | 2 +- cord/de_win.ICO | Bin digimars.mak | 0 dyn_load.c | 6 + finalize.c | 447 +++++++--- gc.h | 3 + include/gc.h | 25 + include/gc_config_macros.h | 3 +- include/private/gc_priv.h | 24 +- include/private/gcconfig.h | 9 +- mallocx.c | 4 + mark.c | 57 +- mark_rts.c | 21 +- misc.c | 30 +- mkinstalldirs | 2 +- os_dep.c | 36 +- win32_threads.c | 0 23 files changed, 1364 insertions(+), 1772 deletions(-) delete mode 100644 Makefile mode change 100755 => 100644 cord/de_win.ICO mode change 100644 => 100755 digimars.mak create mode 100644 gc.h mode change 100755 => 100644 win32_threads.c diff --git a/MacOS.c b/MacOS.c index cc12cd15..08c3e0cf 100644 --- a/MacOS.c +++ b/MacOS.c @@ -8,12 +8,13 @@ 11/22/94 pcb StripAddress the temporary memory handle for 24-bit mode. 11/30/94 pcb Tracking all memory usage so we can deallocate it all at once. - 02/10/96 pcb Added routine to perform a final collection when -unloading shared library. + 02/10/96 pcb Added routine to perform a final collection when unloading shared library. by Patrick C. Beard. + + PLTSCHEME: this file is substantially modified for MzScheme/MrEd. */ -/* Boehm, February 15, 1996 2:55 pm PST */ +/* Boehm, November 17, 1995 11:50 am PST */ #include #include @@ -23,7 +24,7 @@ unloading shared library. #include #include "gc.h" -#include "gc_priv.h" +#include "private/gc_priv.h" // use 'CODE' resource 0 to get exact location of the beginning of global space. @@ -47,6 +48,20 @@ void* GC_MacGetDataStart() return 0; } +/* PLTSCHEME: Function for handling CW Pro 3 far data */ +void* GC_MacGetDataEnd() +{ + CodeZeroHandle code0 = (CodeZeroHandle)GetResource('CODE', 0); + if (code0) { + long aboveA5Size = (**code0).aboveA5; + ReleaseResource((Handle)code0); + return (LMGetCurrentA5() + aboveA5Size); + } + fprintf(stderr, "Couldn't load the jump table."); + exit(-1); + return 0; +} + /* track the use of temporary memory so it can be freed all at once. */ typedef struct TemporaryMemoryBlock TemporaryMemoryBlock, **TemporaryMemoryHandle; @@ -66,7 +81,27 @@ Ptr GC_MacTemporaryNewPtr(size_t size, Boolean clearMemory) static Boolean firstTime = true; OSErr result; TemporaryMemoryHandle tempMemBlock; - Ptr tempPtr = nil; + Ptr tempPtr; + + /* PLTSCHEME: IM requests that temp memory not be locked across + calls to GetNextEvent or WaitNextEvent. So, we'll use regular + pointers, but grab temp memory if we run out completely. + Also, we'll be nicer about not grabbing *all* of temp memory, + as this seems to bring down the whole system. */ + if ((FreeMem() - size) >= 65536) { /* resort to tmp mem if local < some amount */ + if (clearMemory) + tempPtr = NewPtrClear(size); + else + tempPtr = NewPtr(size); + if (tempPtr) + return tempPtr; + } else + tempPtr = NULL; + + if ((TempFreeMem() - size) < 65536) { + /* Not much temp mem availabl, either. Give up. */ + return NULL; + } tempMemBlock = (TemporaryMemoryHandle)TempNewHandle(size + sizeof(TemporaryMemoryBlock), &result); if (tempMemBlock && result == noErr) { @@ -79,76 +114,52 @@ Ptr GC_MacTemporaryNewPtr(size_t size, Boolean clearMemory) (**tempMemBlock).nextBlock = theTemporaryMemory; theTemporaryMemory = tempMemBlock; } - -# if !defined(SHARED_LIBRARY_BUILD) + +#if !defined(SHARED_LIBRARY_BUILD) // install an exit routine to clean up the memory used at the end. if (firstTime) { atexit(&GC_MacFreeTemporaryMemory); firstTime = false; } -# endif - +#endif + return tempPtr; } -extern word GC_fo_entries; - static void perform_final_collection() { - unsigned i; - word last_fo_entries = 0; - - /* adjust the stack bottom, because CFM calls us from another stack - location. */ - GC_stackbottom = (ptr_t)&i; - - /* try to collect and finalize everything in sight */ - for (i = 0; i < 2 || GC_fo_entries < last_fo_entries; i++) { - last_fo_entries = GC_fo_entries; - GC_gcollect(); - } + int i; + + /* adjust the stack bottom, because CFM calls us from another stack location. */ + GC_stackbottom = (ptr_t)&i; + + /* try to collect everything in sight (from test.c). Is this safe? */ + while (GC_collect_a_little()) ; + for (i = 0; i < 16; i++) + GC_gcollect(); } - void GC_MacFreeTemporaryMemory() { -# if defined(SHARED_LIBRARY_BUILD) - /* if possible, collect all memory, and invoke all finalizers. */ - perform_final_collection(); -# endif - - if (theTemporaryMemory != NULL) { - long totalMemoryUsed = 0; - TemporaryMemoryHandle tempMemBlock = theTemporaryMemory; - while (tempMemBlock != NULL) { - TemporaryMemoryHandle nextBlock = (**tempMemBlock).nextBlock; - totalMemoryUsed += GetHandleSize((Handle)tempMemBlock); - DisposeHandle((Handle)tempMemBlock); - tempMemBlock = nextBlock; +#if defined(SHARED_LIBRARY_BUILD) + /* collect all memory, and invoke all finalizers. */ + perform_final_collection(); +#endif + + if (theTemporaryMemory != NULL) { + long totalMemoryUsed = 0; + TemporaryMemoryHandle tempMemBlock = theTemporaryMemory; + while (tempMemBlock != NULL) { + TemporaryMemoryHandle nextBlock = (**tempMemBlock).nextBlock; + totalMemoryUsed += GetHandleSize((Handle)tempMemBlock); + DisposeHandle((Handle)tempMemBlock); + tempMemBlock = nextBlock; + } + theTemporaryMemory = NULL; + +#if !defined(SILENT) && !defined(SHARED_LIBRARY_BUILD) + fprintf(stdout, "[total memory used: %ld bytes.]\n", totalMemoryUsed); + fprintf(stdout, "[total collections: %ld.]\n", GC_gc_no); +#endif } - theTemporaryMemory = NULL; - -# if !defined(SILENT) && !defined(SHARED_LIBRARY_BUILD) - fprintf(stdout, "[total memory used: %ld bytes.]\n", - totalMemoryUsed); - fprintf(stdout, "[total collections: %ld.]\n", GC_gc_no); -# endif - } } - -#if __option(far_data) - - void* GC_MacGetDataEnd() - { - CodeZeroHandle code0 = (CodeZeroHandle)GetResource('CODE', 0); - if (code0) { - long aboveA5Size = (**code0).aboveA5; - ReleaseResource((Handle)code0); - return (LMGetCurrentA5() + aboveA5Size); - } - fprintf(stderr, "Couldn't load the jump table."); - exit(-1); - return 0; - } - -#endif /* __option(far_data) */ diff --git a/Makefile b/Makefile deleted file mode 100644 index 20fa40a9..00000000 --- a/Makefile +++ /dev/null @@ -1,680 +0,0 @@ -# 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= -# ABI_FLAG should be the cc flag that specifies the ABI. On most -# platforms this will be the empty string. Possible values: -# +DD64 for 64-bit executable on HP/UX. -# -n32, -n64, -o32 for SGI/MIPS ABIs. - -AS_ABI_FLAG=$(ABI_FLAG) -# ABI flag for assembler. On HP/UX this is +A64 for 64 bit -# executables. - -CC=cc $(ABI_FLAG) -CXX=g++ $(ABI_FLAG) -AS=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. - -# 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 in a static library on HP/UX, -# add to the above: -# -DGC_HPUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC -D_POSIX_C_SOURCE=199506L -# To build the thread-safe collector on Tru64, add to the above: -# -pthread -DGC_OSF1_THREADS - -# 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. -# (Internally this define GC_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. -# -DGC_OSF1_THREADS enables support for Tru64 pthreads. Untested. -# -DGC_FREEBSD_THREADS enables support for FreeBSD pthreads. Untested. -# Appeared to run into some underlying thread problems. -# -DGC_DARWIN_THREADS enables support for Mac OS X pthreads. Untested. -# -DGC_DGUX386_THREADS enables support for DB/UX on I386 threads. -# See README.DGUX386. -# -DGC_WIN32_THREADS enables support for win32 threads. That makes sense -# for this Makefile only under Cygwin. -# -DGC_THREADS should set the appropriate one of the above macros. -# It assumes pthreads for Solaris. -# -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 to be defined as alias for X. -# Unless the following macros are defined, realloc is also redirected -# to GC_realloc, and free is redirected to GC_free. -# 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. -# It requires that the following two macros also be used.) -# 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. -# This also requires the following: -# -DREDIRECT_FREE=X causes free to be redirected to X. The -# canonical use is -DREDIRECT_FREE=GC_debug_free. -# -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% mod. bugs) 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. -# Minimally tested. Didn't appear to be an obvious win on a K6-2/500. -# -DUSE_PPC_PREFETCH causes the collector to issue PowerPC style -# prefetch instructions. No effect except on PowerPC OS X platforms. -# Performance impact untested. -# -DGC_USE_LD_WRAP in combination with the old 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. -# -DUSE_COMPILER_TLS causes thread local allocation to use compiler-supported -# "__thread" thread-local variables. This is the default in HP/UX. It -# may help performance on recent Linux installations. (It failed for -# me on RedHat 8, but appears to work on RedHat 9.) -# -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. -# -DHANDLE_FORK attempts to make GC_malloc() work in a child process fork()ed -# from a multithreaded parent. Currently only supported by pthread_support.c. -# (Similar code should work on Solaris or Irix, but it hasn't been tried.) -# -DTEST_WITH_SYSTEM_MALLOC causes gctest to allocate (and leak) large chunks -# of memory with the standard system malloc. This will cause the root -# set and collected heap to grow significantly if malloced memory is -# somehow getting traced by the collector. This has no impact on the -# generated library; it only affects the test. -# -DPOINTER_MASK=0x... causes candidate pointers to be ANDed with the -# given mask before being considered. If either this or the following -# macro is defined, it will be assumed that all pointers stored in -# the heap need to be processed this way. Stack and register pointers -# will be considered both with and without processing. -# These macros are normally needed only to support systems that use -# high-order pointer tags. EXPERIMENTAL. -# -DPOINTER_SHIFT=n causes the collector to left shift candidate pointers -# by the indicated amount before trying to interpret them. Applied -# after POINTER_MASK. EXPERIMENTAL. See also the preceding macro. -# - -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 aix_irix_threads.o pthread_support.o pthread_stop_world.o darwin_stop_world.o typd_mlc.o ptr_chck.o mallocx.o solaris_pthreads.o gcj_mlc.o specific.o gc_dlopen.o backgraph.o win32_threads.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 aix_irix_threads.c pthread_support.c pthread_stop_world.c darwin_stop_world.c typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c gcj_mlc.c specific.c gc_dlopen.c backgraph.c win32_threads.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/gc_allocator.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_darwin_mach_dep.s \ - include/leak_detector.h include/gc_amiga_redirects.h \ - include/gc_pthread_redirects.h ia64_save_regs_in_stack.s \ - include/gc_config_macros.h include/private/pthread_support.h \ - include/private/pthread_stop_world.h include/private/darwin_semaphore.h \ - include/private/darwin_stop_world.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 \ - doc/README.DGUX386 doc/README.arm.cross doc/leak.html \ - doc/scale.html doc/gcinterface.html doc/README.darwin \ - doc/simple_example.html - -TESTS= tests/test.c tests/test_cpp.cc tests/trace_test.c \ - tests/leak_test.c tests/thread_leak_test.c tests/middle.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 \ - include/Makefile.am include/Makefile.in \ - doc/Makefile.am doc/Makefile.in \ - ltmain.sh mkinstalldirs depcomp missing - -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 NT_STATIC_THREADS_MAKEFILE -# 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 \ - 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 - -LEAKFLAGS=$(CFLAGS) -DFIND_LEAK - -BSD-pkg-all: bsd-libgc.a bsd-libleak.a - -bsd-libgc.a: - $(MAKE) CFLAGS="$(CFLAGS)" clean c++-t - mv gc.a bsd-libgc.a - -bsd-libleak.a: - $(MAKE) -f Makefile.direct CFLAGS="$(LEAKFLAGS)" clean c++-nt - mv gc.a bsd-libleak.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 - ${INSTALL_MAN} doc/gc.man ${PREFIX}/man/man3/gc.3 - -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/gc_pthread_redirects.h \ - $(srcdir)/include/private/gcconfig.h $(srcdir)/include/gc_typed.h \ - $(srcdir)/include/gc_config_macros.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 pthread_support.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_darwin_mach_dep.s \ - $(srcdir)/sparc_mach_dep.S $(srcdir)/sparc_sunos4_mach_dep.s \ - $(srcdir)/ia64_save_regs_in_stack.s \ - $(srcdir)/sparc_netbsd_mach_dep.s $(UTILS) - rm -f mach_dep.o - ./if_mach MIPS IRIX5 $(CC) -c -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 POWERPC DARWIN $(AS) -o mach_dep.o $(srcdir)/powerpc_darwin_mach_dep.s - ./if_mach ALPHA LINUX $(CC) -c -o mach_dep.o $(srcdir)/alpha_mach_dep.S - ./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 DARWIN $(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 --git a/Makefile.in b/Makefile.in index fb52a370..6235ee6c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,921 +1,769 @@ -# Makefile.in generated by automake 1.6.3 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# 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. +# PLTSCHEME: modified version of Makefile.direct +# This is the original manually generated Makefile. It may still be used +# to build the collector. # -# Original author: Tom Tromey -# Severely truncated by Hans-J. Boehm -# Modified by: Grzegorz Jakacki -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_HEADER = $(INSTALL_DATA) -transform = @program_transform_name@ -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ - -CCASFLAGS = @CCASFLAGS@ $(DEFS) -CFLAGS = @CFLAGS@ -CXX = @CXX@ -CXXFLAGS = @CXXFLAGS@ -CXXINCLUDES = @CXXINCLUDES@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -ECHO = @ECHO@ -EXTRA_TEST_LIBS = @EXTRA_TEST_LIBS@ -GC_CFLAGS = @GC_CFLAGS@ -GC_VERSION = @GC_VERSION@ -INCLUDES = @INCLUDES@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -MAINT = @MAINT@ -MY_CFLAGS = @MY_CFLAGS@ -OBJDUMP = @OBJDUMP@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -STRIP = @STRIP@ -THREADLIBS = @THREADLIBS@ -UNWINDLIBS = @UNWINDLIBS@ -VERSION = @VERSION@ -addincludes = @addincludes@ -addlibs = @addlibs@ -addobjs = @addobjs@ -addtests = @addtests@ -am__include = @am__include@ -am__quote = @am__quote@ -install_sh = @install_sh@ -target_all = @target_all@ - -AUTOMAKE_OPTIONS = foreign - -SUBDIRS = doc include - - -# documentation which is not installed +# 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= @CXX@ $(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= @srcdir@ +VPATH= $(srcdir) + +# for version.mak: +mainsrcdir = @srcdir@/../.. +@INCLUDEDEP@ @srcdir@/../version.mak + +# compiler options; mainly used to allow importing options +OPTIONS=@OPTIONS@ @CGCOPTIONS@ + +BASEFLAGS= -I$(srcdir)/include -DNO_SIGNALS @CFLAGS@ @COMPFLAGS@ @PREFLAGS@ +CFLAGS= $(BASEFLAGS) @PROFFLAGS@ $(OPTIONS) -DNO_EXECUTE_PERMISSION -DSILENT -DNO_GETENV -DLARGE_CONFIG -DATOMIC_UNCOLLECTABLE -DINITIAL_MARK_STACK_SIZE=8192 + +# To build the parallel collector on Linux, add to the above: +# -DGC_LINUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC +# To build the parallel collector in a static library on HP/UX, +# add to the above: +# -DGC_HPUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC -D_POSIX_C_SOURCE=199506L +# To build the thread-safe collector on Tru64, add to the above: +# -pthread -DGC_OSF1_THREADS + +# 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_FOR_BUILD@ +HOSTCFLAGS=$(BASEFLAGS) + +# 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. +# (Internally this define GC_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. +# -DGC_OSF1_THREADS enables support for Tru64 pthreads. Untested. +# -DGC_FREEBSD_THREADS enables support for FreeBSD pthreads. Untested. +# Appeared to run into some underlying thread problems. +# -DGC_DARWIN_THREADS enables support for Mac OS X pthreads. Untested. +# -DGC_DGUX386_THREADS enables support for DB/UX on I386 threads. +# See README.DGUX386. +# -DGC_WIN32_THREADS enables support for win32 threads. That makes sense +# for this Makefile only under Cygwin. +# -DGC_THREADS should set the appropriate one of the above macros. +# It assumes pthreads for Solaris. +# -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 to be defined as alias for X. +# Unless the following macros are defined, realloc is also redirected +# to GC_realloc, and free is redirected to GC_free. +# 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. +# It requires that the following two macros also be used.) +# 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. +# This also requires the following: +# -DREDIRECT_FREE=X causes free to be redirected to X. The +# canonical use is -DREDIRECT_FREE=GC_debug_free. +# -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% mod. bugs) 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. +# Minimally tested. Didn't appear to be an obvious win on a K6-2/500. +# -DUSE_PPC_PREFETCH causes the collector to issue PowerPC style +# prefetch instructions. No effect except on PowerPC OS X platforms. +# Performance impact untested. +# -DGC_USE_LD_WRAP in combination with the old 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. +# -DUSE_COMPILER_TLS causes thread local allocation to use compiler-supported +# "__thread" thread-local variables. This is the default in HP/UX. It +# may help performance on recent Linux installations. (It failed for +# me on RedHat 8, but appears to work on RedHat 9.) +# -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. +# -DHANDLE_FORK attempts to make GC_malloc() work in a child process fork()ed +# from a multithreaded parent. Currently only supported by pthread_support.c. +# (Similar code should work on Solaris or Irix, but it hasn't been tried.) +# -DTEST_WITH_SYSTEM_MALLOC causes gctest to allocate (and leak) large chunks +# of memory with the standard system malloc. This will cause the root +# set and collected heap to grow significantly if malloced memory is +# somehow getting traced by the collector. This has no impact on the +# generated library; it only affects the test. +# -DPOINTER_MASK=0x... causes candidate pointers to be ANDed with the +# given mask before being considered. If either this or the following +# macro is defined, it will be assumed that all pointers stored in +# the heap need to be processed this way. Stack and register pointers +# will be considered both with and without processing. +# These macros are normally needed only to support systems that use +# high-order pointer tags. EXPERIMENTAL. +# -DPOINTER_SHIFT=n causes the collector to left shift candidate pointers +# by the indicated amount before trying to interpret them. Applied +# after POINTER_MASK. EXPERIMENTAL. See also the preceding macro. # -# other makefiles -# :GOTCHA: deliberately we do not include 'Makefile' - -# files used by makefiles other than Makefile.am +CXXFLAGS= $(CFLAGS) +AR= @AR@ +ARFLAGS= @ARFLAGS@ +RANLIB= @RANLIB@ + + +OBJS= alloc.@LTO@ reclaim.@LTO@ allchblk.@LTO@ misc.@LTO@ mach_dep.@LTO@ os_dep.@LTO@ mark_rts.@LTO@ headers.@LTO@ mark.@LTO@ obj_map.@LTO@ blacklst.@LTO@ finalize.@LTO@ new_hblk.@LTO@ dbg_mlc.@LTO@ malloc.@LTO@ stubborn.@LTO@ checksums.@LTO@ solaris_threads.@LTO@ aix_irix_threads.@LTO@ pthread_support.@LTO@ pthread_stop_world.@LTO@ darwin_stop_world.@LTO@ typd_mlc.@LTO@ ptr_chck.@LTO@ mallocx.@LTO@ solaris_pthreads.@LTO@ gcj_mlc.@LTO@ specific.@LTO@ gc_dlopen.@LTO@ backgraph.@LTO@ win32_threads.@LTO@ + +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 aix_irix_threads.c pthread_support.c pthread_stop_world.c darwin_stop_world.c typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c gcj_mlc.c specific.c gc_dlopen.c backgraph.c win32_threads.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.@LTO@ cord/cordxtra.@LTO@ cord/cordprnt.@LTO@ + +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/gc_allocator.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_darwin_mach_dep.s \ + include/leak_detector.h include/gc_amiga_redirects.h \ + include/gc_pthread_redirects.h ia64_save_regs_in_stack.s \ + include/gc_config_macros.h include/private/pthread_support.h \ + include/private/pthread_stop_world.h include/private/darwin_semaphore.h \ + include/private/darwin_stop_world.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 \ + doc/README.DGUX386 doc/README.arm.cross doc/leak.html \ + doc/scale.html doc/gcinterface.html doc/README.darwin \ + doc/simple_example.html + +TESTS= tests/test.c tests/test_cpp.cc tests/trace_test.c \ + tests/leak_test.c tests/thread_leak_test.c tests/middle.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 \ + include/Makefile.am include/Makefile.in \ + doc/Makefile.am doc/Makefile.in \ + ltmain.sh mkinstalldirs depcomp missing + +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 NT_STATIC_THREADS_MAKEFILE +# 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 \ + 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 + +LEAKFLAGS=$(CFLAGS) -DFIND_LEAK + +BSD-pkg-all: bsd-libgc.a + +bsd-libgc.a: + $(MAKE) CFLAGS="$(CFLAGS)" clean c++-t + mv gc.a bsd-libgc.a + +bsd-libleak.a: + $(MAKE) -f Makefile.direct CFLAGS="$(LEAKFLAGS)" clean c++-nt + mv gc.a bsd-libleak.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 + ${INSTALL_MAN} doc/gc.man ${PREFIX}/man/man3/gc.3 + +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.@LTO@ $(SRCS) + $(MAKE) -f PCR-Makefile depend + $(MAKE) -f PCR-Makefile + +$(OBJS) tests/test.@LTO@ dyn_load.@LTO@ dyn_load_sunos53.@LTO@: \ + $(srcdir)/include/private/gc_priv.h \ + $(srcdir)/include/private/gc_hdrs.h $(srcdir)/include/private/gc_locks.h \ + $(srcdir)/include/gc.h $(srcdir)/include/gc_pthread_redirects.h \ + $(srcdir)/include/private/gcconfig.h $(srcdir)/include/gc_typed.h \ + $(srcdir)/include/gc_config_macros.h +# The dependency on Makefile is needed. Changing +# options such as -DSILENT affects the size of GC_arrays, +# invalidating all .@LTO@ files that rely on gc_priv.h + +mark.@LTO@ typd_mlc.@LTO@ finalize.@LTO@ ptr_chck.@LTO@: $(srcdir)/include/gc_mark.h $(srcdir)/include/private/gc_pmark.h + +specific.@LTO@ pthread_support.@LTO@: $(srcdir)/include/private/specific.h + +solaris_threads.@LTO@ solaris_pthreads.@LTO@: $(srcdir)/include/private/solaris_threads.h + +dbg_mlc.@LTO@ gcj_mlc.@LTO@: $(srcdir)/include/private/dbg_mlc.h + +tests/test.@LTO@: tests $(srcdir)/tests/test.c + $(CC) $(CFLAGS) -c $(srcdir)/tests/test.c + mv test.@LTO@ tests/test.@LTO@ + +tests: + mkdir tests + +# PLTSCHEME: make ../libmzgc.a, and use $(AR), $(RANLIB), and @LIBSFX@: +base_lib ../libmzgc.@LIBSFX@: $(OBJS) dyn_load.@LTO@ $(UTILS) + $(AR) $(ARFLAGS) ../libmzgc.@LIBSFX@ $(OBJS) dyn_load.@LTO@ + $(RANLIB) ../libmzgc.@LIBSFX@ + +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.@LTO@: $(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.@LTO@ $(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.@LTO@ gc.a -ldld `./threadlibs` + ./if_not_there test_cpp $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/tests/test_cpp.cc gc_cpp.@LTO@ 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.@LTO@ $(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.@LTO@ + ./if_mach M68K AMIGA touch dont_ar_4 + ./if_mach M68K AMIGA $(AR) -vrus gc.a gc_cpp.@LTO@ + ./if_not_there dont_ar_4 $(AR) ru gc.a gc_cpp.@LTO@ + ./if_not_there dont_ar_4 $(RANLIB) gc.a || cat /dev/null + ./test_cpp 1 + echo > c++ + +# PLTSCHEME: need $(srcdir): +dyn_load_sunos53.@LTO@: $(srcdir)/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.@LTO@ + $(CC) -G -o sunos5gc.so $(OBJS) dyn_load_sunos53.@LTO@ -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.@LTO@ -lc + ln libalphagc.so libgc.so + +# IRIX shared library version of the collector +libirixgc.so: $(OBJS) dyn_load.@LTO@ + ld -shared $(ABI_FLAG) -o libirixgc.so $(OBJS) dyn_load.@LTO@ -lc + ln libirixgc.so libgc.so + +# Linux shared library version of the collector +liblinuxgc.so: $(OBJS) dyn_load.@LTO@ + gcc -shared -o liblinuxgc.so $(OBJS) dyn_load.@LTO@ + 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 %.@LTO@, %.lo, $(OBJS)) # - -# part of C++ interface +#.SUFFIXES: .lo $(SUFFIXES) # - -# tests not used by Makefile.am (:FIXME: why?) +#.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.@LTO@: $(srcdir)/mach_dep.c $(srcdir)/mips_sgi_mach_dep.s \ + $(srcdir)/mips_ultrix_mach_dep.s \ + $(srcdir)/rs6000_mach_dep.s $(srcdir)/powerpc_darwin_mach_dep.s \ + $(srcdir)/sparc_mach_dep.S $(srcdir)/sparc_sunos4_mach_dep.s \ + $(srcdir)/ia64_save_regs_in_stack.s \ + $(srcdir)/sparc_netbsd_mach_dep.s $(UTILS) + rm -f mach_dep.@LTO@ + ./if_mach MIPS IRIX5 $(CC) -c -o mach_dep.@LTO@ $(srcdir)/mips_sgi_mach_dep.s + ./if_mach MIPS RISCOS $(AS) -o mach_dep.@LTO@ $(srcdir)/mips_ultrix_mach_dep.s + ./if_mach MIPS ULTRIX $(AS) -o mach_dep.@LTO@ $(srcdir)/mips_ultrix_mach_dep.s + ./if_mach POWERPC DARWIN $(AS) -o mach_dep.@LTO@ $(srcdir)/powerpc_darwin_mach_dep.s + ./if_mach ALPHA LINUX $(CC) -c -o mach_dep.@LTO@ $(srcdir)/alpha_mach_dep.S + ./if_mach SPARC SUNOS5 $(CC) -c -o mach_dep.@LTO@ $(srcdir)/sparc_mach_dep.S + ./if_mach SPARC SUNOS4 $(AS) -o mach_dep.@LTO@ $(srcdir)/sparc_sunos4_mach_dep.s + ./if_mach SPARC OPENBSD $(AS) -o mach_dep.@LTO@ $(srcdir)/sparc_sunos4_mach_dep.s + ./if_mach SPARC NETBSD $(AS) -o mach_dep.@LTO@ $(srcdir)/sparc_netbsd_mach_dep.s + ./if_mach IA64 "" as $(AS_ABI_FLAG) -o ia64_save_regs_in_stack.@LTO@ $(srcdir)/ia64_save_regs_in_stack.s + ./if_mach IA64 "" $(CC) -c -o mach_dep1.@LTO@ $(SPECIALCFLAGS) $(srcdir)/mach_dep.c + ./if_mach IA64 "" ld -r -o mach_dep.@LTO@ mach_dep1.@LTO@ ia64_save_regs_in_stack.@LTO@ + ./if_not_there mach_dep.@LTO@ $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c + +mark_rts.@LTO@: $(srcdir)/mark_rts.c $(UTILS) + rm -f mark_rts.@LTO@ + -./if_mach ALPHA OSF1 $(CC) -c $(CFLAGS) -Wo,-notail $(srcdir)/mark_rts.c + ./if_not_there mark_rts.@LTO@ $(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.@LTO@: version.h + +cord: + mkdir cord + +cord/cordbscs.@LTO@: cord $(srcdir)/cord/cordbscs.c $(CORD_INCLUDE_FILES) + $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordbscs.c + mv cordbscs.@LTO@ cord/cordbscs.@LTO@ +# not all compilers understand -o filename + +cord/cordxtra.@LTO@: cord $(srcdir)/cord/cordxtra.c $(CORD_INCLUDE_FILES) + $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordxtra.c + mv cordxtra.@LTO@ cord/cordxtra.@LTO@ + +cord/cordprnt.@LTO@: cord $(srcdir)/cord/cordprnt.c $(CORD_INCLUDE_FILES) + $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordprnt.c + mv cordprnt.@LTO@ cord/cordprnt.@LTO@ + +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.@LTO@ cord/cordxtra.@LTO@ gc.a $(UTILS) + rm -f cord/de + ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.@LTO@ cord/cordxtra.@LTO@ gc.a $(CURSES) -lucb `./threadlibs` + ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.@LTO@ cord/cordxtra.@LTO@ gc.a $(CURSES) -ldld `./threadlibs` + ./if_mach RS6000 "" $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.@LTO@ cord/cordxtra.@LTO@ gc.a -lcurses + ./if_mach POWERPC DARWIN $(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.@LTO@ cord/cordxtra.@LTO@ gc.a -lcurses `./threadlibs` + ./if_mach ALPHA LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.@LTO@ cord/cordxtra.@LTO@ gc.a -lcurses `./threadlibs` + ./if_mach IA64 LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.@LTO@ cord/cordxtra.@LTO@ gc.a -lcurses `./threadlibs` + ./if_mach M68K AMIGA $(CC) $(CFLAGS) -UGC_AMIGA_MAKINGLIB -o cord/de $(srcdir)/cord/de.c cord/cordbscs.@LTO@ cord/cordxtra.@LTO@ gc.a -lcurses + ./if_not_there cord/de $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.@LTO@ cord/cordxtra.@LTO@ 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 *.@LTO@ *.exe tests/*.@LTO@ gctest gctest_dyn_link test_cpp \ + setjmp_test mon.@LTO@ut gmon.@LTO@ut a.@LTO@ut core if_not_there if_mach \ + threadlibs $(CORD_OBJS) cord/cordtest cord/de + -rm -f *~ + +gctest: tests/test.@LTO@ gc.a $(UTILS) + rm -f gctest + ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o gctest tests/test.@LTO@ gc.a -lucb + ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o gctest tests/test.@LTO@ gc.a -ldld `./threadlibs` + ./if_mach M68K AMIGA $(CC) $(CFLAGS) -UGC_AMIGA_MAKINGLIB -o gctest tests/test.@LTO@ gc.a `./threadlibs` + ./if_not_there gctest $(CC) $(CFLAGS) -o gctest tests/test.@LTO@ 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.@LTO@ld + 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.@LTO@ libgc.so + $(CC) -L$(ABSDIR) -R$(ABSDIR) -o gctest_dyn_link tests/test.@LTO@ -lgc -ldl -lthread + +gctest_irix_dyn_link: tests/test.@LTO@ libirixgc.so + $(CC) -L$(ABSDIR) -o gctest_irix_dyn_link tests/test.@LTO@ -lirixgc + +# The following appear to be dead, especially since libgc_globals.h +# is apparently lost. +test_dll.@LTO@: tests/test.c libgc_globals.h + $(CC) $(CFLAGS) -DGC_USE_DLL -c tests/test.c -o test_dll.@LTO@ -# cord package -# +test_dll: test_dll.@LTO@ libgc_dll.a libgc.dll + $(CC) test_dll.@LTO@ -L$(ABSDIR) -lgc_dll -o test_dll -# :FIXME: why do we distribute this one??? -# -EXTRA_DIST = alpha_mach_dep.S mips_sgi_mach_dep.s sparc_mach_dep.S README.QUICK BCC_MAKEFILE NT_MAKEFILE NT_THREADS_MAKEFILE \ - OS2_MAKEFILE PCR-Makefile digimars.mak EMX_MAKEFILE \ - Makefile.direct Makefile.dj Makefile.DLLs SMakefile.amiga \ - WCC_MAKEFILE\ -add_gc_prefix.c gcname.c if_mach.c if_not_there.c \ - hpux_test_and_clear.s pc_excludes gc.mak MacOS.c \ - MacProjects.sit.hqx mach_dep.c setjmp_t.c \ - threadlibs.c AmigaOS.c \ - Mac_files/datastart.c Mac_files/dataend.c \ - Mac_files/MacOS_config.h Mac_files/MacOS_Test_config.h\ -gc_cpp.cc gc_cpp.cpp tests/test_cpp.cc tests/trace_test.c \ - tests/leak_test.c tests/thread_leak_test.c\ -cord/cordbscs.c cord/cordtest.c cord/de.c cord/de_win.c \ - cord/de_win.ICO cord/cordprnt.c cord/cordxtra.c cord/de_cmds.h \ - cord/de_win.h cord/de_win.RC\ -libtool.m4 +SYM_PREFIX-libgc=GC -@CPLUSPLUS_TRUE@extra = libgccpp.la -@CPLUSPLUS_FALSE@extra = -lib_LTLIBRARIES = libgc.la $(extra) +# Uncomment the following line to build a GNU win32 DLL +# include Makefile.DLLs -include_HEADERS = include/gc.h include/gc_local_alloc.h \ -include/gc_pthread_redirects.h include/gc_config_macros.h \ -include/leak_detector.h include/gc_typed.h @addincludes@ +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 -EXTRA_HEADERS = include/gc_cpp.h include/gc_allocator.h +# PLTSCHEME: explicit targets to get $(srcdir) in place for non-gmake +alloc.@LTO@: $(srcdir)/alloc.c + $(CC) $(CFLAGS) -c $(srcdir)/alloc.c -@POWERPC_DARWIN_TRUE@asm_libgc_sources = powerpc_darwin_mach_dep.s -@POWERPC_DARWIN_FALSE@asm_libgc_sources = +reclaim.@LTO@: $(srcdir)/reclaim.c + $(CC) $(CFLAGS) -c $(srcdir)/reclaim.c -libgc_la_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 aix_irix_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 \ -pthread_support.c pthread_stop_world.c darwin_stop_world.c \ -$(asm_libgc_sources) +allchblk.@LTO@: $(srcdir)/allchblk.c + $(CC) $(CFLAGS) -c $(srcdir)/allchblk.c +misc.@LTO@: $(srcdir)/misc.c + $(CC) $(CFLAGS) -c $(srcdir)/misc.c -# Include THREADLIBS here to ensure that the correct versions of -# linuxthread semaphore functions get linked: -libgc_la_LIBADD = @addobjs@ $(THREADLIBS) $(UNWINDLIBS) -libgc_la_DEPENDENCIES = @addobjs@ -libgc_la_LDFLAGS = -version-info 1:2:0 +os_dep.@LTO@: $(srcdir)/os_dep.c + $(CC) $(CFLAGS) -c $(srcdir)/os_dep.c -EXTRA_libgc_la_SOURCES = alpha_mach_dep.S \ - mips_sgi_mach_dep.s mips_ultrix_mach_dep.s powerpc_darwin_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 +headers.@LTO@: $(srcdir)/headers.c + $(CC) $(CFLAGS) -c $(srcdir)/headers.c +mark.@LTO@: $(srcdir)/mark.c + $(CC) $(CFLAGS) -c $(srcdir)/mark.c -libgccpp_la_SOURCES = gc_cpp.cc -libgccpp_la_LIBADD = $(THREADLIBS) $(UNWINDLIBS) -libgccpp_la_LDFLAGS = -version-info 1:2:0 +obj_map.@LTO@: $(srcdir)/obj_map.c + $(CC) $(CFLAGS) -c $(srcdir)/obj_map.c -AM_CXXFLAGS = @GC_CFLAGS@ -AM_CFLAGS = @GC_CFLAGS@ +blacklst.@LTO@: $(srcdir)/blacklst.c + $(CC) $(CFLAGS) -c $(srcdir)/blacklst.c -@CPLUSPLUS_TRUE@extra_checks = test_cpp -@CPLUSPLUS_FALSE@extra_checks = +finalize.@LTO@: $(srcdir)/finalize.c + $(CC) $(CFLAGS) -c $(srcdir)/finalize.c -check_PROGRAMS = gctest $(extra_checks) +new_hblk.@LTO@: $(srcdir)/new_hblk.c + $(CC) $(CFLAGS) -c $(srcdir)/new_hblk.c -# gctest_OBJECTS = test.o -gctest_SOURCES = tests/test.c -gctest_LDADD = ./libgc.la $(THREADLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS) -test_cpp_SOURCES = tests/test_cpp.cc -test_cpp_LDADD = ./libgc.la ./libgccpp.la $(THREADLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS) +dbg_mlc.@LTO@: $(srcdir)/dbg_mlc.c + $(CC) $(CFLAGS) -c $(srcdir)/dbg_mlc.c -TESTS = gctest $(extra_checks) +malloc.@LTO@: $(srcdir)/malloc.c + $(CC) $(CFLAGS) -c $(srcdir)/malloc.c -all_objs = @addobjs@ $(libgc_la_OBJECTS) +stubborn.@LTO@: $(srcdir)/stubborn.c + $(CC) $(CFLAGS) -c $(srcdir)/stubborn.c -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(MY_CFLAGS) $(GC_CFLAGS) +checksums.@LTO@: $(srcdir)/checksums.c + $(CC) $(CFLAGS) -c $(srcdir)/checksums.c -LINK = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(MY_CFLAGS) $(LDFLAGS) -o $@ +solaris_threads.@LTO@: $(srcdir)/solaris_threads.c + $(CC) $(CFLAGS) -c $(srcdir)/solaris_threads.c -dist_noinst_SCRIPTS = callprocs configure.host +win32_threads.@LTO@: $(srcdir)/win32_threads.c + $(CC) $(CFLAGS) -c $(srcdir)/win32_threads.c -# headers which are not installed -# (see include/Makefile.am for more) -# -dist_noinst_HEADERS = version.h +aix_irix_threads.@LTO@: $(srcdir)/aix_irix_threads.c + $(CC) $(CFLAGS) -c $(srcdir)/aix_irix_threads.c -# this is an auxiliary shell file used by Makefile and Makefile.direct -# -CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(lib_LTLIBRARIES) - -@POWERPC_DARWIN_TRUE@am__objects_1 = powerpc_darwin_mach_dep.lo -@POWERPC_DARWIN_FALSE@am__objects_1 = -am_libgc_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 aix_irix_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 pthread_support.lo \ - pthread_stop_world.lo darwin_stop_world.lo $(am__objects_1) -libgc_la_OBJECTS = $(am_libgc_la_OBJECTS) -libgccpp_la_DEPENDENCIES = -am_libgccpp_la_OBJECTS = gc_cpp.lo -libgccpp_la_OBJECTS = $(am_libgccpp_la_OBJECTS) -@CPLUSPLUS_TRUE@check_PROGRAMS = gctest$(EXEEXT) test_cpp$(EXEEXT) -@CPLUSPLUS_FALSE@check_PROGRAMS = gctest$(EXEEXT) -am_gctest_OBJECTS = test.$(OBJEXT) -gctest_OBJECTS = $(am_gctest_OBJECTS) -gctest_DEPENDENCIES = ./libgc.la -gctest_LDFLAGS = -am_test_cpp_OBJECTS = test_cpp.$(OBJEXT) -test_cpp_OBJECTS = $(am_test_cpp_OBJECTS) -test_cpp_DEPENDENCIES = ./libgc.la ./libgccpp.la -test_cpp_LDFLAGS = -SCRIPTS = $(dist_noinst_SCRIPTS) - - -DEFS = @DEFS@ -DEFAULT_INCLUDES = -I. -I$(srcdir) -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/aix_irix_threads.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/allchblk.Plo ./$(DEPDIR)/alloc.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/backgraph.Plo ./$(DEPDIR)/blacklst.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/checksums.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/darwin_stop_world.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/dbg_mlc.Plo ./$(DEPDIR)/dyn_load.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/finalize.Plo ./$(DEPDIR)/gc_cpp.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/gc_dlopen.Plo ./$(DEPDIR)/gcj_mlc.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/headers.Plo ./$(DEPDIR)/malloc.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/mallocx.Plo ./$(DEPDIR)/mark.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/mark_rts.Plo ./$(DEPDIR)/misc.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/new_hblk.Plo ./$(DEPDIR)/obj_map.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/os_dep.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/pcr_interface.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/pthread_stop_world.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/pthread_support.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/ptr_chck.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/real_malloc.Plo ./$(DEPDIR)/reclaim.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/solaris_pthreads.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/solaris_threads.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/specific.Plo ./$(DEPDIR)/stubborn.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/test.Po ./$(DEPDIR)/test_cpp.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/typd_mlc.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/win32_threads.Plo -CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS) -LTCCASCOMPILE = $(LIBTOOL) --mode=compile $(CCAS) $(AM_CCASFLAGS) \ - $(CCASFLAGS) -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libgc_la_SOURCES) $(EXTRA_libgc_la_SOURCES) \ - $(libgccpp_la_SOURCES) $(gctest_SOURCES) $(test_cpp_SOURCES) -HEADERS = $(dist_noinst_HEADERS) $(include_HEADERS) - - -RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ - uninstall-info-recursive all-recursive install-data-recursive \ - install-exec-recursive installdirs-recursive install-recursive \ - uninstall-recursive check-recursive installcheck-recursive -DIST_COMMON = $(dist_noinst_HEADERS) $(dist_noinst_SCRIPTS) \ - $(include_HEADERS) Makefile.am Makefile.in acinclude.m4 \ - aclocal.m4 config.guess config.sub configure configure.in \ - depcomp install-sh ltmain.sh missing mkinstalldirs -DIST_SUBDIRS = $(SUBDIRS) -SOURCES = $(libgc_la_SOURCES) $(EXTRA_libgc_la_SOURCES) $(libgccpp_la_SOURCES) $(gctest_SOURCES) $(test_cpp_SOURCES) - -all: all-recursive - -.SUFFIXES: -.SUFFIXES: .S .c .cc .lo .o .obj .s - -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) - -$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck -$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) - -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -libLTLIBRARIES_INSTALL = $(INSTALL) -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(libdir) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test -z "$dir" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libgc.la: $(libgc_la_OBJECTS) $(libgc_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libgc_la_LDFLAGS) $(libgc_la_OBJECTS) $(libgc_la_LIBADD) $(LIBS) -libgccpp.la: $(libgccpp_la_OBJECTS) $(libgccpp_la_DEPENDENCIES) - $(CXXLINK) -rpath $(libdir) $(libgccpp_la_LDFLAGS) $(libgccpp_la_OBJECTS) $(libgccpp_la_LIBADD) $(LIBS) - -clean-checkPROGRAMS: - @list='$(check_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -test.$(OBJEXT): tests/test.c -gctest$(EXEEXT): $(gctest_OBJECTS) $(gctest_DEPENDENCIES) - @rm -f gctest$(EXEEXT) - $(LINK) $(gctest_LDFLAGS) $(gctest_OBJECTS) $(gctest_LDADD) $(LIBS) -test_cpp.$(OBJEXT): tests/test_cpp.cc -test_cpp$(EXEEXT): $(test_cpp_OBJECTS) $(test_cpp_DEPENDENCIES) - @rm -f test_cpp$(EXEEXT) - $(CXXLINK) $(test_cpp_LDFLAGS) $(test_cpp_OBJECTS) $(test_cpp_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aix_irix_threads.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allchblk.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backgraph.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blacklst.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checksums.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/darwin_stop_world.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbg_mlc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dyn_load.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finalize.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gc_cpp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gc_dlopen.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gcj_mlc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/headers.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mallocx.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mark.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mark_rts.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/new_hblk.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/obj_map.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os_dep.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcr_interface.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_stop_world.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_support.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptr_chck.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/real_malloc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reclaim.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/solaris_pthreads.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/solaris_threads.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/specific.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stubborn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_cpp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/typd_mlc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/win32_threads.Plo@am__quote@ - -distclean-depend: - -rm -rf ./$(DEPDIR) - -.S.o: - $(CCASCOMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.S.obj: - $(CCASCOMPILE) -c `cygpath -w $<` - -.S.lo: - $(LTCCASCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -.c.o: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c `cygpath -w $<` - -.c.lo: -@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -test.obj: tests/test.c -@AMDEP_TRUE@ source='tests/test.c' object='test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/test.Po' tmpdepfile='$(DEPDIR)/test.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test.obj `cygpath -w tests/test.c` - -test.lo: tests/test.c -@AMDEP_TRUE@ source='tests/test.c' object='test.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/test.Plo' tmpdepfile='$(DEPDIR)/test.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test.lo `test -f 'tests/test.c' || echo '$(srcdir)/'`tests/test.c -CCDEPMODE = @CCDEPMODE@ - -.cc.o: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -.cc.obj: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CXXCOMPILE) -c -o $@ `cygpath -w $<` - -.cc.lo: -@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -test_cpp.obj: tests/test_cpp.cc -@AMDEP_TRUE@ source='tests/test_cpp.cc' object='test_cpp.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/test_cpp.Po' tmpdepfile='$(DEPDIR)/test_cpp.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_cpp.obj `cygpath -w tests/test_cpp.cc` - -test_cpp.lo: tests/test_cpp.cc -@AMDEP_TRUE@ source='tests/test_cpp.cc' object='test_cpp.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/test_cpp.Plo' tmpdepfile='$(DEPDIR)/test_cpp.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_cpp.lo `test -f 'tests/test_cpp.cc' || echo '$(srcdir)/'`tests/test_cpp.cc -CXXDEPMODE = @CXXDEPMODE@ - -.s.o: - $(CCASCOMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.s.obj: - $(CCASCOMPILE) -c `cygpath -w $<` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -includeHEADERS_INSTALL = $(INSTALL_HEADER) -install-includeHEADERS: $(include_HEADERS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(includedir) - @list='$(include_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f"; \ - $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f; \ - done - -uninstall-includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(include_HEADERS)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f $(DESTDIR)$(includedir)/$$f"; \ - rm -f $(DESTDIR)$(includedir)/$$f; \ - done - -# 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. -$(RECURSIVE_TARGETS): - @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; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - 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 - -ETAGS = etags -ETAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(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) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH - -check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; \ - srcdir=$(srcdir); export srcdir; \ - list='$(TESTS)'; \ - if test -n "$$list"; then \ - for tst in $$list; do \ - if test -f ./$$tst; then dir=./; \ - elif test -f $$tst; then dir=; \ - else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *" $$tst "*) \ - xpass=`expr $$xpass + 1`; \ - failed=`expr $$failed + 1`; \ - echo "XPASS: $$tst"; \ - ;; \ - *) \ - echo "PASS: $$tst"; \ - ;; \ - esac; \ - elif test $$? -ne 77; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *" $$tst "*) \ - xfail=`expr $$xfail + 1`; \ - echo "XFAIL: $$tst"; \ - ;; \ - *) \ - failed=`expr $$failed + 1`; \ - echo "FAIL: $$tst"; \ - ;; \ - esac; \ - fi; \ - done; \ - if test "$$failed" -eq 0; then \ - if test "$$xfail" -eq 0; then \ - banner="All $$all tests passed"; \ - else \ - banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ - fi; \ - else \ - if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all tests failed"; \ - else \ - banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ - fi; \ - fi; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes"; \ - test "$$failed" -eq 0; \ - else :; fi -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = . -distdir = $(PACKAGE)-$(VERSION) - -am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } - -GZIP_ENV = --best -distcleancheck_listfiles = find . -type f -print - -distdir: $(DISTFILES) - $(am__remove_distdir) - mkdir $(distdir) - $(mkinstalldirs) $(distdir)/Mac_files $(distdir)/cord $(distdir)/include $(distdir)/tests - @list='$(DISTFILES)'; for file in $$list; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ - distdir) \ - || exit 1; \ - fi; \ - done - -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r $(distdir) -dist-gzip: distdir - $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) - -dist dist-all: distdir - $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - $(am__remove_distdir) - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/=build - mkdir $(distdir)/=inst - chmod a-w $(distdir) - dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ - && cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ - || { echo "ERROR: files left after uninstall:" ; \ - find $$dc_install_base -type f -print ; \ - exit 1; } >&2 ) \ - && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ - && rm -f $(distdir).tar.gz \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck - $(am__remove_distdir) - @echo "$(distdir).tar.gz is ready for distribution" | \ - sed 'h;s/./=/g;p;x;p;x' -distcleancheck: distclean - if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) - $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-recursive -all-am: Makefile $(LTLIBRARIES) $(SCRIPTS) $(HEADERS) -installdirs: installdirs-recursive -installdirs-am: - $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) - -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) -distclean-am: clean-am distclean-compile distclean-depend \ - distclean-generic distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -info: info-recursive - -info-am: - -install-data-am: install-includeHEADERS - -install-exec-am: install-libLTLIBRARIES - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf autom4te.cache -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -uninstall-am: uninstall-includeHEADERS uninstall-info-am \ - uninstall-libLTLIBRARIES - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-TESTS check-am \ - clean clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool clean-recursive dist dist-all dist-gzip distcheck \ - distclean distclean-compile distclean-depend distclean-generic \ - distclean-libtool distclean-recursive distclean-tags \ - distcleancheck distdir dvi dvi-am dvi-recursive info info-am \ - info-recursive install install-am install-data install-data-am \ - install-data-recursive install-exec install-exec-am \ - install-exec-recursive install-includeHEADERS install-info \ - install-info-am install-info-recursive install-libLTLIBRARIES \ - install-man install-recursive install-strip installcheck \ - installcheck-am installdirs installdirs-am \ - installdirs-recursive maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ - tags tags-recursive uninstall uninstall-am \ - uninstall-includeHEADERS uninstall-info-am \ - uninstall-info-recursive uninstall-libLTLIBRARIES \ - uninstall-recursive - - -test.o: $(srcdir)/tests/test.c - $(COMPILE) -c $(srcdir)/tests/test.c -# Using $< in the above seems to fail with the HP/UX on Itanium make. -test_cpp.o: $(srcdir)/tests/test_cpp.cc - $(CXXCOMPILE) -c $(srcdir)/tests/test_cpp.cc -$(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_pthread_redirects.h include/gc_config_macros.h \ -include/gc_mark.h @addincludes@ +pthread_support.@LTO@: $(srcdir)/pthread_support.c + $(CC) $(CFLAGS) -c $(srcdir)/pthread_support.c -.s.lo: - $(LTCOMPILE) -Wp,-P -x assembler-with-cpp -c $< +pthread_stop_world.@LTO@: $(srcdir)/pthread_stop_world.c + $(CC) $(CFLAGS) -c $(srcdir)/pthread_stop_world.c -# -# :GOTCHA: GNU make rule for making .s out of .S is flawed, -# it will not remove dest if building fails -.S.s: - if $(CPP) $< >$@ ; then :; else rm -f $@; fi -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: +darwin_stop_world.@LTO@: $(srcdir)/darwin_stop_world.c + $(CC) $(CFLAGS) -c $(srcdir)/darwin_stop_world.c + +backgraph.@LTO@: $(srcdir)/backgraph.c + $(CC) $(CFLAGS) -c $(srcdir)/backgraph.c + +typd_mlc.@LTO@: $(srcdir)/typd_mlc.c + $(CC) $(CFLAGS) -c $(srcdir)/typd_mlc.c + +ptr_chck.@LTO@: $(srcdir)/ptr_chck.c + $(CC) $(CFLAGS) -c $(srcdir)/ptr_chck.c + +mallocx.@LTO@: $(srcdir)/mallocx.c + $(CC) $(CFLAGS) -c $(srcdir)/mallocx.c + +solaris_pthreads.@LTO@: $(srcdir)/solaris_pthreads.c + $(CC) $(CFLAGS) -c $(srcdir)/solaris_pthreads.c + +gcj_mlc.@LTO@: $(srcdir)/gcj_mlc.c + $(CC) $(CFLAGS) -c $(srcdir)/gcj_mlc.c + +specific.@LTO@: $(srcdir)/specific.c + $(CC) $(CFLAGS) -c $(srcdir)/specific.c + +gc_dlopen.@LTO@: $(srcdir)/gc_dlopen.c + $(CC) $(CFLAGS) -c $(srcdir)/gc_dlopen.c + +dyn_load.@LTO@: $(srcdir)/dyn_load.c + $(CC) $(CFLAGS) -c $(srcdir)/dyn_load.c diff --git a/allchblk.c b/allchblk.c index 793c468b..1ca6d15b 100644 --- a/allchblk.c +++ b/allchblk.c @@ -672,10 +672,13 @@ int n; /* Punt, since anything else risks unreasonable heap growth. */ if (++GC_large_alloc_warn_suppressed >= GC_large_alloc_warn_interval) { + /* PLTSCHEME: rather not see this particular message (or setenv). */ +#if 0 WARN("Repeated allocation of very large block " "(appr. size %ld):\n" "\tMay lead to memory leak and poor performance.\n", size_needed); +#endif GC_large_alloc_warn_suppressed = 0; } size_avail = orig_avail; diff --git a/alloc.c b/alloc.c index 1ac6ff81..5e730f42 100644 --- a/alloc.c +++ b/alloc.c @@ -99,7 +99,7 @@ extern signed_word GC_mem_found; /* Number of reclaimed longwords */ GC_bool GC_dont_expand = 0; -word GC_free_space_divisor = 3; +word GC_free_space_divisor = 4; /* PLTSCHEME: 3 -> 4 */ extern GC_bool GC_collection_in_progress(); /* Collection is in progress, or was abandoned. */ @@ -308,6 +308,9 @@ void GC_maybe_gc() } } +/* PLTSCHEME: notification callback for starting/ending a GC */ +void (*GC_collect_start_callback)(void) = NULL; +void (*GC_collect_end_callback)(void) = NULL; /* * Stop the world garbage collection. Assumes lock held, signals disabled. @@ -321,6 +324,9 @@ GC_stop_func stop_func; CLOCK_TYPE start_time, current_time; # endif if (GC_dont_gc) return FALSE; + /* PLTSCHEME */ + if (GC_collect_start_callback) + GC_collect_start_callback(); if (GC_incremental && GC_collection_in_progress()) { # ifdef CONDPRINT if (GC_print_stats) { @@ -383,6 +389,9 @@ GC_stop_func stop_func; MS_TIME_DIFF(current_time,start_time)); } # endif + /* PLTSCHEME */ + if (GC_collect_end_callback) + GC_collect_end_callback(); return(TRUE); } @@ -963,6 +972,9 @@ word n; return(TRUE); } +/* PLTSCHEME: To report out-of-memory in an app- or platform-specific way. */ +void (*GC_out_of_memory)(void) = NULL; + /* Really returns a bool, but it's externally visible, so that's clumsy. */ /* Arguments is in bytes. */ # if defined(__STDC__) || defined(__cplusplus) @@ -1018,9 +1030,16 @@ GC_bool ignore_off_page; if (!GC_expand_hp_inner(blocks_to_get) && !GC_expand_hp_inner(needed_blocks)) { if (GC_fail_count++ < GC_max_retries) { + /* PLTSCHEME: rather not see this message */ +#if 0 WARN("Out of Memory! Trying to continue ...\n", 0); +#endif GC_gcollect_inner(); } else { + /* PLTSCHEME */ + if (GC_out_of_memory) + GC_out_of_memory(); + # if !defined(AMIGA) || !defined(GC_AMIGA_FASTALLOC) WARN("Out of Memory! Returning NIL!\n", 0); # endif diff --git a/alpha_mach_dep.S b/alpha_mach_dep.S index 53547307..1e0647ac 100644 --- a/alpha_mach_dep.S +++ b/alpha_mach_dep.S @@ -1,4 +1,4 @@ - # $Id: alpha_mach_dep.s,v 1.2 1993/01/18 22:54:51 dosser Exp $ + # $Id: alpha_mach_dep.S,v 1.1 2004/07/21 13:07:52 mflatt Exp $ .arch ev6 .text diff --git a/configure.in b/configure.in index 7914692d..0e1f3ba6 100644 --- a/configure.in +++ b/configure.in @@ -22,7 +22,7 @@ AC_INIT(gc,6.3,Hans.Boehm@hp.com) AC_CONFIG_SRCDIR(gcj_mlc.c) AC_CANONICAL_TARGET AC_PREREQ(2.53) -AC_REVISION($Revision: 1.2 $) +AC_REVISION($Revision: 1.3 $) GC_SET_VERSION AM_INIT_AUTOMAKE diff --git a/cord/de_win.ICO b/cord/de_win.ICO old mode 100755 new mode 100644 diff --git a/digimars.mak b/digimars.mak old mode 100644 new mode 100755 diff --git a/dyn_load.c b/dyn_load.c index 9bd9e060..5d5371ee 100644 --- a/dyn_load.c +++ b/dyn_load.c @@ -1166,6 +1166,12 @@ void GC_init_dyld() { char *bind_fully_env = NULL; if(initialized) return; + + /* PLTSCHEME: not if dls are disabled */ + if (GC_no_dls) { + initialized = TRUE; + return; + } # ifdef DARWIN_DEBUG GC_printf0("Registering dyld callbacks...\n"); diff --git a/finalize.c b/finalize.c index e103228c..e41e341c 100644 --- a/finalize.c +++ b/finalize.c @@ -1,7 +1,6 @@ /* * 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. * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. @@ -16,18 +15,6 @@ # define I_HIDE_POINTERS # include "private/gc_pmark.h" -# ifdef FINALIZE_ON_DEMAND - int GC_finalize_on_demand = 1; -# else - int GC_finalize_on_demand = 0; -# endif - -# ifdef JAVA_FINALIZATION - int GC_java_finalization = 1; -# else - int GC_java_finalization = 0; -# endif - /* Type of mark procedure used for marking from finalizable object. */ /* This procedure normally does not mark the object, only its */ /* descendents. */ @@ -46,6 +33,10 @@ struct hash_chain_entry { unsigned GC_finalization_failures = 0; /* Number of finalization requests that failed for lack of memory. */ +/* PLTSCHEME: */ +void (*GC_custom_finalize)(void); +void (*GC_push_last_roots_again)(void); + static struct disappearing_link { struct hash_chain_entry prolog; # define dl_hidden_link prolog.hidden_key @@ -54,6 +45,16 @@ static struct disappearing_link { # define dl_set_next(x,y) (x) -> prolog.next = (struct hash_chain_entry *)(y) word dl_hidden_obj; /* Pointer to object base */ + + /* PLTSCHEME: for restoring: */ + union { + short kind; +# define NORMAL_DL 0 +# define RESTORE_DL 1 +# define LATE_DL 2 + word value; /* old value when zeroed */ + } dl_special; + struct disappearing_link *restore_next; } **dl_head = 0; static signed_word log_dl_table_size = -1; @@ -76,8 +77,10 @@ static struct finalizable_object { ptr_t fo_client_data; word fo_object_size; /* In bytes. */ finalization_mark_proc * fo_mark_proc; /* Mark-through procedure */ + int eager_level; /* PLTSCHEME: eager finalizers don't care about cycles */ } **fo_head = 0; + struct finalizable_object * GC_finalize_now = 0; /* LIst of objects that should be finalized now. */ @@ -89,8 +92,8 @@ 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)); + + GC_push_all((ptr_t)(&GC_finalize_now), (ptr_t)(&GC_finalize_now) + sizeof(GC_finalize_now)); } /* Double the size of a hash table. *size_ptr is the log of its current */ @@ -150,6 +153,16 @@ signed_word * log_size_ptr; return(GC_general_register_disappearing_link(link, base)); } +/* PLTSCHEME: GC_register_late_disappearing_link */ +static int late_dl; /* a stupid way to pass arguments (to minimize my changes). */ +GC_API void GC_register_late_disappearing_link(void **link, void *obj) +{ + late_dl= 1; + GC_general_register_disappearing_link((GC_PTR *)link, (GC_PTR)obj); + late_dl = 0; +} + + # if defined(__STDC__) || defined(__cplusplus) int GC_general_register_disappearing_link(GC_PTR * link, GC_PTR obj) @@ -165,6 +178,14 @@ signed_word * log_size_ptr; struct disappearing_link * new_dl; DCL_LOCK_STATE; +#if 1 + /* PLTSCHEME: If wxObjects are sometimes stack-allocated, + MrEd needs this. Keeping it for now just-in-case, though + it should be eliminated in the future. */ + if (!GC_base(link)) + return 1; +#endif + if ((word)link & (ALIGNMENT-1)) ABORT("Bad arg to GC_general_register_disappearing_link"); # ifdef THREADS @@ -201,14 +222,14 @@ signed_word * log_size_ptr; } } new_dl = (struct disappearing_link *) - GC_INTERNAL_MALLOC(sizeof(struct disappearing_link),NORMAL); + GC_INTERNAL_MALLOC(sizeof(struct disappearing_link),NORMAL); if (0 == new_dl) { # ifdef THREADS UNLOCK(); ENABLE_SIGNALS(); # endif new_dl = (struct disappearing_link *) - GC_oom_fn(sizeof(struct disappearing_link)); + GC_oom_fn(sizeof(struct disappearing_link)); if (0 == new_dl) { GC_finalization_failures++; return(0); @@ -221,6 +242,7 @@ signed_word * log_size_ptr; } new_dl -> dl_hidden_obj = HIDE_POINTER(obj); new_dl -> dl_hidden_link = HIDE_POINTER(link); + new_dl -> dl_special.kind = late_dl ? LATE_DL : (obj ? NORMAL_DL : RESTORE_DL); /* PLTSCHEME: Set flag */ dl_set_next(new_dl, dl_head[index]); dl_head[index] = new_dl; GC_dl_entries++; @@ -257,11 +279,11 @@ signed_word * log_size_ptr; GC_dl_entries--; UNLOCK(); ENABLE_SIGNALS(); -# ifdef DBG_HDRS_ALL - dl_set_next(curr_dl, 0); -# else - GC_free((GC_PTR)curr_dl); -# endif +# ifdef DBG_HDRS_ALL + dl_set_next(curr_dl, 0); +# else + GC_free((GC_PTR)curr_dl); +# endif return(1); } prev_dl = curr_dl; @@ -275,7 +297,7 @@ out: /* Possible finalization_marker procedures. Note that mark stack */ /* overflow is handled by the caller, and is not a disaster. */ -GC_API void GC_normal_finalize_mark_proc(p) +void GC_normal_finalize_mark_proc(p) ptr_t p; { hdr * hhdr = HDR(p); @@ -287,7 +309,7 @@ ptr_t p; /* This only pays very partial attention to the mark descriptor. */ /* It does the right thing for normal and atomic objects, and treats */ /* most others as normal. */ -GC_API void GC_ignore_self_finalize_mark_proc(p) +void GC_ignore_self_finalize_mark_proc(p) ptr_t p; { hdr * hhdr = HDR(p); @@ -310,7 +332,7 @@ ptr_t p; } /*ARGSUSED*/ -GC_API void GC_null_finalize_mark_proc(p) +void GC_null_finalize_mark_proc(p) ptr_t p; { } @@ -321,17 +343,14 @@ ptr_t p; /* in the nonthreads case, we try to avoid disabling signals, */ /* since it can be expensive. Threads packages typically */ /* make it cheaper. */ -/* The last parameter is a procedure that determines */ -/* marking for finalization ordering. Any objects marked */ -/* by that procedure will be guaranteed to not have been */ -/* finalized when this finalizer is invoked. */ -GC_API void GC_register_finalizer_inner(obj, fn, cd, ofn, ocd, mp) +void GC_register_finalizer_inner(obj, fn, cd, ofn, ocd, mp, eager_level) /* PLTSCHEME: eager_level */ GC_PTR obj; GC_finalization_proc fn; GC_PTR cd; GC_finalization_proc * ofn; GC_PTR * ocd; finalization_mark_proc * mp; +int eager_level; /* PLTSCHEME */ { ptr_t base; struct finalizable_object * curr_fo, * prev_fo; @@ -351,11 +370,9 @@ finalization_mark_proc * mp; # endif GC_grow_table((struct hash_chain_entry ***)(&fo_head), &log_fo_table_size); -# ifdef CONDPRINT - if (GC_print_stats) { +# ifdef PRINTSTATS GC_printf1("Grew fo table to %lu entries\n", (unsigned long)(1 << log_fo_table_size)); - } # endif # ifndef THREADS ENABLE_SIGNALS(); @@ -392,6 +409,7 @@ finalization_mark_proc * mp; curr_fo -> fo_fn = fn; curr_fo -> fo_client_data = (ptr_t)cd; curr_fo -> fo_mark_proc = mp; + curr_fo -> eager_level = eager_level; /* PLTSCHEME */ /* Reinsert it. We deleted it first to maintain */ /* consistency in the event of a signal. */ if (prev_fo == 0) { @@ -412,6 +430,32 @@ finalization_mark_proc * mp; if (ofn) *ofn = 0; if (ocd) *ocd = 0; if (fn == 0) { + + /* PLTSCHEME: */ + /* If this item is already queued, de-queue it. */ +#if 1 + if (GC_finalize_now) { + ptr_t real_ptr; + register struct finalizable_object * curr_fo, *prev_fo; + + prev_fo = NULL; + curr_fo = GC_finalize_now; + while (curr_fo != 0) { + real_ptr = (ptr_t)(curr_fo -> fo_hidden_base); + if (real_ptr == obj) { + if (prev_fo) + fo_set_next(prev_fo, fo_next(curr_fo)); + else + GC_finalize_now = fo_next(curr_fo); + GC_free((GC_PTR)curr_fo); + break; + } + prev_fo = curr_fo; + curr_fo = fo_next(curr_fo); + } + } +#endif + # ifdef THREADS UNLOCK(); ENABLE_SIGNALS(); @@ -428,14 +472,14 @@ finalization_mark_proc * mp; return; } new_fo = (struct finalizable_object *) - GC_INTERNAL_MALLOC(sizeof(struct finalizable_object),NORMAL); + GC_INTERNAL_MALLOC(sizeof(struct finalizable_object),NORMAL); if (0 == new_fo) { # ifdef THREADS UNLOCK(); ENABLE_SIGNALS(); # endif new_fo = (struct finalizable_object *) - GC_oom_fn(sizeof(struct finalizable_object)); + GC_oom_fn(sizeof(struct finalizable_object)); if (0 == new_fo) { GC_finalization_failures++; return; @@ -451,6 +495,7 @@ finalization_mark_proc * mp; new_fo -> fo_client_data = (ptr_t)cd; new_fo -> fo_object_size = hhdr -> hb_sz; new_fo -> fo_mark_proc = mp; + new_fo -> eager_level = eager_level; /* PLTSCHEME */ fo_set_next(new_fo, fo_head[index]); GC_fo_entries++; fo_head[index] = new_fo; @@ -474,7 +519,28 @@ finalization_mark_proc * mp; # endif { GC_register_finalizer_inner(obj, fn, cd, ofn, - ocd, GC_normal_finalize_mark_proc); + ocd, GC_normal_finalize_mark_proc, + 0); /* PLTSCHEME */ +} + +/* PLTSCHEME: eager finalizers */ +# if defined(__STDC__) + void GC_register_eager_finalizer(void * obj, int eager_level, + GC_finalization_proc fn, void * cd, + GC_finalization_proc *ofn, void ** ocd) +# else + void GC_register_eager_finalizer(obj, eager_level, fn, cd, ofn, ocd) + GC_PTR obj; + int eager_level; + GC_finalization_proc fn; + GC_PTR cd; + GC_finalization_proc * ofn; + GC_PTR * ocd; +# endif +{ + GC_register_finalizer_inner(obj, fn, cd, ofn, + ocd, GC_normal_finalize_mark_proc, + eager_level); } # if defined(__STDC__) @@ -491,7 +557,8 @@ finalization_mark_proc * mp; # endif { GC_register_finalizer_inner(obj, fn, cd, ofn, - ocd, GC_ignore_self_finalize_mark_proc); + ocd, GC_ignore_self_finalize_mark_proc, + 0); /* PLTSCHEME */ } # if defined(__STDC__) @@ -508,36 +575,84 @@ finalization_mark_proc * mp; # endif { GC_register_finalizer_inner(obj, fn, cd, ofn, - ocd, GC_null_finalize_mark_proc); + ocd, GC_null_finalize_mark_proc, + 0); /* PLTSCHEME */ } -#ifndef NO_DEBUGGING -void GC_dump_finalization() +/* PLTSCHEME: eager finalization: */ +static void finalize_eagers(int eager_level) { - 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; + struct finalizable_object * curr_fo, * prev_fo, * next_fo; + struct finalizable_object * end_eager_mark; + ptr_t real_ptr; + register int i; + int fo_size = (log_fo_table_size == -1 ) ? 0 : (1 << log_fo_table_size); - 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); + end_eager_mark = GC_finalize_now; /* PLTSCHEME */ + for (i = 0; i < fo_size; i++) { + curr_fo = fo_head[i]; + prev_fo = 0; + while (curr_fo != 0) { + if (curr_fo -> eager_level == eager_level) { + real_ptr = (ptr_t)REVEAL_POINTER(curr_fo -> fo_hidden_base); + if (!GC_is_marked(real_ptr)) { + /* We assume that (non-eager) finalization orders do not + need to take into account connections through memory + with eager finalizations. Otherwise, this mark bit + could break the chain from one (non-eager) finalizeable + to another. */ + GC_set_mark_bit(real_ptr); + + /* Delete from hash table */ + next_fo = fo_next(curr_fo); + if (prev_fo == 0) { + fo_head[i] = next_fo; + } else { + fo_set_next(prev_fo, next_fo); + } + GC_fo_entries--; + /* Add to list of objects awaiting finalization. */ + fo_set_next(curr_fo, GC_finalize_now); + GC_finalize_now = curr_fo; + /* unhide object pointer so any future collections will */ + /* see it. */ + curr_fo -> fo_hidden_base = + (word) REVEAL_POINTER(curr_fo -> fo_hidden_base); + 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; + curr_fo = fo_next(curr_fo); + } + } else { + prev_fo = curr_fo; + curr_fo = fo_next(curr_fo); } } - 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); + } + + /* PLTSCHEME: Mark from queued eagers: */ + for (curr_fo = GC_finalize_now; curr_fo != end_eager_mark; curr_fo = fo_next(curr_fo)) { + /* PLTSCHEME: if this is an eager finalization, then objects + accessible from real_ptr need to be marked */ + if (curr_fo -> eager_level == eager_level) { + (*(curr_fo -> fo_mark_proc))(curr_fo -> fo_hidden_base); + while (!GC_mark_stack_empty()) MARK_FROM_MARK_STACK(); + if (GC_mark_state != MS_NONE) { + /* Mark stack overflowed. Very unlikely. + Everything's ok, though. Just mark from scratch. */ + while (!GC_mark_some((ptr_t)0)); } } + } } -#endif /* Called with world stopped. Cause disappearing links to disappear, */ /* and invoke finalizers. */ @@ -549,58 +664,116 @@ void GC_finalize() register int i; 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); - - /* Make disappearing links disappear */ + /* PLTSCHEME: for resetting the disapearing link */ + struct disappearing_link *done_dl = NULL, *last_done_dl = NULL; + + /* Make disappearing links disappear */ + /* PLTSCHEME: handle NULL real_link and remember old values */ for (i = 0; i < dl_size; i++) { curr_dl = dl_head[i]; prev_dl = 0; while (curr_dl != 0) { - real_ptr = (ptr_t)REVEAL_POINTER(curr_dl -> dl_hidden_obj); + /* PLTSCHEME: skip late dls: */ + if (curr_dl->dl_special.kind == LATE_DL) { + prev_dl = curr_dl; + curr_dl = dl_next(curr_dl); + continue; + } + /* PLTSCHEME: reorder and set real_ptr based on real_link: */ real_link = (ptr_t)REVEAL_POINTER(curr_dl -> dl_hidden_link); - if (!GC_is_marked(real_ptr)) { - *(word *)real_link = 0; - next_dl = dl_next(curr_dl); - if (prev_dl == 0) { - dl_head[i] = next_dl; - } else { - dl_set_next(prev_dl, next_dl); - } - GC_clear_mark_bit((ptr_t)curr_dl); - GC_dl_entries--; - curr_dl = next_dl; - } else { + real_ptr = (ptr_t)REVEAL_POINTER(curr_dl -> dl_hidden_obj); + if (!real_ptr) + real_ptr = (ptr_t)GC_base(*(GC_PTR *)real_link); + /* PLTSCHEME: keep the dl entry if dl_special.kind = 1: */ + if (real_ptr && !GC_is_marked(real_ptr)) { + int needs_restore = (curr_dl->dl_special.kind == RESTORE_DL); + if (needs_restore) + curr_dl->dl_special.value = *(word *)real_link; + *(word *)real_link = 0; + + next_dl = dl_next(curr_dl); + + if (needs_restore && curr_dl->dl_special.value) { + if (!last_done_dl) + done_dl = curr_dl; + else + last_done_dl->restore_next = curr_dl; + last_done_dl = curr_dl; + } else { + if (prev_dl == 0) + dl_head[i] = next_dl; + else + dl_set_next(prev_dl, next_dl); + + GC_clear_mark_bit((ptr_t)curr_dl); + GC_dl_entries--; + } + curr_dl = next_dl; + } else { prev_dl = curr_dl; curr_dl = dl_next(curr_dl); } } } + + /* PLTSCHEME: set NULL terminator: */ + if (last_done_dl) + last_done_dl->restore_next = NULL; + + /* PLTSCHEME: All eagers first */ + /* Enqueue for finalization all EAGER objects that are still */ + /* unreachable. */ + GC_words_finalized = 0; + finalize_eagers(1); + if (GC_push_last_roots_again) GC_push_last_roots_again(); + finalize_eagers(2); + if (GC_push_last_roots_again) GC_push_last_roots_again(); + /* Mark all objects reachable via chains of 1 or more pointers */ /* from finalizable objects. */ + /* PLTSCHEME: non-eager finalizations only (eagers already marked) */ +# ifdef PRINTSTATS GC_ASSERT(GC_mark_state == MS_NONE); +# 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); - if (!GC_is_marked(real_ptr)) { - GC_MARKED_FOR_FINALIZATION(real_ptr); - GC_MARK_FO(real_ptr, curr_fo -> fo_mark_proc); + if (!(curr_fo -> eager_level)) { /* PLTSCHEME */ + real_ptr = (ptr_t)REVEAL_POINTER(curr_fo -> fo_hidden_base); + if (!GC_is_marked(real_ptr)) { + (*(curr_fo -> fo_mark_proc))(real_ptr); + while (!GC_mark_stack_empty()) MARK_FROM_MARK_STACK(); + if (GC_mark_state != MS_NONE) { + /* Mark stack overflowed. Very unlikely. */ +# ifdef PRINTSTATS + if (GC_mark_state != MS_INVALID) ABORT("Bad mark state"); + GC_printf0("Mark stack overflowed in finalization!!\n"); +# endif + /* Make mark bits consistent again. Forget about */ + /* finalizing this object for now. */ + GC_set_mark_bit(real_ptr); + while (!GC_mark_some((ptr_t)0)); + } +#if 0 if (GC_is_marked(real_ptr)) { - WARN("Finalization cycle involving %lx\n", real_ptr); + /* PLTSCHEME: we have some ok cycles (below a parent) */ + printf("Finalization cycle involving %lx\n", real_ptr); } - } +#endif + } + } } } /* Enqueue for finalization all objects that are still */ /* unreachable. */ - GC_words_finalized = 0; + /* GC_words_finalized = 0; */ /* PLTSCHEME: done above */ for (i = 0; i < fo_size; i++) { curr_fo = fo_head[i]; prev_fo = 0; while (curr_fo != 0) { real_ptr = (ptr_t)REVEAL_POINTER(curr_fo -> fo_hidden_base); if (!GC_is_marked(real_ptr)) { - if (!GC_java_finalization) { - GC_set_mark_bit(real_ptr); - } + GC_set_mark_bit(real_ptr); + /* Delete from hash table */ next_fo = fo_next(curr_fo); if (prev_fo == 0) { @@ -619,7 +792,6 @@ void GC_finalize() 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; @@ -628,22 +800,18 @@ void GC_finalize() } } - if (GC_java_finalization) { - /* make sure we mark everything reachable from objects finalized - using the no_order mark_proc */ - for (curr_fo = GC_finalize_now; - curr_fo != NULL; curr_fo = fo_next(curr_fo)) { - real_ptr = (ptr_t)curr_fo -> fo_hidden_base; - if (!GC_is_marked(real_ptr)) { - if (curr_fo -> fo_mark_proc == GC_null_finalize_mark_proc) { - GC_MARK_FO(real_ptr, GC_normal_finalize_mark_proc); - } - GC_set_mark_bit(real_ptr); - } - } - } + /* PLTSCHEME: Restore disappeared links. */ + curr_dl = done_dl; + while (curr_dl != 0) { + real_link = (ptr_t)REVEAL_POINTER(curr_dl -> dl_hidden_link); + *(word *)real_link = curr_dl->dl_special.value; + curr_dl->dl_special.kind = RESTORE_DL; + prev_dl = curr_dl; + curr_dl = curr_dl->restore_next; + prev_dl->restore_next = NULL; + } - /* Remove dangling disappearing links. */ + /* Remove dangling disappearing links. */ for (i = 0; i < dl_size; i++) { curr_dl = dl_head[i]; prev_dl = 0; @@ -665,9 +833,49 @@ void GC_finalize() } } } + + /* PLTSCHEME: late disappearing links */ + for (i = 0; i < dl_size; i++) { + curr_dl = dl_head[i]; + prev_dl = 0; + while (curr_dl != 0) { + if (curr_dl -> dl_special.kind == LATE_DL) { + /* PLTSCHEME: reorder and set real_ptr based on real_link: */ + real_link = (ptr_t)REVEAL_POINTER(curr_dl -> dl_hidden_link); + real_ptr = (ptr_t)REVEAL_POINTER(curr_dl -> dl_hidden_obj); + if (!real_ptr) + real_ptr = (ptr_t)GC_base(*(GC_PTR *)real_link); + if (real_ptr && !GC_is_marked(real_ptr)) { + *(word *)real_link = 0; + + next_dl = dl_next(curr_dl); + + if (prev_dl == 0) + dl_head[i] = next_dl; + else + dl_set_next(prev_dl, next_dl); + + GC_clear_mark_bit((ptr_t)curr_dl); + GC_dl_entries--; + + curr_dl = next_dl; + } else { + prev_dl = curr_dl; + curr_dl = dl_next(curr_dl); + } + } else { + prev_dl = curr_dl; + curr_dl = dl_next(curr_dl); + } + } + } + + /* PLTSCHEME: */ + if (GC_custom_finalize) + GC_custom_finalize(); } -#ifndef JAVA_FINALIZATION_NOT_NEEDED +#ifdef JAVA_FINALIZATION /* Enqueue all remaining finalizers to be run - Assumes lock is * held, and signals are disabled */ @@ -722,15 +930,10 @@ void GC_enqueue_all_finalizers() * Unfortunately, the Java standard implies we have to keep running * finalizers until there are no more left, a potential infinite loop. * YUCK. - * Note that this is even more dangerous than the usual Java - * finalizers, in that objects reachable from static variables - * may have been finalized when these finalizers are run. - * Finalizers run at this point must be prepared to deal with a - * mostly broken world. * This routine is externally callable, so is called without * the allocation lock. */ -GC_API void GC_finalize_all() +void GC_finalize_all() { DCL_LOCK_STATE; @@ -749,22 +952,20 @@ GC_API void GC_finalize_all() } #endif -/* Returns true if it is worth calling GC_invoke_finalizers. (Useful if */ -/* finalizers can only be called from some kind of `safe state' and */ -/* getting into that safe state is expensive.) */ -int GC_should_invoke_finalizers GC_PROTO((void)) -{ - return GC_finalize_now != 0; -} - /* Invoke finalizers for all objects that are ready to be finalized. */ /* Should be called without allocation lock. */ int GC_invoke_finalizers() { + static int doing = 0; /* PLTSCHEME */ struct finalizable_object * curr_fo; int count = 0; word mem_freed_before; DCL_LOCK_STATE; + + /* PLTSCHEME: don't allow nested finalizations */ + if (doing) + return 0; + doing++; while (GC_finalize_now != 0) { # ifdef THREADS @@ -795,6 +996,9 @@ int GC_invoke_finalizers() GC_free((GC_PTR)curr_fo); # endif } + + doing--; /* PLTSCHEME */ + if (count != 0 && mem_freed_before != GC_mem_freed) { LOCK(); GC_finalizer_mem_freed += (GC_mem_freed - mem_freed_before); @@ -839,7 +1043,7 @@ void GC_notify_or_invoke_finalizers GC_PROTO((void)) } # endif if (GC_finalize_now == 0) return; - if (!GC_finalize_on_demand) { + { (void) GC_invoke_finalizers(); # ifndef THREADS GC_ASSERT(GC_finalize_now == 0); @@ -895,3 +1099,16 @@ void GC_print_finalization_stats() } #endif /* NO_DEBUGGING */ + + +/* PLTSCHEME: GC_register_fnl_statics */ +/* See call in GC_init_inner (misc.c) for details. */ +void GC_register_fnl_statics(void) +{ +#define REG(p) GC_add_roots_inner((char *)&p, ((char *)&p) + sizeof(p) + 1, FALSE); + + REG(GC_finalize_now); + REG(GC_fo_entries); + REG(dl_head); + REG(fo_head); +} diff --git a/gc.h b/gc.h new file mode 100644 index 00000000..4a5b696d --- /dev/null +++ b/gc.h @@ -0,0 +1,3 @@ + +/* PLTSCHEME: stub for old paths: */ +#include "include/gc.h" diff --git a/include/gc.h b/include/gc.h index 2a890091..8f3e3432 100644 --- a/include/gc.h +++ b/include/gc.h @@ -683,6 +683,16 @@ GC_API void GC_debug_register_finalizer_no_order GC_finalization_proc *ofn, GC_PTR *ocd)); +/* PLTSCHEME: eager finalizers do not care about cycles at all. + The intent is for guardian-like and will-like uses where + the object will always be made immediately live again, but + some action needed to be triggered by the object's (possibly + temporary) unreachableness. */ +GC_API void GC_register_eager_finalizer + GC_PROTO((GC_PTR obj, int eager_level, + 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 */ @@ -937,6 +947,8 @@ extern void GC_thr_init(); /* Needed for Solaris/X86 */ * from the statically loaded program section. * This circumvents a Solaris 2.X (X<=4) linker bug. */ +/* PLTSCHEME: "extern" provided by Matthew.R.Wette@jpl.nasa.gov: */ +extern void GC_noop(void *p, ...); # define GC_INIT() { extern end, etext; \ GC_noop(&end, &etext); } #else @@ -972,6 +984,19 @@ extern void GC_thr_init(); /* Needed for Solaris/X86 */ # include "gc_local_alloc.h" #endif +/* PLTSCHEME: */ +GC_API void (*GC_custom_finalize)(void); +GC_API void (*GC_push_last_roots)(void); +GC_API void (*GC_push_last_roots_again)(void); +GC_API void (*GC_collect_start_callback)(void); +GC_API void (*GC_collect_end_callback)(void); +GC_API void (*GC_out_of_memory)(void); +GC_API int GC_did_mark_stack_overflow(void); +GC_API void GC_mark_from_mark_stack(void); +GC_API void GC_flush_mark_stack(void); +GC_API long GC_get_memory_use(void); +GC_API void GC_pre_init(void); + #ifdef __cplusplus } /* end of extern "C" */ #endif diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h index d8d31141..db4b6011 100644 --- a/include/gc_config_macros.h +++ b/include/gc_config_macros.h @@ -137,7 +137,8 @@ # endif #endif -#if defined(__WATCOMC__) && defined(GC_DLL) +/* PLTSCHEME: Borland and Cygwin, too */ +#if (defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__CYGWIN32__)) && defined(GC_DLL) # ifdef GC_BUILD # define GC_API extern __declspec(dllexport) # else diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 08dd8ea2..c28ecfa0 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -107,7 +107,8 @@ typedef char * ptr_t; /* A generic pointer to which we can add */ # define MAKE_HOTTER(x,y) (x) += (y) # endif -#if defined(AMIGA) && defined(__SASC) +/* PLTSCHEME: Always put GC_FAR as far data for Mac 68k */ +#if defined(__MC68K__) || (defined(AMIGA) && defined(__SASC)) # define GC_FAR __far #else # define GC_FAR @@ -1317,7 +1318,8 @@ void GC_push_selected GC_PROTO(( \ #endif /* Do either of the above, depending */ /* on the third arg. */ -void GC_push_all_stack GC_PROTO((ptr_t b, ptr_t t)); +/* PLTSCHEME: GC_API */ +GC_API void GC_push_all_stack GC_PROTO((ptr_t b, ptr_t t)); /* As above, but consider */ /* interior pointers as valid */ void GC_push_all_eager GC_PROTO((ptr_t b, ptr_t t)); @@ -1347,7 +1349,8 @@ void GC_push_current_stack GC_PROTO((ptr_t cold_gc_frame)); /* stack for scanning. */ void GC_push_roots GC_PROTO((GC_bool all, ptr_t cold_gc_frame)); /* Push all or dirty roots. */ -extern void (*GC_push_other_roots) GC_PROTO((void)); +/* PLTSCHEME: GC_API */ +GC_API void (*GC_push_other_roots) GC_PROTO((void)); /* Push system or application specific roots */ /* onto the mark stack. In some environments */ /* (e.g. threads environments) this is */ @@ -1360,8 +1363,9 @@ extern void GC_push_gc_structures GC_PROTO((void)); /* Thus implicitly pushed. But we must do this */ /* explicitly if normal root processing is */ /* disabled. Calls the following: */ - extern void GC_push_finalizer_structures GC_PROTO((void)); - extern void GC_push_stubborn_structures GC_PROTO((void)); +/* PLTSCHEME: GC_API */ + GC_API void GC_push_finalizer_structures GC_PROTO((void)); + GC_API void GC_push_stubborn_structures GC_PROTO((void)); # ifdef THREADS extern void GC_push_thread_structures GC_PROTO((void)); # endif @@ -1447,9 +1451,10 @@ GC_bool GC_register_main_static_data GC_PROTO((void)); /* dynamic library registration. */ /* Machine dependent startup routines */ -ptr_t GC_get_stack_base GC_PROTO((void)); /* Cold end of stack */ +/* PLTSCHEME: GC_API (IA64, too) */ +GC_API ptr_t GC_get_stack_base GC_PROTO((void)); /* Cold end of stack */ #ifdef IA64 - ptr_t GC_get_register_stack_base GC_PROTO((void)); + GC_API ptr_t GC_get_register_stack_base GC_PROTO((void)); /* Cold end of register stack. */ #endif void GC_register_data_segments GC_PROTO((void)); @@ -1717,7 +1722,7 @@ extern GC_bool GC_print_stats; /* Produce at least some logging output */ /* Set from environment variable. */ #ifndef NO_DEBUGGING - extern GC_bool GC_dump_regularly; /* Generate regular debugging dumps. */ +extern GC_bool GC_dump_regularly; /* Generate regular debugging dumps. */ # define COND_DUMP if (GC_dump_regularly) GC_dump(); #else # define COND_DUMP @@ -1799,7 +1804,8 @@ void GC_print_hblkfreelist GC_PROTO((void)); void GC_print_heap_sects GC_PROTO((void)); void GC_print_static_roots GC_PROTO((void)); void GC_print_finalization_stats GC_PROTO((void)); -void GC_dump GC_PROTO((void)); +/* PLTSCHEME: GC_API */ +GC_API void GC_dump GC_PROTO((void)); #ifdef KEEP_BACK_PTRS void GC_store_back_pointer(ptr_t source, ptr_t dest); diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 94b446b6..94a680f0 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -271,7 +271,8 @@ # define MACOS # define mach_type_known # endif -# if defined(__MWERKS__) && defined(__powerc) && !defined(__MACH__) +/* PLTSCHEME: added MPW_C */ +# if (defined(__MWERKS__) || defined(MPW_C)) && defined(__powerc) && !defined(__MACH__) # define POWERPC # define MACOS # define mach_type_known @@ -705,6 +706,12 @@ # define GETPAGESIZE() 4096 # endif # ifdef MACOS + /* PLTSCHEME: 4-byte alignment */ +# ifdef USE_POWERPC_FOUR_BYTE_ALIGN +# define ALIGNMENT 4 +# else +# define ALIGNMENT 2 +# endif # ifndef __LOWMEM__ # include # endif diff --git a/mallocx.c b/mallocx.c index d45f21e8..29dd560f 100644 --- a/mallocx.c +++ b/mallocx.c @@ -28,6 +28,9 @@ extern ptr_t GC_clear_stack(); /* in misc.c, behaves like identity */ void GC_extend_size_map(); /* in misc.c. */ GC_bool GC_alloc_reclaim_list(); /* in malloc.c */ +/* PLTSCHEME: For MSVC /MD Compilation */ +#ifndef USE_MSVC_MD_LIBRARY + /* Some externally visible but unadvertised variables to allow access to */ /* free lists from inlined allocators without including gc_priv.h */ /* or introducing dependencies on internal data structure layouts. */ @@ -38,6 +41,7 @@ ptr_t * GC_CONST GC_uobjfreelist_ptr = GC_uobjfreelist; ptr_t * GC_CONST GC_auobjfreelist_ptr = GC_auobjfreelist; # endif +#endif /* PLTSCHEME: GC_MSVC_MD_LIBRARY */ GC_PTR GC_generic_or_special_malloc(lb,knd) word lb; diff --git a/mark.c b/mark.c index c645bc0e..3d541a00 100644 --- a/mark.c +++ b/mark.c @@ -44,30 +44,66 @@ word x; word GC_n_mark_procs = GC_RESERVED_MARK_PROCS; +/* PLTSCHEME: To work with MSVC /MD flag. Client must call GC_pre_init(). */ +#ifdef USE_MSVC_MD_LIBRARY +# define INIT_FLD(x) 0 +#else +# define INIT_FLD(x) x +#endif + /* Initialize GC_obj_kinds properly and standard free lists properly. */ /* This must be done statically since they may be accessed before */ /* GC_init is called. */ /* It's done here, since we need to deal with mark descriptors. */ struct obj_kind GC_obj_kinds[MAXOBJKINDS] = { -/* PTRFREE */ { &GC_aobjfreelist[0], 0 /* filled in dynamically */, +/* PTRFREE */ { INIT_FLD(&GC_aobjfreelist[0]), 0 /* filled in dynamically */, 0 | GC_DS_LENGTH, FALSE, FALSE }, -/* NORMAL */ { &GC_objfreelist[0], 0, +/* NORMAL */ { INIT_FLD(&GC_objfreelist[0]), 0, 0 | GC_DS_LENGTH, /* Adjusted in GC_init_inner for EXTRA_BYTES */ TRUE /* add length to descr */, TRUE }, /* UNCOLLECTABLE */ - { &GC_uobjfreelist[0], 0, + { INIT_FLD(&GC_uobjfreelist[0]), 0, 0 | GC_DS_LENGTH, TRUE /* add length to descr */, TRUE }, # ifdef ATOMIC_UNCOLLECTABLE /* AUNCOLLECTABLE */ - { &GC_auobjfreelist[0], 0, + { INIT_FLD(&GC_auobjfreelist[0]), 0, 0 | GC_DS_LENGTH, FALSE /* add length to descr */, FALSE }, # endif # ifdef STUBBORN_ALLOC -/*STUBBORN*/ { &GC_sobjfreelist[0], 0, +/*STUBBORN*/ { INIT_FLD(&GC_sobjfreelist[0]), 0, 0 | GC_DS_LENGTH, TRUE /* add length to descr */, TRUE }, # endif }; +/* PLTSCHEME: explicit init proc */ +#ifdef USE_MSVC_MD_LIBRARY +# ifdef __CYGWIN32__ +# include +# endif +void GC_pre_init(void) +{ + int i = 0; + GC_obj_kinds[i++].ok_freelist = &GC_aobjfreelist[0]; + GC_obj_kinds[i++].ok_freelist = &GC_objfreelist[0]; + GC_obj_kinds[i++].ok_freelist = &GC_uobjfreelist[0]; +# ifdef ATOMIC_UNCOLLECTABLE + GC_obj_kinds[i++].ok_freelist = &GC_auobjfreelist[0]; +# endif +# ifdef STUBBORN_ALLOC + GC_obj_kinds[i++].ok_freelist = &GC_sobjfreelist[0]; +# endif +} + +# ifdef MD_LIB_MAIN +BOOL WINAPI DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved) +{ + if (reason == DLL_PROCESS_ATTACH) + GC_pre_init(); + return TRUE; +} +# endif +#endif + # ifdef ATOMIC_UNCOLLECTABLE # ifdef STUBBORN_ALLOC int GC_n_kinds = 5; @@ -595,6 +631,17 @@ mse * msp; return(msp - GC_MARK_STACK_DISCARDS); } +/* PLTSCHEME: used by setjmpup: */ +int GC_did_mark_stack_overflow(void) +{ + return GC_mark_state == MS_INVALID; +} +void GC_mark_from_mark_stack(void) +{ + MARK_FROM_MARK_STACK(); +} + + /* * Mark objects pointed to by the regions described by * mark stack entries between GC_mark_stack and GC_mark_stack_top, diff --git a/mark_rts.c b/mark_rts.c index 55eb5d54..3ac02057 100644 --- a/mark_rts.c +++ b/mark_rts.c @@ -38,6 +38,9 @@ static int n_root_sets = 0; /* GC_static_roots[0..n_root_sets) contains the valid root sets. */ +/* PLTSCHEME: hook for last roots; need to mark copies of the stack */ +void (*GC_push_last_roots)() = 0; + # if !defined(NO_DEBUGGING) /* For debugging: */ void GC_print_static_roots() @@ -175,7 +178,8 @@ GC_bool tmp; { struct roots * old; -# if defined(MSWIN32) || defined(MSWINCE) +/* PLTSCHEME: always merge overlapping: */ +# if 1 || defined(MSWIN32) || defined(MSWINCE) /* Spend the time to ensure that there are no overlapping */ /* or adjacent intervals. */ /* This could be done faster with e.g. a */ @@ -187,7 +191,8 @@ GC_bool tmp; for (i = 0; i < n_root_sets; i++) { old = GC_static_roots + i; - if ((ptr_t)b <= old -> r_end && (ptr_t)e >= old -> r_start) { + if ((ptr_t)b <= old -> r_end && (ptr_t)e >= old -> r_start + && tmp == old -> r_tmp) { /* PLTSCHEME: merge only same kinds */ if ((ptr_t)b < old -> r_start) { old -> r_start = (ptr_t)b; GC_root_size += (old -> r_start - (ptr_t)b); @@ -208,7 +213,9 @@ GC_bool tmp; other = GC_static_roots + i; b = (char *)(other -> r_start); e = (char *)(other -> r_end); - if ((ptr_t)b <= old -> r_end && (ptr_t)e >= old -> r_start) { + tmp = other -> r_tmp; /* PLTSCHEME */ + if ((ptr_t)b <= old -> r_end && (ptr_t)e >= old -> r_start + && tmp == old -> r_tmp) { /* PLTSCHEME: merge only same kinds */ if ((ptr_t)b < old -> r_start) { old -> r_start = (ptr_t)b; GC_root_size += (old -> r_start - (ptr_t)b); @@ -645,5 +652,13 @@ ptr_t cold_gc_frame; /* Note that without interior pointer recognition lots */ /* of stuff may have been pushed already, and this */ /* should be careful about mark stack overflows. */ + /* PLTSCHEME: hook for last roots; need to mark copies of the stack */ + if (GC_push_last_roots != 0) (*GC_push_last_roots)(); } + +/* PLTSCHEME */ +void GC_flush_mark_stack() +{ + while (!GC_mark_stack_empty()) GC_mark_from_mark_stack(); +} diff --git a/misc.c b/misc.c index 5b10feeb..a7f91873 100644 --- a/misc.c +++ b/misc.c @@ -713,8 +713,16 @@ void GC_init_inner() # endif GC_ASSERT((signed_word)(-1) < (signed_word)0); + /* PLTSCHEME: In case we use near data for 68k Mac, this array is declared FAR */ +#ifdef __MC68K__ + GC_add_roots_inner((ptr_t)&GC_arrays, + (ptr_t)(((char *)&GC_arrays) + sizeof(GC_arrays)), + FALSE); +#endif + /* Add initial guess of root sets. Do this first, since sbrk(0) */ /* might be used. */ + if (!GC_no_dls) /* PLTSCHEME: hack */ if (GC_REGISTER_MAIN_STATIC_DATA()) GC_register_data_segments(); GC_init_headers(); GC_bl_init(); @@ -1054,7 +1062,7 @@ void GC_abort(msg) GC_CONST char * msg; { # if defined(MSWIN32) - (void) MessageBoxA(NULL, msg, "Fatal error in gc", MB_ICONERROR|MB_OK); + //(void) MessageBoxA(NULL, msg, "Fatal error in gc", MB_ICONERROR|MB_OK); # else GC_err_printf1("%s\n", msg); # endif @@ -1173,3 +1181,23 @@ void GC_dump() } #endif /* NO_DEBUGGING */ + +/* PLTSCHEME: GC_get_memory_use */ +static void get_size(struct hblk *h, word lptr) +{ + hdr *hhdr = HDR(h); + long bytes = WORDS_TO_BYTES(hhdr->hb_sz); + + bytes += HBLKSIZE-1; + bytes &= ~(HBLKSIZE-1); + + *(long *)lptr += bytes; +} +long GC_get_memory_use() +{ + long c = 0; + LOCK(); + GC_apply_to_all_blocks(get_size, (word)&c); + UNLOCK(); + return c; +} diff --git a/mkinstalldirs b/mkinstalldirs index f9c37afd..d917e777 100755 --- a/mkinstalldirs +++ b/mkinstalldirs @@ -4,7 +4,7 @@ # Created: 1993-05-16 # Public domain -# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ +# $Id: mkinstalldirs,v 1.2 2004/07/21 13:07:55 mflatt Exp $ errstatus=0 dirmode="" diff --git a/os_dep.c b/os_dep.c index 21d05635..35dbfc0c 100644 --- a/os_dep.c +++ b/os_dep.c @@ -645,12 +645,19 @@ word GC_get_writable_length(ptr_t p, ptr_t *base) ptr_t GC_get_stack_base() { + /* PLTSCHEME: set page size if it's not ready (so I can use this + function before a GC happens). */ + if (!GC_page_size) GC_setpagesize(); + { + int dummy; ptr_t sp = (ptr_t)(&dummy); ptr_t trunc_sp = (ptr_t)((word)sp & ~(GC_page_size - 1)); word size = GC_get_writable_length(trunc_sp, 0); return(trunc_sp + size); + + } /* PLTSCHEME: close brace */ } @@ -1565,6 +1572,13 @@ ptr_t GC_unix_get_mem(bytes) word bytes; { void *result; + /* PLTSCHEME: make sure HEAP_START and MAP_FAILED are defined: */ +#if !defined(HEAP_START) +# define HEAP_START 0 +#endif +#if !defined(MAP_FAILED) +# define MAP_FAILED ((void *)-1) +#endif static ptr_t last_addr = HEAP_START; # ifndef USE_MMAP_ANON @@ -1602,6 +1616,18 @@ word bytes; ptr_t GC_unix_get_mem(bytes) word bytes; { + /* PLTSCHEME: The SunOS4 man page says not use to sbrk() with malloc(). + Xt definitely breaks in SunOS 4.x if I use sbrk. */ +#if defined(sun) + ptr_t mem; + + mem = malloc(bytes + HBLKSIZE - 1); + + if ((long)mem % HBLKSIZE) + return mem + (HBLKSIZE - ((long)mem % HBLKSIZE)); + else + return mem; +#else /* PLTSCHEME: end malloc() */ ptr_t result; # ifdef IRIX5 /* Bare sbrk isn't thread safe. Play by malloc rules. */ @@ -1623,6 +1649,7 @@ word bytes; __UNLOCK_MALLOC(); # endif return(result); +#endif /* PLTSCHEME: close */ } #endif /* Not USE_MMAP */ @@ -1682,9 +1709,10 @@ word bytes; /* This wastes a small amount of memory, and risks */ /* increased fragmentation. But better alternatives */ /* would require effort. */ + /* PLTSCHEME: PAGE_READWRITE works better for MrEd (because I don't need execute?) */ result = (ptr_t) VirtualAlloc(NULL, bytes + 1, MEM_COMMIT | MEM_RESERVE, - PAGE_EXECUTE_READWRITE); + PAGE_READWRITE); } if (HBLKDISPL(result) != 0) ABORT("Bad VirtualAlloc result"); /* If I read the documentation correctly, this can */ @@ -2933,7 +2961,8 @@ word len; /* to the write-protected heap with a system call. */ /* This still serves as sample code if you do want to wrap system calls.*/ -#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(GC_USE_LD_WRAP) +/* PLTSCHEME: no read() redefinition for MacOS X */ +#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(GC_USE_LD_WRAP) && !defined(DARWIN) /* Replacement for UNIX system call. */ /* Other calls that write to the heap should be handled similarly. */ /* Note that this doesn't work well for blocking reads: It will hold */ @@ -3505,7 +3534,10 @@ static void *GC_mprotect_thread(void *arg) { mach_msg_id_t id; + /* PLTSCHEME: only needed when THREADS? */ +#if defined(THREADS) GC_darwin_register_mach_handler_thread(mach_thread_self()); +#endif for(;;) { r = mach_msg( diff --git a/win32_threads.c b/win32_threads.c old mode 100755 new mode 100644 -- 2.50.1