changeset 10307:e6e75fd0916d

(mark_buffer, gc_sweep): Use BUF_INTERVALS. (mark_buffer): In indirect buffer, mark the base buffer. (mark_object): Make buffer case a branch of the Lisp_Vectorlike case.
author Richard M. Stallman <rms@gnu.org>
date Mon, 02 Jan 1995 09:15:25 +0000
parents 89f8d7f3bd73
children 90784ed0416f
files src/alloc.c
diffstat 1 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/alloc.c	Mon Jan 02 06:51:21 1995 +0000
+++ b/src/alloc.c	Mon Jan 02 09:15:25 1995 +0000
@@ -1523,7 +1523,9 @@
       break;
 
     case Lisp_Vectorlike:
-      if (GC_SUBRP (obj))
+      if (GC_BUFFERP (obj))
+	mark_buffer (obj);
+      else if (GC_SUBRP (obj))
 	break;
       else if (GC_COMPILEDP (obj))
 	/* We could treat this just like a vector, but it is better
@@ -1703,11 +1705,6 @@
       break;
 #endif /* LISP_FLOAT_TYPE */
 
-    case Lisp_Buffer:
-      if (!XMARKBIT (XBUFFER (obj)->name))
-	mark_buffer (obj);
-      break;
-
     case Lisp_Int:
       break;
 
@@ -1724,12 +1721,13 @@
 {
   register struct buffer *buffer = XBUFFER (buf);
   register Lisp_Object *ptr;
+  Lisp_Object base_buffer;
 
   /* This is the buffer's markbit */
   mark_object (&buffer->name);
   XMARK (buffer->name);
 
-  MARK_INTERVAL_TREE (buffer->intervals);
+  MARK_INTERVAL_TREE (BUF_INTERVALS (buffer));
 
 #if 0
   mark_object (buffer->syntax_table);
@@ -1753,6 +1751,13 @@
        (char *)ptr < (char *)buffer + sizeof (struct buffer);
        ptr++)
     mark_object (ptr);
+
+  /* If this is an indirect buffer, mark its base buffer.  */
+  if (buffer->base_buffer)
+    {
+      XSETBUFFER (base_buffer, buffer->base_buffer); 
+      mark_buffer (base_buffer);
+    }
 }
 
 /* Sweep: find all structures not marked, and free them. */
@@ -1970,7 +1975,7 @@
       else
 	{
 	  XUNMARK (buffer->name);
-	  UNMARK_BALANCE_INTERVALS (buffer->intervals);
+	  UNMARK_BALANCE_INTERVALS (BUF_INTERVALS (buffer));
 
 #if 0
 	  /* Each `struct Lisp_String *' was turned into a Lisp_Object