summaryrefslogtreecommitdiff
path: root/include/private/gcconfig.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/private/gcconfig.h')
-rw-r--r--include/private/gcconfig.h442
1 files changed, 356 insertions, 86 deletions
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
index a0d12c8..8c2f267 100644
--- a/include/private/gcconfig.h
+++ b/include/private/gcconfig.h
@@ -33,7 +33,19 @@
# define NETBSD
# endif
+/* And one for OpenBSD: */
+# if defined(__OpenBSD__)
+# define OPENBSD
+# endif
+
/* Determine the machine type: */
+# if defined(__XSCALE__)
+# define ARM32
+# if !defined(LINUX)
+# define NOSYS
+# define mach_type_known
+# endif
+# endif
# if defined(sun) && defined(mc68000)
# define M68K
# define SUNOS4
@@ -44,25 +56,23 @@
# define HP
# define mach_type_known
# endif
-# if defined(__OpenBSD__) && defined(m68k)
+# if defined(OPENBSD) && defined(m68k)
# define M68K
-# define OPENBSD
# define mach_type_known
# endif
-# if defined(__OpenBSD__) && defined(__sparc__)
+# if defined(OPENBSD) && defined(__sparc__)
# define SPARC
-# define OPENBSD
# define mach_type_known
# endif
-# if defined(__NetBSD__) && defined(m68k)
+# if defined(NETBSD) && defined(m68k)
# define M68K
# define mach_type_known
# endif
-# if defined(__NetBSD__) && defined(__powerpc__)
+# if defined(NETBSD) && defined(__powerpc__)
# define POWERPC
# define mach_type_known
# endif
-# if defined(__NetBSD__) && defined(__arm32__)
+# if defined(NETBSD) && defined(__arm32__)
# define ARM32
# define mach_type_known
# endif
@@ -75,9 +85,12 @@
# endif
# define mach_type_known
# endif
-# if defined(mips) || defined(__mips)
+# if defined(mips) || defined(__mips) || defined(_mips)
# define MIPS
-# if !defined(LINUX)
+# if defined(nec_ews) || defined(_nec_ews)
+# define EWS4800
+# endif
+# if !defined(LINUX) && !defined(EWS4800)
# if defined(ultrix) || defined(__ultrix) || defined(__NetBSD__)
# define ULTRIX
# else
@@ -94,6 +107,13 @@
# endif
# define mach_type_known
# endif
+# if defined(DGUX) && (defined(i386) || defined(__i386__))
+# define I386
+# ifndef _USING_DGUX
+# define _USING_DGUX
+# endif
+# define mach_type_known
+# endif
# if defined(sequent) && (defined(i386) || defined(__i386__))
# define I386
# define SEQUENT
@@ -161,6 +181,11 @@
# endif
# define mach_type_known
# endif
+# if defined(__ia64) && defined(_HPUX_SOURCE)
+# define IA64
+# define HPUX
+# define mach_type_known
+# endif
# if defined(__BEOS__) && defined(_X86_)
# define I386
# define BEOS
@@ -196,7 +221,7 @@
# endif
# if defined(__alpha) || defined(__alpha__)
# define ALPHA
-# if !defined(LINUX) && !defined(NETBSD)
+# if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD)
# define OSF1 /* a.k.a Digital Unix */
# endif
# define mach_type_known
@@ -213,7 +238,7 @@
# define MACOS
# define mach_type_known
# endif
-# if defined(__MWERKS__) && defined(__powerc)
+# if defined(__MWERKS__) && defined(__powerc) && !defined(__MACH__)
# define POWERPC
# define MACOS
# define mach_type_known
@@ -268,7 +293,7 @@
# define CX_UX
# define mach_type_known
# endif
-# if defined(DGUX)
+# if defined(DGUX) && defined(m88k)
# define M88K
/* DGUX defined */
# define mach_type_known
@@ -386,7 +411,7 @@
/* RS6000 ==> IBM RS/6000 AIX3.X */
/* RT ==> IBM PC/RT */
/* HP_PA ==> HP9000/700 & /800 */
- /* HP/UX, LINUX */
+ /* HP/UX, LINUX */
/* SPARC ==> SPARC v7/v8/v9 */
/* (SUNOS4, SUNOS5, LINUX, */
/* DRSNX variants) */
@@ -398,8 +423,11 @@
/* running Amdahl UTS4 */
/* or a 390 running LINUX */
/* ARM32 ==> Intel StrongARM */
- /* IA64 ==> Intel IA64 */
+ /* IA64 ==> Intel IPF */
/* (e.g. Itanium) */
+ /* (LINUX and HPUX) */
+ /* IA64_32 ==> IA64 w/32 bit ABI */
+ /* (HPUX) */
/* SH ==> Hitachi SuperH */
/* (LINUX & MSWINCE) */
@@ -533,7 +561,7 @@
# ifdef LINUX
# define OS_TYPE "LINUX"
# define STACKBOTTOM ((ptr_t)0xf0000000)
-# define MPROTECT_VDB
+/* # define MPROTECT_VDB - Reported to not work 9/17/01 */
# ifdef __ELF__
# define DYNAMIC_LOADING
# include <features.h>
@@ -704,8 +732,11 @@
# define MACH_TYPE "SPARC"
# if defined(__arch64__) || defined(__sparcv9)
# define ALIGNMENT 8
+# define CPP_WORDSZ 64
+# define ELF_CLASS ELFCLASS64
# else
# define ALIGNMENT 4 /* Required by hardware */
+# define CPP_WORDSZ 32
# endif
# define ALIGN_DOUBLE
# ifdef SUNOS5
@@ -715,8 +746,12 @@
extern char * GC_SysVGetDataStart();
# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
# define DATAEND (&_end)
-# ifndef USE_MMAP
+# if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)
# define USE_MMAP
+ /* Otherwise we now use calloc. Mmap may result in the */
+ /* heap interleaved with thread stacks, which can result in */
+ /* excessive blacklisting. Sbrk is unusable since it */
+ /* doesn't interact correctly with the system malloc. */
# endif
# ifdef USE_MMAP
# define HEAP_START (ptr_t)0x40000000
@@ -740,7 +775,9 @@
# define GETPAGESIZE() sysconf(_SC_PAGESIZE)
/* getpagesize() appeared to be missing from at least one */
/* Solaris 5.4 installation. Weird. */
-# define DYNAMIC_LOADING
+# if CPP_WORDSZ == 32
+# define DYNAMIC_LOADING
+# endif
# endif
# ifdef SUNOS4
# define OS_TYPE "SUNOS4"
@@ -762,7 +799,6 @@
# define DYNAMIC_LOADING
# endif
# ifdef DRSNX
-# define CPP_WORDSZ 32
# define OS_TYPE "DRSNX"
extern char * GC_SysVGetDataStart();
extern int etext;
@@ -785,7 +821,6 @@
# ifdef __arch64__
# define STACKBOTTOM ((ptr_t) 0x80000000000ULL)
# define DATASTART (ptr_t)GC_SysVGetDataStart(0x100000, &_etext)
-# define CPP_WORDSZ 64
# else
# define STACKBOTTOM ((ptr_t) 0xf0000000)
# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
@@ -838,21 +873,29 @@
# endif
# ifdef SUNOS5
# define OS_TYPE "SUNOS5"
- extern int etext, _start;
+ extern int _etext, _end;
extern char * GC_SysVGetDataStart();
-# define DATASTART GC_SysVGetDataStart(0x1000, &etext)
+# define DATASTART GC_SysVGetDataStart(0x1000, &_etext)
+# define DATAEND (&_end)
/* # define STACKBOTTOM ((ptr_t)(&_start)) worked through 2.7, */
/* but reportedly breaks under 2.8. It appears that the stack */
/* base is a property of the executable, so this should not break */
/* old executables. */
/* HEURISTIC2 probably works, but this appears to be preferable. */
-# include <sys/vmparam.h>
+# include <sys/vm.h>
# define STACKBOTTOM USRSTACK
-/** At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
-/*# define PROC_VDB*/
+/* At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
+/* It appears to be fixed in 2.8 and 2.9. */
+# ifdef SOLARIS25_PROC_VDB_BUG_FIXED
+# define PROC_VDB
+# endif
# define DYNAMIC_LOADING
-# ifndef USE_MMAP
+# if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)
# define USE_MMAP
+ /* Otherwise we now use calloc. Mmap may result in the */
+ /* heap interleaved with thread stacks, which can result in */
+ /* excessive blacklisting. Sbrk is unusable since it */
+ /* doesn't interact correctly with the system malloc. */
# endif
# ifdef USE_MMAP
# define HEAP_START (ptr_t)0x40000000
@@ -876,7 +919,33 @@
# define DYNAMIC_LOADING
# define ELF_CLASS ELFCLASS32
# endif
+# ifdef DGUX
+# define OS_TYPE "DGUX"
+ extern int _etext, _end;
+ extern char * GC_SysVGetDataStart();
+# define DATASTART GC_SysVGetDataStart(0x1000, &_etext)
+# define DATAEND (&_end)
+# define STACK_GROWS_DOWN
+# define HEURISTIC2
+# include <unistd.h>
+# define GETPAGESIZE() sysconf(_SC_PAGESIZE)
+# define DYNAMIC_LOADING
+# ifndef USE_MMAP
+# define USE_MMAP
+# endif /* USE_MMAP */
+# define MAP_FAILED (void *) -1
+# ifdef USE_MMAP
+# define HEAP_START (ptr_t)0x40000000
+# else /* USE_MMAP */
+# define HEAP_START DATAEND
+# endif /* USE_MMAP */
+# endif /* DGUX */
+
# ifdef LINUX
+# ifndef __GNUC__
+ /* The Intel compiler doesn't like inline assembly */
+# define USE_GENERIC_PUSH_REGS
+# endif
# define OS_TYPE "LINUX"
# define LINUX_STACKBOTTOM
# if 0
@@ -888,7 +957,7 @@
/* with 2GB physical memory will usually move the user */
/* address space limit, and hence initial SP to 0x80000000. */
# endif
-# if !defined(LINUX_THREADS) || !defined(REDIRECT_MALLOC)
+# if !defined(GC_LINUX_THREADS) || !defined(REDIRECT_MALLOC)
# define MPROTECT_VDB
# else
/* We seem to get random errors in incremental mode, */
@@ -1003,8 +1072,17 @@
# endif
# ifdef FREEBSD
# define OS_TYPE "FREEBSD"
-# define MPROTECT_VDB
+# ifndef GC_FREEBSD_THREADS
+# define MPROTECT_VDB
+# endif
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
# define FREEBSD_STACKBOTTOM
+# ifdef __ELF__
+# define DYNAMIC_LOADING
+# endif
+ extern char etext;
+# define DATASTART ((ptr_t)(&etext))
# endif
# ifdef NETBSD
# define OS_TYPE "NETBSD"
@@ -1015,7 +1093,7 @@
# ifdef BSDI
# define OS_TYPE "BSDI"
# endif
-# if defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
+# if defined(OPENBSD) || defined(NETBSD) \
|| defined(THREE86BSD) || defined(BSDI)
# define HEURISTIC2
extern char etext;
@@ -1083,6 +1161,29 @@
/* instead. But some kernel versions seem to give the wrong */
/* value from /proc. */
# endif /* Linux */
+# ifdef EWS4800
+# define HEURISTIC2
+# if defined(_MIPS_SZPTR) && (_MIPS_SZPTR == 64)
+ extern int _fdata[], _end[];
+# define DATASTART ((ptr_t)_fdata)
+# define DATAEND ((ptr_t)_end)
+# define CPP_WORDSZ _MIPS_SZPTR
+# define ALIGNMENT (_MIPS_SZPTR/8)
+# else
+ extern int etext, edata, end;
+ extern int _DYNAMIC_LINKING, _gp;
+# define DATASTART ((ptr_t)((((word)&etext + 0x3ffff) & ~0x3ffff) \
+ + ((word)&etext & 0xffff)))
+# define DATAEND (&edata)
+# define DATASTART2 (&_DYNAMIC_LINKING \
+ ? (ptr_t)(((word)&_gp + 0x8000 + 0x3ffff) & ~0x3ffff) \
+ : (ptr_t)&edata)
+# define DATAEND2 (&end)
+# define ALIGNMENT 4
+# endif
+# define OS_TYPE "EWS4800"
+# define USE_GENERIC_PUSH_REGS 1
+# endif
# ifdef ULTRIX
# define HEURISTIC2
# define DATASTART (ptr_t)0x10000000
@@ -1151,17 +1252,25 @@
# ifdef RS6000
# define MACH_TYPE "RS6000"
-# define ALIGNMENT 4
-# define DATASTART ((ptr_t)0x20000000)
+# ifdef __64BIT__
+# define ALIGNMENT 8
+# define CPP_WORDSZ 64
+# else
+# define ALIGNMENT 4
+# define CPP_WORDSZ 32
+# endif
+ extern int _data, _end;
+# define DATASTART ((ptr_t)((ulong)&_data))
+# define DATAEND ((ptr_t)((ulong)&_end))
extern int errno;
# define STACKBOTTOM ((ptr_t)((ulong)&errno))
+# define USE_GENERIC_PUSH_REGS
# define DYNAMIC_LOADING
/* For really old versions of AIX, this may have to be removed. */
# endif
# ifdef HP_PA
# define MACH_TYPE "HP_PA"
-# define OS_TYPE "HPUX"
# ifdef __LP64__
# define CPP_WORDSZ 64
# define ALIGNMENT 8
@@ -1170,8 +1279,7 @@
# define ALIGNMENT 4
# define ALIGN_DOUBLE
# endif
-# if !defined(GC_HPUX_THREADS) && !defined(HPUX_THREADS) \
- && !defined(GC_LINUX_THREADS) && !defined(LINUX_THREADS)
+# if !defined(GC_HPUX_THREADS) && !defined(GC_LINUX_THREADS)
# ifndef LINUX /* For now. */
# define MPROTECT_VDB
# endif
@@ -1186,6 +1294,7 @@
# endif
# define STACK_GROWS_UP
# ifdef HPUX
+# define OS_TYPE "HPUX"
extern int __data_start;
# define DATASTART ((ptr_t)(&__data_start))
# if 0
@@ -1218,7 +1327,8 @@
# define OS_TYPE "LINUX"
# define LINUX_STACKBOTTOM
# define DYNAMIC_LOADING
-# define LINUX_DATA_START
+# define SEARCH_FOR_DATA_START
+# define DATASTART GC_data_start
extern int _end;
# define DATAEND (&_end)
# endif /* LINUX */
@@ -1242,6 +1352,19 @@
# define CPP_WORDSZ 64
# define DYNAMIC_LOADING
# endif
+# ifdef OPENBSD
+# define OS_TYPE "OPENBSD"
+# define HEURISTIC2
+# define CPP_WORDSZ 64
+# ifdef __ELF__ /* since OpenBSD/Alpha 2.9 */
+# define DATASTART GC_data_start
+# define ELFCLASS32 32
+# define ELFCLASS64 64
+# define ELF_CLASS ELFCLASS64
+# else /* ECOFF, until OpenBSD/Alpha 2.7 */
+# define DATASTART ((ptr_t) 0x140000000)
+# endif
+# endif
# ifdef OSF1
# define OS_TYPE "OSF1"
# define DATASTART ((ptr_t) 0x140000000)
@@ -1284,9 +1407,6 @@
# ifdef IA64
# define MACH_TYPE "IA64"
-# define ALIGN_DOUBLE
- /* Requires 16 byte alignment for malloc */
-# define ALIGNMENT 8
# define USE_GENERIC_PUSH_REGS
/* We need to get preserved registers in addition to register */
/* windows. That's easiest to do with setjmp. */
@@ -1296,11 +1416,47 @@
/* setting mark bits. */
# endif
# ifdef HPUX
- --> needs work
+# ifdef _ILP32
+# define CPP_WORDSZ 32
+# define ALIGN_DOUBLE
+ /* Requires 8 byte alignment for malloc */
+# define ALIGNMENT 4
+# else
+# ifndef _LP64
+ ---> unknown ABI
+# endif
+# define CPP_WORDSZ 64
+# define ALIGN_DOUBLE
+ /* Requires 16 byte alignment for malloc */
+# define ALIGNMENT 8
+# endif
+# define OS_TYPE "HPUX"
+ extern int __data_start;
+# define DATASTART ((ptr_t)(&__data_start))
+ /* Gustavo Rodriguez-Rivera suggested changing HEURISTIC2 */
+ /* to this. Note that the GC must be initialized before the */
+ /* first putenv call. */
+ extern char ** environ;
+# define STACKBOTTOM ((ptr_t)environ)
+# define DYNAMIC_LOADING
+# include <unistd.h>
+# define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
+ /* The following was empirically determined, and is probably */
+ /* not very robust. */
+ /* Note that the backing store base seems to be at a nice */
+ /* address minus one page. */
+# define BACKING_STORE_DISPLACEMENT 0x1000000
+# define BACKING_STORE_ALIGNMENT 0x1000
+# define BACKING_STORE_BASE \
+ (ptr_t)(((word)GC_stackbottom - BACKING_STORE_DISPLACEMENT - 1) \
+ & ~(BACKING_STORE_ALIGNMENT - 1))
# endif
# ifdef LINUX
+# define CPP_WORDSZ 64
+# define ALIGN_DOUBLE
+ /* Requires 16 byte alignment for malloc */
+# define ALIGNMENT 8
# define OS_TYPE "LINUX"
-# define CPP_WORDSZ 64
/* The following works on NUE and older kernels: */
/* # define STACKBOTTOM ((ptr_t) 0xa000000000000000l) */
/* This does not work on NUE: */
@@ -1315,7 +1471,13 @@
# define BACKING_STORE_BASE ((ptr_t)GC_register_stackbottom)
# define SEARCH_FOR_DATA_START
# define DATASTART GC_data_start
-# define DYNAMIC_LOADING
+# ifdef __GNUC__
+# define DYNAMIC_LOADING
+# else
+ /* In the Intel compiler environment, we seem to end up with */
+ /* statically linked executables and an undefined reference */
+ /* to _DYNAMIC */
+# endif
# define MPROTECT_VDB
/* Requires Linux 2.3.47 or later. */
extern int _end;
@@ -1423,6 +1585,15 @@
# define OS_TYPE "MSWINCE"
# define DATAEND /* not needed */
# endif
+# ifdef NOSYS
+ /* __data_start is usually defined in the target linker script. */
+ extern int __data_start;
+# define DATASTART (ptr_t)(&__data_start)
+# define USE_GENERIC_PUSH_REGS
+ /* __stack_base__ is set in newlib/libc/sys/arm/crt0.S */
+ extern void *__stack_base__;
+# define STACKBOTTOM ((ptr_t) (__stack_base__))
+# endif
#endif
# ifdef SH
@@ -1518,7 +1689,7 @@
# endif
# if defined(SVR4) || defined(LINUX) || defined(IRIX) || defined(HPUX) \
- || defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
+ || defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) || defined(DGUX) \
|| defined(BSD) || defined(AIX) || defined(MACOSX) || defined(OSF1)
# define UNIX_LIKE /* Basic Unix-like system calls work. */
# endif
@@ -1581,57 +1752,33 @@
((word*)x)[1] = 0;
# endif /* CLEAR_DOUBLE */
-/* Internally to the collector we test only the XXX_THREADS macros */
-/* not the GC_XXX_THREADS versions. Here we make sure the latter */
-/* are treated as equivalent. */
-#if defined(GC_SOLARIS_THREADS) && !defined(_SOLARIS_THREADS)
-# define _SOLARIS_THREADS
-#endif
-#if defined(GC_SOLARIS_THREADS) && !defined(_SOLARIS_PTHREADS)
-# define _SOLARIS_PTHREADS
-#endif
-#if defined(GC_IRIX_THREADS) && !defined(IRIX_THREADS)
-# define IRIX_THREADS
-#endif
-#if defined(GC_LINUX_THREADS) && !defined(LINUX_THREADS)
-# define LINUX_THREADS
-#endif
-#if defined(GC_WIN32_THREADS) && !defined(WIN32_THREADS)
-# define WIN32_THREADS
-#endif
-#if defined(GC_HPUX_THREADS) && !defined(HPUX_THREADS)
-# define HPUX_THREADS
-#endif
-#if defined(GC_OSF1_THREADS) && !defined(OSF1_THREADS)
-# define OSF1_THREADS
-#endif
-
-/* Internally we use SOLARIS_THREADS to test for either old or pthreads. */
-# if defined(_SOLARIS_PTHREADS) && !defined(SOLARIS_THREADS)
-# define SOLARIS_THREADS
+/* Internally we use GC_SOLARIS_THREADS to test for either old or pthreads. */
+# if defined(GC_SOLARIS_PTHREADS) && !defined(GC_SOLARIS_THREADS)
+# define GC_SOLARIS_THREADS
# endif
-# if defined(IRIX_THREADS) && !defined(IRIX5)
+
+# if defined(GC_IRIX_THREADS) && !defined(IRIX5)
--> inconsistent configuration
# endif
-# if defined(LINUX_THREADS) && !defined(LINUX)
+# if defined(GC_LINUX_THREADS) && !defined(LINUX)
--> inconsistent configuration
# endif
-# if defined(SOLARIS_THREADS) && !defined(SUNOS5)
+# if defined(GC_SOLARIS_THREADS) && !defined(SUNOS5)
--> inconsistent configuration
# endif
-# if defined(HPUX_THREADS) && !defined(HPUX)
+# if defined(GC_HPUX_THREADS) && !defined(HPUX)
--> inconsistent configuration
# endif
-# if defined(WIN32_THREADS) && !defined(MSWIN32)
- /* Ideally CYGWIN32 should work, in addition to MSWIN32. I suspect the necessary code */
- /* is mostly there, but nobody has actually made sure the right combination of pieces is */
- /* compiled in, etc. */
+# if defined(GC_WIN32_THREADS) && !defined(MSWIN32)
+ /* Ideally CYGWIN32 should work, in addition to MSWIN32. I suspect */
+ /* the necessary code is mostly there, but nobody has actually made */
+ /* sure the right combination of pieces is compiled in, etc. */
--> inconsistent configuration
# endif
+
# if defined(PCR) || defined(SRC_M3) || \
- defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || \
- defined(IRIX_THREADS) || defined(LINUX_THREADS) || \
- defined(HPUX_THREADS) || defined(OSF1_THREADS)
+ defined(GC_SOLARIS_THREADS) || defined(GC_WIN32_THREADS) || \
+ defined(GC_PTHREADS)
# define THREADS
# endif
@@ -1643,17 +1790,140 @@
/* descriptions. */
# define USE_GENERIC_PUSH_REGS
# endif
-# if defined(I386) && defined(LINUX)
+
+# if defined(SPARC)
+# define ASM_CLEAR_CODE /* Stack clearing is crucial, and we */
+ /* include assembly code to do it well. */
+# endif
+
+/* Can we save call chain in objects for debugging? */
+/* SET NFRAMES (# of saved frames) and NARGS (#of args for each frame) */
+/* to reasonable values for the platform. */
+/* Set SAVE_CALL_CHAIN if we can. SAVE_CALL_COUNT can be specified at */
+/* build time, though we feel free to adjust it slightly. */
+/* Define NEED_CALLINFO if we either save the call stack or */
+/* GC_ADD_CALLER is defined. */
+#ifdef LINUX
+# include <features.h>
+# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2
+# define HAVE_BUILTIN_BACKTRACE
+# endif
+#endif
+
+#if defined(SPARC)
+# define CAN_SAVE_CALL_STACKS
+# define CAN_SAVE_CALL_ARGS
+#endif
+#if defined(I386) && defined(LINUX)
/* SAVE_CALL_CHAIN is supported if the code is compiled to save */
/* frame pointers by default, i.e. no -fomit-frame-pointer flag. */
-# ifdef SAVE_CALL_COUNT
+# define CAN_SAVE_CALL_STACKS
+# define CAN_SAVE_CALL_ARGS
+#endif
+#if defined(HAVE_BUILTIN_BACKTRACE) && !defined(CAN_SAVE_CALL_STACKS)
+# define CAN_SAVE_CALL_STACKS
+#endif
+
+# if defined(SAVE_CALL_COUNT) && !defined(GC_ADD_CALLER) \
+ && defined(CAN_SAVE_CALL_STACKS)
# define SAVE_CALL_CHAIN
# endif
+# ifdef SAVE_CALL_CHAIN
+# if defined(SAVE_CALL_NARGS) && defined(CAN_SAVE_CALL_ARGS)
+# define NARGS SAVE_CALL_NARGS
+# else
+# define NARGS 0 /* Number of arguments to save for each call. */
+# endif
# endif
-# if defined(SPARC)
-# define SAVE_CALL_CHAIN
-# define ASM_CLEAR_CODE /* Stack clearing is crucial, and we */
- /* include assembly code to do it well. */
+# ifdef SAVE_CALL_CHAIN
+# ifndef SAVE_CALL_COUNT
+# define NFRAMES 6 /* Number of frames to save. Even for */
+ /* alignment reasons. */
+# else
+# define NFRAMES ((SAVE_CALL_COUNT + 1) & ~1)
+# endif
+# define NEED_CALLINFO
+# endif /* SAVE_CALL_CHAIN */
+# ifdef GC_ADD_CALLER
+# define NFRAMES 1
+# define NARGS 0
+# define NEED_CALLINFO
# endif
+# if defined(MAKE_BACK_GRAPH) && !defined(DBG_HDRS_ALL)
+# define DBG_HDRS_ALL
+# endif
+
+#ifdef GC_PRIVATE_H
+ /* This relies on some type definitions from gc_priv.h, from where it's */
+ /* normally included. */
+/* How to get heap memory from the OS: */
+/* Note that sbrk()-like allocation is preferred, since it */
+/* usually makes it possible to merge consecutively allocated */
+/* chunks. It also avoids unintented recursion with */
+/* -DREDIRECT_MALLOC. */
+/* GET_MEM() returns a HLKSIZE aligned chunk. */
+/* 0 is taken to mean failure. */
+/* In the case os USE_MMAP, the argument must also be a */
+/* physical page size. */
+/* GET_MEM is currently not assumed to retrieve 0 filled space, */
+/* though we should perhaps take advantage of the case in which */
+/* does. */
+struct hblk; /* See gc_priv.h. */
+# ifdef PCR
+ char * real_malloc();
+# define GET_MEM(bytes) HBLKPTR(real_malloc((size_t)bytes + GC_page_size) \
+ + GC_page_size-1)
+# else
+# ifdef OS2
+ void * os2_alloc(size_t bytes);
+# define GET_MEM(bytes) HBLKPTR((ptr_t)os2_alloc((size_t)bytes \
+ + GC_page_size) \
+ + GC_page_size-1)
+# else
+# if defined(NEXT) || defined(MACOSX) || defined(DOS4GW) || \
+ (defined(AMIGA) && !defined(GC_AMIGA_FASTALLOC)) || \
+ (defined(SUNOS5) && !defined(USE_MMAP))
+# define GET_MEM(bytes) HBLKPTR((size_t) \
+ calloc(1, (size_t)bytes + GC_page_size) \
+ + GC_page_size-1)
+# else
+# ifdef MSWIN32
+ extern ptr_t GC_win32_get_mem();
+# define GET_MEM(bytes) (struct hblk *)GC_win32_get_mem(bytes)
+# else
+# ifdef MACOS
+# if defined(USE_TEMPORARY_MEMORY)
+ extern Ptr GC_MacTemporaryNewPtr(size_t size,
+ Boolean clearMemory);
+# define GET_MEM(bytes) HBLKPTR( \
+ GC_MacTemporaryNewPtr(bytes + GC_page_size, true) \
+ + GC_page_size-1)
+# else
+# define GET_MEM(bytes) HBLKPTR( \
+ NewPtrClear(bytes + GC_page_size) + GC_page_size-1)
+# endif
+# else
+# ifdef MSWINCE
+ extern ptr_t GC_wince_get_mem();
+# define GET_MEM(bytes) (struct hblk *)GC_wince_get_mem(bytes)
+# else
+# if defined(AMIGA) && defined(GC_AMIGA_FASTALLOC)
+ extern void *GC_amiga_get_mem(size_t size);
+ define GET_MEM(bytes) HBLKPTR((size_t) \
+ GC_amiga_get_mem((size_t)bytes + GC_page_size) \
+ + GC_page_size-1)
+# else
+ extern ptr_t GC_unix_get_mem();
+# define GET_MEM(bytes) (struct hblk *)GC_unix_get_mem(bytes)
+# endif
+# endif
+# endif
+# endif
+# endif
+# endif
+# endif
+
+#endif /* GC_PRIVATE_H */
+
# endif /* GCCONFIG_H */