changeset 26376:6706cd0ece4d

(mark_byte_stack): Use XMARKBIT and XMARK. (unmark_byte_stack): Renamed from relocate_byte_pcs. Use XUNMARK.
author Gerd Moellmann <gerd@gnu.org>
date Sun, 07 Nov 1999 22:44:06 +0000
parents 9443a8ee34d4
children 55f8aad5034d
files src/bytecode.c
diffstat 1 files changed, 34 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/bytecode.c	Sun Nov 07 22:36:55 1999 +0000
+++ b/src/bytecode.c	Sun Nov 07 22:44:06 1999 +0000
@@ -276,29 +276,51 @@
 	abort ();
       
       for (obj = stack->bottom; obj <= stack->top; ++obj)
-	mark_object (obj);
+	if (!XMARKBIT (*obj))
+	  {
+	    mark_object (obj);
+	    XMARK (*obj);
+	  }
 
-      mark_object (&stack->byte_string);
-      mark_object (&stack->constants);
+      if (!XMARKBIT (stack->byte_string))
+	{
+          mark_object (&stack->byte_string);
+	  XMARK (stack->byte_string);
+	}
+
+      if (!XMARKBIT (stack->constants))
+	{
+	  mark_object (&stack->constants);
+	  XMARK (stack->constants);
+	}
     }
 }
 
 
-/* Relocate program counters in the stacks on byte_stack_list.  Called
-   when GC has completed.  */
+/* Unmark objects in the stacks on byte_stack_list.  Relocate program
+   counters.  Called when GC has completed.  */
 
 void 
-relocate_byte_pcs ()
+unmark_byte_stack ()
 {
   struct byte_stack *stack;
+  Lisp_Object *obj;
 
   for (stack = byte_stack_list; stack; stack = stack->next)
-    if (stack->byte_string_start != XSTRING (stack->byte_string)->data)
-      {
-	int offset = stack->pc - stack->byte_string_start;
-	stack->byte_string_start = XSTRING (stack->byte_string)->data;
-	stack->pc = stack->byte_string_start + offset;
-      }
+    {
+      for (obj = stack->bottom; obj <= stack->top; ++obj)
+	XUNMARK (*obj);
+
+      XUNMARK (stack->byte_string);
+      XUNMARK (stack->constants);
+
+      if (stack->byte_string_start != XSTRING (stack->byte_string)->data)
+	{
+	  int offset = stack->pc - stack->byte_string_start;
+	  stack->byte_string_start = XSTRING (stack->byte_string)->data;
+	  stack->pc = stack->byte_string_start + offset;
+	}
+    }
 }