changeset 52473:a3fd06a8c844

(init_intervals, init_symbol, init_marker): Don't preallocate anything. (Fgarbage_collect, mark_object): Ignore the markbit.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 11 Sep 2003 22:18:00 +0000
parents 30a3237237e0
children 10551947af24
files src/alloc.c
diffstat 1 files changed, 15 insertions(+), 55 deletions(-) [+]
line wrap: on
line diff
--- a/src/alloc.c	Thu Sep 11 21:58:32 2003 +0000
+++ b/src/alloc.c	Thu Sep 11 22:18:00 2003 +0000
@@ -1131,14 +1131,10 @@
 static void
 init_intervals ()
 {
-  interval_block
-    = (struct interval_block *) lisp_malloc (sizeof *interval_block,
-					     MEM_TYPE_NON_LISP);
-  interval_block->next = 0;
-  bzero ((char *) interval_block->intervals, sizeof interval_block->intervals);
-  interval_block_index = 0;
+  interval_block = NULL;
+  interval_block_index = INTERVAL_BLOCK_SIZE;
   interval_free_list = 0;
-  n_interval_blocks = 1;
+  n_interval_blocks = 0;
 }
 
 
@@ -2768,13 +2764,10 @@
 void
 init_symbol ()
 {
-  symbol_block = (struct symbol_block *) lisp_malloc (sizeof *symbol_block,
-						      MEM_TYPE_SYMBOL);
-  symbol_block->next = 0;
-  bzero ((char *) symbol_block->symbols, sizeof symbol_block->symbols);
-  symbol_block_index = 0;
+  symbol_block = NULL;
+  symbol_block_index = SYMBOL_BLOCK_SIZE;
   symbol_free_list = 0;
-  n_symbol_blocks = 1;
+  n_symbol_blocks = 0;
 }
 
 
@@ -2854,13 +2847,11 @@
 void
 init_marker ()
 {
-  marker_block = (struct marker_block *) lisp_malloc (sizeof *marker_block,
-						      MEM_TYPE_MISC);
-  marker_block->next = 0;
-  bzero ((char *) marker_block->markers, sizeof marker_block->markers);
-  marker_block_index = 0;
+  marker_block = NULL;
+  marker_block_index = MARKER_BLOCK_SIZE;
   marker_free_list = 0;
-  n_marker_blocks = 1;
+  n_marker_blocks = 0;
+  fprintf(stderr, "union Lisp_Misc = %d\n", sizeof (union Lisp_Misc));
 }
 
 /* Return a newly allocated Lisp_Misc object, with no substructure.  */
@@ -4395,12 +4386,7 @@
 
   /* clear_marks (); */
 
-  /* Mark all the special slots that serve as the roots of accessibility.
-
-     Usually the special slots to mark are contained in particular structures.
-     Then we know no slot is marked twice because the structures don't overlap.
-     In some cases, the structures point to the slots to be marked.
-     For these, we use MARKBIT to avoid double marking of the slot.  */
+  /* Mark all the special slots that serve as the roots of accessibility.  */
 
   for (i = 0; i < staticidx; i++)
     mark_object (*staticvec[i]);
@@ -4413,11 +4399,7 @@
     register struct gcpro *tail;
     for (tail = gcprolist; tail; tail = tail->next)
       for (i = 0; i < tail->nvars; i++)
-	if (!XMARKBIT (tail->var[i]))
-	  {
-	    mark_object (tail->var[i]);
-	    XMARK (tail->var[i]);
-	  }
+	mark_object (tail->var[i]);
   }
 #endif
 
@@ -4439,21 +4421,14 @@
     }
   for (backlist = backtrace_list; backlist; backlist = backlist->next)
     {
-      if (!XMARKBIT (*backlist->function))
-	{
-	  mark_object (*backlist->function);
-	  XMARK (*backlist->function);
-	}
+      mark_object (*backlist->function);
+
       if (backlist->nargs == UNEVALLED || backlist->nargs == MANY)
 	i = 0;
       else
 	i = backlist->nargs - 1;
       for (; i >= 0; i--)
-	if (!XMARKBIT (backlist->args[i]))
-	  {
-	    mark_object (backlist->args[i]);
-	    XMARK (backlist->args[i]);
-	  }
+	mark_object (backlist->args[i]);
     }
   mark_kboards ();
 
@@ -4519,24 +4494,10 @@
      || GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES)
   {
     register struct gcpro *tail;
-
-    for (tail = gcprolist; tail; tail = tail->next)
-      for (i = 0; i < tail->nvars; i++)
-	XUNMARK (tail->var[i]);
   }
 #endif
 
   unmark_byte_stack ();
-  for (backlist = backtrace_list; backlist; backlist = backlist->next)
-    {
-      XUNMARK (*backlist->function);
-      if (backlist->nargs == UNEVALLED || backlist->nargs == MANY)
-	i = 0;
-      else
-	i = backlist->nargs - 1;
-      for (; i >= 0; i--)
-	XUNMARK (backlist->args[i]);
-    }
   VECTOR_UNMARK (&buffer_defaults);
   VECTOR_UNMARK (&buffer_local_symbols);
 
@@ -4721,7 +4682,6 @@
   int cdr_count = 0;
 
  loop:
-  XUNMARK (obj);
 
   if (PURE_POINTER_P (XPNTR (obj)))
     return;