Mercurial > emacs
diff src/alloc.c @ 112138:3d3d7ef762fd
Merge from mainline.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Thu, 06 Jan 2011 21:16:15 -0800 |
parents | 4dbda0e7c8bf |
children | ef719132ddfa 7df2e30d72ec |
line wrap: on
line diff
--- a/src/alloc.c Tue Jan 04 14:50:21 2011 -0500 +++ b/src/alloc.c Thu Jan 06 21:16:15 2011 -0800 @@ -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 @@ can prove that. */ static void -test_setjmp () +test_setjmp (void) { char buf[10]; register int x; @@ -4270,7 +4270,7 @@ /* 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 @@ #elif GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES static void -dump_zombies () +dump_zombies (void) { int i; @@ -4321,6 +4321,11 @@ 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 @@ 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 @@ 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