diff options
Diffstat (limited to 'boehm-gc/include')
-rw-r--r-- | boehm-gc/include/Makefile.in | 2 | ||||
-rw-r--r-- | boehm-gc/include/gc.h | 33 | ||||
-rw-r--r-- | boehm-gc/include/gc_config_macros.h | 4 | ||||
-rw-r--r-- | boehm-gc/include/gc_cpp.h | 2 | ||||
-rw-r--r-- | boehm-gc/include/new_gc_alloc.h | 8 | ||||
-rw-r--r-- | boehm-gc/include/private/gc_hdrs.h | 2 | ||||
-rw-r--r-- | boehm-gc/include/private/gc_locks.h | 87 | ||||
-rw-r--r-- | boehm-gc/include/private/gc_priv.h | 21 | ||||
-rw-r--r-- | boehm-gc/include/private/gcconfig.h | 132 | ||||
-rw-r--r-- | boehm-gc/include/private/pthread_stop_world.h | 1 | ||||
-rw-r--r-- | boehm-gc/include/private/pthread_support.h | 2 |
11 files changed, 188 insertions, 106 deletions
diff --git a/boehm-gc/include/Makefile.in b/boehm-gc/include/Makefile.in index 4c823287b32..cccac11bbbd 100644 --- a/boehm-gc/include/Makefile.in +++ b/boehm-gc/include/Makefile.in @@ -43,6 +43,8 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/gc_ext_config.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/no-executables.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h index 9da5b2cea0c..cfc8658ac39 100644 --- a/boehm-gc/include/gc.h +++ b/boehm-gc/include/gc.h @@ -55,7 +55,7 @@ # include <gc_config.h> # include "gc_config_macros.h" -# if defined(__STDC__) || defined(__cplusplus) +# if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # define GC_PROTO(args) args typedef void * GC_PTR; # define GC_CONST const @@ -214,7 +214,7 @@ GC_API GC_word GC_free_space_divisor; /* least N/GC_free_space_divisor bytes between */ /* collections, where N is the heap size plus */ /* a rough estimate of the root set size. */ - /* Initially, GC_free_space_divisor = 4. */ + /* Initially, GC_free_space_divisor = 3. */ /* Increasing its value will use less space */ /* but more collection time. Decreasing it */ /* will appreciably decrease collection time */ @@ -340,6 +340,9 @@ GC_API void GC_end_stubborn_change GC_PROTO((GC_PTR)); /* the base of the user object. */ /* Return 0 if displaced_pointer doesn't point to within a valid */ /* object. */ +/* Note that a deallocated object in the garbage collected heap */ +/* may be considered valid, even if it has been deallocated with */ +/* GC_free. */ GC_API GC_PTR GC_base GC_PROTO((GC_PTR displaced_pointer)); /* Given a pointer to the base of an object, return its size in bytes. */ @@ -877,7 +880,7 @@ GC_API GC_PTR GC_is_valid_displacement GC_PROTO((GC_PTR p)); /* Safer assignment of a pointer to a nonstack location. */ #ifdef GC_DEBUG -# ifdef __STDC__ +# if defined(__STDC__) || defined(_AIX) # define GC_PTR_STORE(p, q) \ (*(void **)GC_is_visible(p) = GC_is_valid_displacement(q)) # else @@ -972,12 +975,32 @@ extern void GC_thr_init GC_PROTO((void));/* Needed for Solaris/X86 */ # define GC_INIT() { extern end, etext; \ GC_noop(&end, &etext); } #else -# if defined(__CYGWIN32__) && defined(GC_DLL) || defined (_AIX) +# if defined(__CYGWIN32__) || defined (_AIX) /* * Similarly gnu-win32 DLLs need explicit initialization from * the main program, as does AIX. */ -# define GC_INIT() { GC_add_roots(DATASTART, DATAEND); } +# ifdef __CYGWIN32__ + extern int _data_start__[]; + extern int _data_end__[]; + extern int _bss_start__[]; + extern int _bss_end__[]; +# define GC_MAX(x,y) ((x) > (y) ? (x) : (y)) +# define GC_MIN(x,y) ((x) < (y) ? (x) : (y)) +# define GC_DATASTART ((GC_PTR) GC_MIN(_data_start__, _bss_start__)) +# define GC_DATAEND ((GC_PTR) GC_MAX(_data_end__, _bss_end__)) +# ifdef GC_DLL +# define GC_INIT() { GC_add_roots(GC_DATASTART, GC_DATAEND); } +# else +# define GC_INIT() +# endif +# endif +# if defined(_AIX) + extern int _data[], _end[]; +# define GC_DATASTART ((GC_PTR)((ulong)_data)) +# define GC_DATAEND ((GC_PTR)((ulong)_end)) +# define GC_INIT() { GC_add_roots(GC_DATASTART, GC_DATAEND); } +# endif # else # if defined(__APPLE__) && defined(__MACH__) || defined(GC_WIN32_THREADS) # define GC_INIT() { GC_init(); } diff --git a/boehm-gc/include/gc_config_macros.h b/boehm-gc/include/gc_config_macros.h index 90c574ed43c..5bb720ca344 100644 --- a/boehm-gc/include/gc_config_macros.h +++ b/boehm-gc/include/gc_config_macros.h @@ -59,6 +59,10 @@ # define GC_DGUX386_THREADS # define GC_PTHREADS # endif +# if defined(_AIX) +# define GC_AIX_THREADS +# define GC_PTHREADS +# endif #endif /* GC_THREADS */ #if defined(GC_THREADS) && !defined(GC_PTHREADS) && \ diff --git a/boehm-gc/include/gc_cpp.h b/boehm-gc/include/gc_cpp.h index c4d8b50e6b9..4f56f0d965f 100644 --- a/boehm-gc/include/gc_cpp.h +++ b/boehm-gc/include/gc_cpp.h @@ -74,7 +74,7 @@ cycle, then that's considered a storage leak, and neither will be collectable. See the interface gc.h for low-level facilities for handling such cycles of objects with clean-up. -The collector cannot guarrantee that it will find all inaccessible +The collector cannot guarantee that it will find all inaccessible objects. In practice, it finds almost all of them. diff --git a/boehm-gc/include/new_gc_alloc.h b/boehm-gc/include/new_gc_alloc.h index f2219b7732d..7546638c981 100644 --- a/boehm-gc/include/new_gc_alloc.h +++ b/boehm-gc/include/new_gc_alloc.h @@ -109,7 +109,7 @@ enum { GC_byte_alignment = 8 }; enum { GC_word_alignment = GC_byte_alignment/GC_bytes_per_word }; inline void * &GC_obj_link(void * p) -{ return *(void **)p; } +{ return *reinterpret_cast<void **>(p); } // Compute a number of words >= n+1 bytes. // The +1 allows for pointers one past the end. @@ -228,7 +228,7 @@ class single_client_gc_alloc_template { } else { flh = GC_objfreelist_ptr + nwords; GC_obj_link(p) = *flh; - memset((char *)p + GC_bytes_per_word, 0, + memset(reinterpret_cast<char *>(p) + GC_bytes_per_word, 0, GC_bytes_per_word * (nwords - 1)); *flh = p; GC_aux::GC_mem_recently_freed += nwords; @@ -352,9 +352,9 @@ class simple_alloc<T, alloc> { \ public: \ static T *allocate(size_t n) \ { return 0 == n? 0 : \ - (T*) alloc::ptr_free_allocate(n * sizeof (T)); } \ + reinterpret_cast<T*>(alloc::ptr_free_allocate(n * sizeof (T))); } \ static T *allocate(void) \ - { return (T*) alloc::ptr_free_allocate(sizeof (T)); } \ + { return reinterpret_cast<T*>(alloc::ptr_free_allocate(sizeof (T))); } \ static void deallocate(T *p, size_t n) \ { if (0 != n) alloc::ptr_free_deallocate(p, n * sizeof (T)); } \ static void deallocate(T *p) \ diff --git a/boehm-gc/include/private/gc_hdrs.h b/boehm-gc/include/private/gc_hdrs.h index 96749ab1bf0..70dfefe8fa7 100644 --- a/boehm-gc/include/private/gc_hdrs.h +++ b/boehm-gc/include/private/gc_hdrs.h @@ -108,7 +108,7 @@ extern hdr * GC_invalid_header; /* header for an imaginary block */ /* Analogous to GET_HDR, except that in the case of large objects, it */ /* Returns the header for the object beginning, and updates p. */ -/* Returns &GC_bad_header instead of 0. All of this saves a branch */ +/* Returns GC_invalid_header instead of 0. All of this saves a branch */ /* in the fast path. */ # define HC_GET_HDR(p, hhdr, source) \ { \ diff --git a/boehm-gc/include/private/gc_locks.h b/boehm-gc/include/private/gc_locks.h index ec3e6cd1ef2..1faf2d3d209 100644 --- a/boehm-gc/include/private/gc_locks.h +++ b/boehm-gc/include/private/gc_locks.h @@ -139,6 +139,25 @@ # define GC_TEST_AND_SET_DEFINED # endif # if defined(POWERPC) +# if CPP_WORDSZ == 64 + inline static int GC_test_and_set(volatile unsigned int *addr) { + unsigned long oldval; + unsigned long temp = 1; /* locked value */ + + __asm__ __volatile__( + "1:\tldarx %0,0,%3\n" /* load and reserve */ + "\tcmpdi %0, 0\n" /* if load is */ + "\tbne 2f\n" /* non-zero, return already set */ + "\tstdcx. %2,0,%1\n" /* else store conditional */ + "\tbne- 1b\n" /* retry if lost reservation */ + "\tsync\n" /* import barrier */ + "2:\t\n" /* oldval is zero if we set */ + : "=&r"(oldval), "=p"(addr) + : "r"(temp), "1"(addr) + : "cr0","memory"); + return (int)oldval; + } +# else inline static int GC_test_and_set(volatile unsigned int *addr) { int oldval; int temp = 1; /* locked value */ @@ -156,12 +175,13 @@ : "cr0","memory"); return oldval; } -# define GC_TEST_AND_SET_DEFINED - inline static void GC_clear(volatile unsigned int *addr) { - __asm__ __volatile__("eieio" : : : "memory"); - *(addr) = 0; - } -# define GC_CLEAR_DEFINED +# endif +# define GC_TEST_AND_SET_DEFINED + inline static void GC_clear(volatile unsigned int *addr) { + __asm__ __volatile__("lwsync" : : : "memory"); + *(addr) = 0; + } +# define GC_CLEAR_DEFINED # endif # if defined(ALPHA) inline static int GC_test_and_set(volatile unsigned int * addr) @@ -282,6 +302,8 @@ # define GC_test_and_set(addr) test_and_set((void *)addr,1) # endif # else +# include <sgidefs.h> +# include <mutex.h> # define GC_test_and_set(addr) __test_and_set32((void *)addr,1) # define GC_clear(addr) __lock_release(addr); # define GC_CLEAR_DEFINED @@ -354,7 +376,7 @@ # endif # if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \ - && !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS) + && !defined(GC_WIN32_THREADS) # define NO_THREAD (pthread_t)(-1) # include <pthread.h> # if defined(PARALLEL_MARK) @@ -401,6 +423,29 @@ # if defined(POWERPC) # if !defined(GENERIC_COMPARE_AND_SWAP) +# if CPP_WORDSZ == 64 + /* Returns TRUE if the comparison succeeded. */ + inline static GC_bool GC_compare_and_exchange(volatile GC_word *addr, + GC_word old, GC_word new_val) + { + unsigned long result, dummy; + __asm__ __volatile__( + "1:\tldarx %0,0,%5\n" + "\tcmpd %0,%4\n" + "\tbne 2f\n" + "\tstdcx. %3,0,%2\n" + "\tbne- 1b\n" + "\tsync\n" + "\tli %1, 1\n" + "\tb 3f\n" + "2:\tli %1, 0\n" + "3:\t\n" + : "=&r" (dummy), "=r" (result), "=p" (addr) + : "r" (new_val), "r" (old), "2"(addr) + : "cr0","memory"); + return (GC_bool) result; + } +# else /* Returns TRUE if the comparison succeeded. */ inline static GC_bool GC_compare_and_exchange(volatile GC_word *addr, GC_word old, GC_word new_val) @@ -422,6 +467,7 @@ : "cr0","memory"); return (GC_bool) result; } +# endif # endif /* !GENERIC_COMPARE_AND_SWAP */ inline static void GC_memory_barrier() { @@ -598,33 +644,6 @@ extern pthread_t GC_mark_lock_holder; # endif # endif /* GC_PTHREADS with linux_threads.c implementation */ -# if defined(GC_IRIX_THREADS) -# include <pthread.h> - /* This probably should never be included, but I can't test */ - /* on Irix anymore. */ -# include <mutex.h> - - extern volatile unsigned int GC_allocate_lock; - /* This is not a mutex because mutexes that obey the (optional) */ - /* POSIX scheduling rules are subject to convoys in high contention */ - /* applications. This is basically a spin lock. */ - extern pthread_t GC_lock_holder; - extern void GC_lock(void); - /* Allocation lock holder. Only set if acquired by client through */ - /* GC_call_with_alloc_lock. */ -# define SET_LOCK_HOLDER() GC_lock_holder = pthread_self() -# define NO_THREAD (pthread_t)(-1) -# define UNSET_LOCK_HOLDER() GC_lock_holder = NO_THREAD -# define I_HOLD_LOCK() (pthread_equal(GC_lock_holder, pthread_self())) -# define LOCK() { if (GC_test_and_set(&GC_allocate_lock)) GC_lock(); } -# define UNLOCK() GC_clear(&GC_allocate_lock); - extern VOLATILE GC_bool GC_collecting; -# define ENTER_GC() \ - { \ - GC_collecting = 1; \ - } -# define EXIT_GC() GC_collecting = 0; -# endif /* GC_IRIX_THREADS */ # if defined(GC_WIN32_THREADS) # if defined(GC_PTHREADS) # include <pthread.h> diff --git a/boehm-gc/include/private/gc_priv.h b/boehm-gc/include/private/gc_priv.h index 6138ca42b88..38685bcd126 100644 --- a/boehm-gc/include/private/gc_priv.h +++ b/boehm-gc/include/private/gc_priv.h @@ -262,17 +262,6 @@ typedef char * ptr_t; /* A generic pointer to which we can add */ /* */ /*********************************/ -#ifdef SAVE_CALL_CHAIN - -/* Fill in the pc and argument information for up to NFRAMES of my */ -/* callers. Ignore my frame and my callers frame. */ -struct callinfo; -void GC_save_callers GC_PROTO((struct callinfo info[NFRAMES])); - -void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES])); - -#endif - #ifdef NEED_CALLINFO struct callinfo { word ci_pc; /* Caller, not callee, pc */ @@ -286,6 +275,16 @@ void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES])); }; #endif +#ifdef SAVE_CALL_CHAIN + +/* Fill in the pc and argument information for up to NFRAMES of my */ +/* callers. Ignore my frame and my callers frame. */ +void GC_save_callers GC_PROTO((struct callinfo info[NFRAMES])); + +void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES])); + +#endif + /*********************************/ /* */ diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h index deed0f5de98..044fcf81c00 100644 --- a/boehm-gc/include/private/gcconfig.h +++ b/boehm-gc/include/private/gcconfig.h @@ -55,7 +55,7 @@ # endif /* And one for FreeBSD: */ -# if defined(__FreeBSD__) +# if defined(__FreeBSD__) && !defined(FREEBSD) # define FREEBSD # endif @@ -97,6 +97,10 @@ # define ARM32 # define mach_type_known # endif +# if defined(NETBSD) && defined(__sh__) +# define SH +# define mach_type_known +# endif # if defined(vax) # define VAX # ifdef ultrix @@ -167,7 +171,7 @@ # define mach_type_known # endif # if defined(sparc) && defined(unix) && !defined(sun) && !defined(linux) \ - && !defined(__OpenBSD__) && !(__NetBSD__) + && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__) # define SPARC # define DRSNX # define mach_type_known @@ -198,14 +202,16 @@ # if defined(_PA_RISC1_0) || defined(_PA_RISC1_1) || defined(_PA_RISC2_0) \ || defined(hppa) || defined(__hppa__) # define HP_PA -# ifndef LINUX +# if !defined(LINUX) && !defined(HPUX) # define HPUX # endif # define mach_type_known # endif # if defined(__ia64) && defined(_HPUX_SOURCE) # define IA64 -# define HPUX +# ifndef HPUX +# define HPUX +# endif # define mach_type_known # endif # if defined(__BEOS__) && defined(_X86_) @@ -235,7 +241,8 @@ # endif # define mach_type_known # endif -# if defined(LINUX) && (defined(powerpc) || defined(__powerpc__) || defined(powerpc64) || defined(__powerpc64__)) +# if defined(LINUX) && (defined(powerpc) || defined(__powerpc__) || \ + defined(powerpc64) || defined(__powerpc64__)) # define POWERPC # define mach_type_known # endif @@ -293,11 +300,11 @@ # define DARWIN # define POWERPC # define mach_type_known -# endif -# if defined(__APPLE__) && defined(__MACH__) && defined(__i386__) -# define DARWIN -# define I386 +# else +# if defined(__i386__) +# define I386 --> Not really supported, but at least we recognize it. +# endif # endif # if defined(NeXT) && defined(mc68000) # define M68K @@ -326,6 +333,10 @@ # define X86_64 # define mach_type_known # endif +# if defined(FREEBSD) && defined(__sparc__) +# define SPARC +# define mach_type_known +#endif # if defined(bsdi) && (defined(i386) || defined(__i386__)) # define I386 # define BSDI @@ -486,6 +497,9 @@ /* POWERPC ==> IBM/Apple PowerPC */ /* (MACOS(<=9),DARWIN(incl.MACOSX),*/ /* LINUX, NETBSD, NOSYS variants) */ + /* Handles 32 and 64-bit variants. */ + /* AIX should be handled here, but */ + /* that's called an RS6000. */ /* CRIS ==> Axis Etrax */ /* M32R ==> Renesas M32R */ @@ -493,12 +507,12 @@ /* * For each architecture and OS, the following need to be defined: * - * CPP_WORD_SZ is a simple integer constant representing the word size. + * CPP_WORDSZ is a simple integer constant representing the word size. * in bits. We assume byte addressibility, where a byte has 8 bits. - * We also assume CPP_WORD_SZ is either 32 or 64. + * We also assume CPP_WORDSZ is either 32 or 64. * (We care about the length of pointers, not hardware * bus widths. Thus a 64 bit processor with a C compiler that uses - * 32 bit pointers should use CPP_WORD_SZ of 32, not 64. Default is 32.) + * 32 bit pointers should use CPP_WORDSZ of 32, not 64. Default is 32.) * * MACH_TYPE is a string representation of the machine type. * OS_TYPE is analogous for the OS. @@ -615,7 +629,8 @@ */ # if defined(__GNUC__) && ((__GNUC__ >= 3) || \ (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)) \ - && !defined(__INTEL_COMPILER) + && !defined(__INTEL_COMPILER) \ + && !defined(__PATHCC__) # define HAVE_BUILTIN_UNWIND_INIT # endif @@ -740,7 +755,7 @@ # endif # endif -# ifdef POWERPC +# if defined(POWERPC) # define MACH_TYPE "POWERPC" # ifdef MACOS # define ALIGNMENT 2 /* Still necessary? Could it be 4? */ @@ -753,10 +768,12 @@ # define DATAEND /* not needed */ # endif # ifdef LINUX -# if (defined (powerpc64) || defined(__powerpc64__)) +# if defined(__powerpc64__) # define ALIGNMENT 8 # define CPP_WORDSZ 64 -# define HBLKSIZE 4096 +# ifndef HBLKSIZE +# define HBLKSIZE 4096 +# endif # else # define ALIGNMENT 4 # endif @@ -770,7 +787,7 @@ # define DATAEND (_end) # endif # ifdef DARWIN -# if (defined (__ppc64__)) +# ifdef __ppc64__ # define ALIGNMENT 8 # define CPP_WORDSZ 64 # else @@ -787,8 +804,10 @@ # define USE_MMAP_ANON # define USE_ASM_PUSH_REGS /* This is potentially buggy. It needs more testing. See the comments in - os_dep.c */ -# define MPROTECT_VDB + os_dep.c. It relies on threads to track writes. */ +# ifdef GC_DARWIN_THREADS +/* # define MPROTECT_VDB -- diabled for now. May work for some apps. */ +# endif # include <unistd.h> # define GETPAGESIZE() getpagesize() # if defined(USE_PPC_PREFETCH) && defined(__GNUC__) @@ -975,6 +994,23 @@ # define DATASTART ((ptr_t)(etext)) # endif # endif +# ifdef FREEBSD +# define OS_TYPE "FREEBSD" +# define SIG_SUSPEND SIGUSR1 +# define SIG_THR_RESTART SIGUSR2 +# define FREEBSD_STACKBOTTOM +# ifdef __ELF__ +# define DYNAMIC_LOADING +# endif + extern char etext[]; + extern char edata[]; + extern char end[]; +# define NEED_FIND_LIMIT +# define DATASTART ((ptr_t)(&etext)) +# define DATAEND (GC_find_limit (DATASTART, TRUE)) +# define DATASTART2 ((ptr_t)(&edata)) +# define DATAEND2 ((ptr_t)(&end)) +# endif # endif # ifdef I386 @@ -1158,26 +1194,8 @@ # endif # ifdef CYGWIN32 # define OS_TYPE "CYGWIN32" - extern int _data_start__[]; - extern int _data_end__[]; - extern int _bss_start__[]; - extern int _bss_end__[]; - /* For binutils 2.9.1, we have */ - /* DATASTART = _data_start__ */ - /* DATAEND = _bss_end__ */ - /* whereas for some earlier versions it was */ - /* DATASTART = _bss_start__ */ - /* DATAEND = _data_end__ */ - /* To get it right for both, we take the */ - /* minumum/maximum of the two. */ -# ifndef MAX -# define MAX(x,y) ((x) > (y) ? (x) : (y)) -# endif -# ifndef MIN -# define MIN(x,y) ((x) < (y) ? (x) : (y)) -# endif -# define DATASTART ((ptr_t) MIN(_data_start__, _bss_start__)) -# define DATAEND ((ptr_t) MAX(_data_end__, _bss_end__)) +# define DATASTART ((ptr_t)GC_DATASTART) /* From gc.h */ +# define DATAEND ((ptr_t)GC_DATAEND) # undef STACK_GRAN # define STACK_GRAN 0x10000 # define HEURISTIC1 @@ -1421,6 +1439,8 @@ # define CPP_WORDSZ 32 # define STACKBOTTOM ((ptr_t)((ulong)&errno)) # endif +# define USE_MMAP +# define USE_MMAP_ANON /* From AIX linker man page: _text Specifies the first location of the program. _etext Specifies the first location after the program. @@ -1728,7 +1748,7 @@ # define USE_GENERIC_PUSH_REGS # ifdef UTS4 # define OS_TYPE "UTS4" - extern int etext[]; + extern int etext[]; extern int _etext[]; extern int _end[]; extern ptr_t GC_SysVGetDataStart(); @@ -1742,18 +1762,20 @@ # define MACH_TYPE "S390" # define USE_GENERIC_PUSH_REGS # ifndef __s390x__ -# define ALIGNMENT 4 -# define CPP_WORDSZ 32 +# define ALIGNMENT 4 +# define CPP_WORDSZ 32 # else -# define ALIGNMENT 8 -# define CPP_WORDSZ 64 -# define HBLKSIZE 4096 +# define ALIGNMENT 8 +# define CPP_WORDSZ 64 +# endif +# ifndef HBLKSIZE +# define HBLKSIZE 4096 # endif # ifdef LINUX # define OS_TYPE "LINUX" # define LINUX_STACKBOTTOM # define DYNAMIC_LOADING - extern int __data_start[]; + extern int __data_start[]; # define DATASTART ((ptr_t)(__data_start)) extern int _end[]; # define DATAEND (_end) @@ -1859,6 +1881,13 @@ extern int _end[]; # define DATAEND (_end) # endif +# ifdef NETBSD +# define OS_TYPE "NETBSD" +# define HEURISTIC2 +# define DATASTART GC_data_start +# define USE_GENERIC_PUSH_REGS +# define DYNAMIC_LOADING +# endif # endif # ifdef SH4 @@ -2107,7 +2136,8 @@ # define THREADS # endif -# if defined(HP_PA) || defined(M88K) || defined(POWERPC) && !defined(DARWIN) \ +# if defined(HP_PA) || defined(M88K) \ + || defined(POWERPC) && !defined(DARWIN) \ || defined(LINT) || defined(MSWINCE) || defined(ARM32) || defined(CRIS) \ || (defined(I386) && defined(__LCC__)) /* Use setjmp based hack to mark from callee-save registers. */ @@ -2249,7 +2279,7 @@ # else # if defined(AMIGA) && defined(GC_AMIGA_FASTALLOC) extern void *GC_amiga_get_mem(size_t size); -# define GET_MEM(bytes) HBLKPTR((size_t) \ +# define GET_MEM(bytes) HBLKPTR((size_t) \ GC_amiga_get_mem((size_t)bytes + GC_page_size) \ + GC_page_size-1) # else @@ -2265,4 +2295,10 @@ #endif /* GC_PRIVATE_H */ +#if defined(_AIX) && !defined(__GNUC__) && !defined(__STDC__) + /* IBMs xlc compiler doesn't appear to follow the convention of */ + /* defining __STDC__ to be zero in extended mode. */ +# define __STDC__ 0 +#endif + # endif /* GCCONFIG_H */ diff --git a/boehm-gc/include/private/pthread_stop_world.h b/boehm-gc/include/private/pthread_stop_world.h index 054c7a0eacd..6f9197a1f6f 100644 --- a/boehm-gc/include/private/pthread_stop_world.h +++ b/boehm-gc/include/private/pthread_stop_world.h @@ -2,7 +2,6 @@ #define GC_PTHREAD_STOP_WORLD_H struct thread_stop_info { - int signal; word last_stop_count; /* GC_last_stop_count value when thread */ /* last successfully handled a suspend */ /* signal. */ diff --git a/boehm-gc/include/private/pthread_support.h b/boehm-gc/include/private/pthread_support.h index d52e4da90aa..469021b4071 100644 --- a/boehm-gc/include/private/pthread_support.h +++ b/boehm-gc/include/private/pthread_support.h @@ -4,7 +4,7 @@ # include "private/gc_priv.h" # if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \ - && !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS) + && !defined(GC_WIN32_THREADS) #if defined(GC_DARWIN_THREADS) # include "private/darwin_stop_world.h" |