# interception can be used on a few platforms.
# -DGC_THREADS should set the appropriate one of the below macros,
# except -DGC_WIN32_PTHREADS, which must be set explicitly.
-# -DGC_SOLARIS_PTHREADS enables support for Solaris pthreads.
-# (Clients should also define GC_SOLARIS_THREADS and then include
-# gc.h before performing thr_ or dl* or GC_ operations.)
+# -DGC_SOLARIS_THREADS enables support for Solaris pthreads.
# Must also define -D_REENTRANT.
# -DGC_IRIX_THREADS enables support for Irix pthreads. See README.irix.
# -DGC_HPUX_THREADS enables support for HP/UX 11 pthreads.
# cache footprint. Normally it is best to let this decision be
# made automatically depending on platform.
# -DMARK_BIT_PER_OBJ requests that a mark bit be allocated for each
-# object instead of allocation granule. The opposiet of
+# object instead of allocation granule. The opposite of
# MARK_BIT_PER_GRANULE.
# -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
# 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.
+# Works for Linux, FreeBSD, Cygwin, 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.
+# circumstances. This currently disables VM-based incremental collection
+# (except for Win32 with GetWriteWatch available).
+# Works under some Unix, Linux and Windows versions.
+# Requires -DUSE_MMAP except for Windows.
# -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
+# value of the near-bogus-pointer. Can be used to identify 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
# 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=<n> 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
# -DCHECKSUMS reports on erroneously clear dirty bits, and unexpectedly
# altered stubborn objects, at substantial performance cost.
# Use only for debugging of the incremental collector.
+# Not compatible with USE_MUNMAP or threads.
# -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.
# -DTHREAD_LOCAL_ALLOC defines GC_malloc(), GC_malloc_atomic()
# and GC_gcj_malloc() to use a per-thread set of free-lists.
# These then allocate in a way that usually does not involve
-# acquisition of a global lock. Currently supported only on platforms
-# such as Linux that use pthread_support.c. Recommended for multiprocessors.
+# acquisition of a global lock. Recommended for multiprocessors.
# Requires explicit GC_INIT() call, unless REDIRECT_MALLOC is
# defined and GC_malloc is used first.
# -DUSE_COMPILER_TLS causes thread local allocation to use compiler-supported
# 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.
+# for multiprocessors.
# -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
# for applications that don't support proper stack unwinding.
# -DUSE_PROC_FOR_LIBRARIES Causes the Linux collector to treat writable
# memory mappings (as reported by /proc) as roots, if it doesn't have
-# otherinformation about them. It no longer traverses dynamic loader
+# other information about them. It no longer traverses dynamic loader
# data structures to find dynamic library static data. This may be
# required for applications that store pointers in mmapped segments without
# informaing the collector. But it typically performs poorly, especially
# since it will scan inactive but cached NPTL thread stacks completely.
+# -DNO_PROC_STAT Causes the collector to avoid relying on Linux'
+# /proc/self/stat.
+# -DNO_GETCONTEXT Causes the collector to not assume the existence of
+# the getcontext() function on linux-like platforms. This currently
+# happens implicitly on Darwin, Hurd, or ARM or MIPS hardware.
+# It is explicitly needed for some old versions of FreeBSD.
+# -DSTATIC=static Causes various GC_ symbols that could logically be
+# declared static to be declared (this is the default if -DNO_DEBUGGING is
+# specified). Reduces the number of visible symbols (letting the optimizer
+# do its work better), which is probably cleaner, but may make some kinds of
+# debugging and profiling harder.
+# -DDONT_USE_USER32_DLL (Win32 only) Don't use "user32" DLL import library
+# (containing MessageBox() entry); useful for a static GC library.
+# -DGC_PREFER_MPROTECT_VDB Choose MPROTECT_VDB manually in case of multiple
+# virtual dirty bit strategies are implemented (at present useful on Win32
+# to force MPROTECT_VDB strategy instead of the default GWW_VDB one).
#
CXXFLAGS= $(CFLAGS)
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/gc_tiny_fl.h \
- include/private/gc_hdrs.h include/private/gc_priv.h \
+ include/gc_version.h include/private/gc_hdrs.h include/private/gc_priv.h \
include/private/gcconfig.h include/private/gc_pmark.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 \
doc/simple_example.html doc/README.win64
TESTS= tests/test.c tests/test_cpp.cc tests/trace_test.c \
- tests/leak_test.c tests/thread_leak_test.c tests/middle.c
+ tests/leak_test.c tests/thread_leak_test.c tests/middle.c \
+ tests/smash_test.c tests/huge_test.c
GNU_BUILD_FILES= configure.ac Makefile.am configure acinclude.m4 \
libtool.m4 install-sh configure.host Makefile.in \
BCC_MAKEFILE EMX_MAKEFILE WCC_MAKEFILE Makefile.dj \
PCR-Makefile SMakefile.amiga Makefile.DLLs \
digimars.mak Makefile.direct NT_STATIC_THREADS_MAKEFILE \
- NT_X64_STATIC_THREADS_MAKEFILE configure_atomic_ops.sh
-# Makefile and Makefile.direct are copies of each other.
+ NT_X64_STATIC_THREADS_MAKEFILE NT_X64_THREADS_MAKEFILE \
+ build_atomic_ops.sh build_atomic_ops.sh.cygwin
OTHER_FILES= Makefile setjmp_t.c callprocs \
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 mscvc_dbg.c include/private/msvc_dbg.h \
+ AmigaOS.c mscvc_dbg.c include/private/msvc_dbg.h \
$(TESTS) $(GNU_BUILD_FILES) $(OTHER_MAKEFILES)
CORD_INCLUDE_FILES= $(srcdir)/include/gc.h $(srcdir)/include/cord.h \
# if AO_INSTALL_DIR doesn't exist, we assume that it is pointing to
# the default location, and we need to build
$(AO_INSTALL_DIR):
- CC=$(CC) $(srcdir)/configure_atomic_ops.sh
- cd $(AO_SRC_DIR); make CC=$(CC) install
+ CC=$(CC) MAKE=$(MAKE) $(srcdir)/build_atomic_ops.sh
LEAKFLAGS=$(CFLAGS) -DFIND_LEAK
# Work-around for DEC optimizer tail recursion elimination bug.
# The ALPHA-specific line should be removed if gcc is used.
-alloc.o: version.h
+alloc.o: include/gc_version.h
cord:
mkdir cord
./setjmp_test
./gctest
-add_gc_prefix: $(srcdir)/add_gc_prefix.c $(srcdir)/version.h
+add_gc_prefix: $(srcdir)/add_gc_prefix.c $(srcdir)/include/gc_version.h
$(CC) -o add_gc_prefix $(srcdir)/add_gc_prefix.c
-gcname: $(srcdir)/gcname.c $(srcdir)/version.h
+gcname: $(srcdir)/gcname.c $(srcdir)/include/gc_version.h
$(CC) -o gcname $(srcdir)/gcname.c
#We assume this is being done from source directory.
cp Makefile Makefile.old
cp Makefile.direct Makefile
CC=$(CC) ./configure_atomic_ops.sh
- cd $(AO_SRC_DIR); make dist
+ cd $(AO_SRC_DIR); $(MAKE) dist
if test $(srcdir)/libatomic_ops-$(AO_VERSION) = $(AO_SRC_DIR); \
then \
mv $(AO_SRC_DIR) $(AO_SRC_DIR).bak ; \