diff options
Diffstat (limited to 'src/alloc.c')
-rw-r--r-- | src/alloc.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/alloc.c b/src/alloc.c index e754e2f6aa2..089a7766ca4 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1,6 +1,6 @@ /* Storage allocation and gc for GNU Emacs Lisp interpreter. Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -4222,7 +4222,7 @@ Please mail the result to <emacs-devel@gnu.org>.\n\ can prove that. */ static void -test_setjmp () +test_setjmp (void) { char buf[10]; register int x; @@ -4270,7 +4270,7 @@ test_setjmp () /* Abort if anything GCPRO'd doesn't survive the GC. */ static void -check_gcpros () +check_gcpros (void) { struct gcpro *p; int i; @@ -4286,7 +4286,7 @@ check_gcpros () #elif GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES static void -dump_zombies () +dump_zombies (void) { int i; @@ -4321,6 +4321,11 @@ dump_zombies () have to be true! It must be verified for each system, possibly by taking a look at the source code of setjmp. + If __builtin_unwind_init is available (defined by GCC >= 2.8) we + can use it as a machine independent method to store all registers + to the stack. In this case the macros described in the previous + two paragraphs are not used. + Stack Layout Architectures differ in the way their processor stack is organized. @@ -4359,6 +4364,13 @@ mark_stack (void) volatile int stack_grows_down_p = (char *) &j > (char *) stack_base; void *end; +#ifdef HAVE___BUILTIN_UNWIND_INIT + /* Force callee-saved registers and register windows onto the stack. + This is the preferred method if available, obviating the need for + machine dependent methods. */ + __builtin_unwind_init (); + end = &end; +#else /* not HAVE___BUILTIN_UNWIND_INIT */ /* This trick flushes the register windows so that all the state of the process is contained in the stack. */ /* Fixme: Code in the Boehm GC suggests flushing (with `flushrs') is @@ -4394,6 +4406,7 @@ mark_stack (void) setjmp (j.j); end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; #endif /* not GC_SAVE_REGISTERS_ON_STACK */ +#endif /* not HAVE___BUILTIN_UNWIND_INIT */ /* This assumes that the stack is a contiguous region in memory. If that's not the case, something has to be done here to iterate |