]> granicus.if.org Git - gc/commitdiff
2008-07-21 Hans Boehm <Hans.Boehm@hp.com>
authorhboehm <hboehm>
Tue, 22 Jul 2008 00:29:00 +0000 (00:29 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:43 +0000 (21:06 +0400)
* Makefile.direct, mach_dep.c: Add support for NO_GETCONTEXT.
* mach_dep.c: Include signal.h.
* gc_priv.h: Factor out INLINE declaration.

ChangeLog
Makefile.direct
include/private/gc_priv.h
mach_dep.c

index 47e1d3f4b2cf5e4d120745a22374c923ac9b2213..03a3dd589557fd70c123d70a670467e3ad0570c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-07-21  Hans Boehm <Hans.Boehm@hp.com>
+       * Makefile.direct, mach_dep.c: Add support for NO_GETCONTEXT.
+       * mach_dep.c: Include signal.h.
+       * gc_priv.h: Factor out INLINE declaration.
+
 2008-07-03  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Thiemo Seufer)
 
        * include/private/gcconfig.h: Update MIPS/LINUX config.
index 23b0ab36dbf9d3fe42eef02314751d1f21ec325b..32112b19b02dd0b9fcc57f881ec1129fd6362742 100644 (file)
@@ -320,6 +320,10 @@ HOSTCFLAGS=$(CFLAGS)
 #   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.
 #
 
 CXXFLAGS= $(CFLAGS) 
index 1d96d87c85812c28770364e44b4a9cb45b6a2443..88c87f6b1658474ca1456d2cec05abc8dcb615e3 100644 (file)
@@ -75,9 +75,13 @@ typedef char * ptr_t;        /* A generic pointer to which we can add        */
 #if __GNUC__ >= 3
 # define EXPECT(expr, outcome) __builtin_expect(expr,outcome)
   /* Equivalent to (expr), but predict that usually (expr)==outcome. */
-# define INLINE inline
 #else
 # define EXPECT(expr, outcome) (expr)
+#endif /* __GNUC__ */
+
+#if __GNUC__ >= 3
+# define INLINE inline
+#else
 # define INLINE
 #endif /* __GNUC__ */
 
index d828a71b4887e75994ccfc4c6116f0e1d7995f0c..e961f4339860db1d8829cbf2860937721c3e7f04 100644 (file)
@@ -160,9 +160,14 @@ void GC_push_regs()
 #endif
 
 #if !defined(HAVE_PUSH_REGS) && defined(UNIX_LIKE)
+# include <signal.h>
 # include <ucontext.h>
 #endif
 
+#if defined(UNIX_LIKE) && !defined(NO_GETCONTEXT) &&  \
+       (defined(DARWIN) || defined(HURD) || defined(ARM32) || defined(MIPS))
+#  define NO_GETCONTEXT
+#endif
 /* Ensure that either registers are pushed, or callee-save registers   */
 /* are somewhere on the stack, and then call fn(arg, ctxt).            */
 /* ctxt is either a pointer to a ucontext_t we generated, or NULL.     */
@@ -174,8 +179,7 @@ void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *),
 
 #   if defined(HAVE_PUSH_REGS)
       GC_push_regs();
-#   elif defined(UNIX_LIKE) && !defined(DARWIN) && !defined(ARM32) && \
-        !defined(MIPS) && !defined(HURD)
+#   elif defined(UNIX_LIKE) && !defined(NO_GETCONTEXT)
       /* Older versions of Darwin seem to lack getcontext(). */
       /* ARM and MIPS Linux often doesn't support a real     */
       /* getcontext().                                              */