aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorAndreas Schwab2002-02-07 11:05:08 +0000
committerAndreas Schwab2002-02-07 11:05:08 +0000
commit630909a5895d66c44198e7426dec597b645e98a9 (patch)
tree179ad155cfee6ce50b11208a84c5d13b59416021 /src/alloc.c
parent93607efd670fe7c5aa0fbca2b6d8e2f392970409 (diff)
downloademacs-630909a5895d66c44198e7426dec597b645e98a9.tar.gz
emacs-630909a5895d66c44198e7426dec597b645e98a9.zip
(mark_stack): Don't assume sizeof (Lisp_Object) is 4.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 56832afc70d..a0165494481 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1,5 +1,5 @@
1/* Storage allocation and gc for GNU Emacs Lisp interpreter. 1/* Storage allocation and gc for GNU Emacs Lisp interpreter.
2 Copyright (C) 1985, 86, 88, 93, 94, 95, 97, 98, 1999, 2000, 2001 2 Copyright (C) 1985, 86, 88, 93, 94, 95, 97, 98, 1999, 2000, 2001, 2002
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -3734,6 +3734,7 @@ dump_zombies ()
3734static void 3734static void
3735mark_stack () 3735mark_stack ()
3736{ 3736{
3737 int i;
3737 jmp_buf j; 3738 jmp_buf j;
3738 volatile int stack_grows_down_p = (char *) &j > (char *) stack_base; 3739 volatile int stack_grows_down_p = (char *) &j > (char *) stack_base;
3739 void *end; 3740 void *end;
@@ -3769,17 +3770,11 @@ mark_stack ()
3769 /* This assumes that the stack is a contiguous region in memory. If 3770 /* This assumes that the stack is a contiguous region in memory. If
3770 that's not the case, something has to be done here to iterate 3771 that's not the case, something has to be done here to iterate
3771 over the stack segments. */ 3772 over the stack segments. */
3772#if GC_LISP_OBJECT_ALIGNMENT == 1 3773#ifndef GC_LISP_OBJECT_ALIGNMENT
3773 mark_memory (stack_base, end); 3774#define GC_LISP_OBJECT_ALIGNMENT sizeof (Lisp_Object)
3774 mark_memory ((char *) stack_base + 1, end);
3775 mark_memory ((char *) stack_base + 2, end);
3776 mark_memory ((char *) stack_base + 3, end);
3777#elif GC_LISP_OBJECT_ALIGNMENT == 2
3778 mark_memory (stack_base, end);
3779 mark_memory ((char *) stack_base + 2, end);
3780#else
3781 mark_memory (stack_base, end);
3782#endif 3775#endif
3776 for (i = 0; i < sizeof (Lisp_Object) / GC_LISP_OBJECT_ALIGNMENT; i++)
3777 mark_memory ((char *) stack_base + i, end);
3783 3778
3784#if GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS 3779#if GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS
3785 check_gcpros (); 3780 check_gcpros ();