]> code.delx.au - gnu-emacs/blobdiff - src/textprop.c
Assume GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS
[gnu-emacs] / src / textprop.c
index f6dbab09228b1cc412475ab9f4d561b1dc8279bf..3f7c8d106395e9b446946eec56a880a83ab647a7 100644 (file)
@@ -375,15 +375,10 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object,
 {
   Lisp_Object tail1, tail2, sym1, val1;
   bool changed = false;
-  struct gcpro gcpro1, gcpro2, gcpro3;
 
   tail1 = plist;
   sym1 = Qnil;
   val1 = Qnil;
-  /* No need to protect OBJECT, because we can GC only in the case
-     where it is a buffer, and live buffers are always protected.
-     I and its plist are also protected, via OBJECT.  */
-  GCPRO3 (tail1, sym1, val1);
 
   /* Go through each element of PLIST.  */
   for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
@@ -396,9 +391,7 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object,
       for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
        if (EQ (sym1, XCAR (tail2)))
          {
-           /* No need to gcpro, because tail2 protects this
-              and it must be a cons cell (we get an error otherwise).  */
-           register Lisp_Object this_cdr;
+           Lisp_Object this_cdr;
 
            this_cdr = XCDR (tail2);
            /* Found the property.  Now check its value.  */
@@ -456,8 +449,6 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object,
        }
     }
 
-  UNGCPRO;
-
   return changed;
 }
 
@@ -1160,7 +1151,6 @@ add_text_properties_1 (Lisp_Object start, Lisp_Object end,
   INTERVAL i, unchanged;
   ptrdiff_t s, len;
   bool modified = false;
-  struct gcpro gcpro1;
   bool first_time = true;
 
   properties = validate_plist (properties);
@@ -1178,10 +1168,6 @@ add_text_properties_1 (Lisp_Object start, Lisp_Object end,
   s = XINT (start);
   len = XINT (end) - s;
 
-  /* No need to protect OBJECT, because we GC only if it's a buffer,
-     and live buffers are always protected.  */
-  GCPRO1 (properties);
-
   /* If this interval already has the properties, we can skip it.  */
   if (interval_has_all_properties (properties, i))
     {
@@ -1190,7 +1176,7 @@ add_text_properties_1 (Lisp_Object start, Lisp_Object end,
       do
        {
          if (got >= len)
-           RETURN_UNGCPRO (Qnil);
+           return Qnil;
          len -= got;
          i = next_interval (i);
          got = LENGTH (i);
@@ -1233,11 +1219,6 @@ add_text_properties_1 (Lisp_Object start, Lisp_Object end,
 
       if (LENGTH (i) >= len)
        {
-         /* We can UNGCPRO safely here, because there will be just
-            one more chance to gc, in the next call to add_properties,
-            and after that we will not need PROPERTIES or OBJECT again.  */
-         UNGCPRO;
-
          if (interval_has_all_properties (properties, i))
            {
              if (BUFFERP (object))
@@ -1906,7 +1887,6 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src,
   Lisp_Object plist;
   ptrdiff_t s, e, e2, p, len;
   bool modified = false;
-  struct gcpro gcpro1, gcpro2;
 
   i = validate_interval_range (src, &start, &end, soft);
   if (!i)
@@ -1964,8 +1944,6 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src,
       s = i->position;
     }
 
-  GCPRO2 (stuff, dest);
-
   while (! NILP (stuff))
     {
       res = Fcar (stuff);
@@ -1976,8 +1954,6 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src,
       stuff = Fcdr (stuff);
     }
 
-  UNGCPRO;
-
   return modified ? Qt : Qnil;
 }
 
@@ -2047,10 +2023,6 @@ text_property_list (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp
 void
 add_text_properties_from_list (Lisp_Object object, Lisp_Object list, Lisp_Object delta)
 {
-  struct gcpro gcpro1, gcpro2;
-
-  GCPRO2 (list, object);
-
   for (; CONSP (list); list = XCDR (list))
     {
       Lisp_Object item, start, end, plist;
@@ -2062,8 +2034,6 @@ add_text_properties_from_list (Lisp_Object object, Lisp_Object list, Lisp_Object
 
       Fadd_text_properties (start, end, plist, object);
     }
-
-  UNGCPRO;
 }
 
 
@@ -2111,14 +2081,11 @@ extend_property_ranges (Lisp_Object list, Lisp_Object new_end)
 static void
 call_mod_hooks (Lisp_Object list, Lisp_Object start, Lisp_Object end)
 {
-  struct gcpro gcpro1;
-  GCPRO1 (list);
   while (!NILP (list))
     {
       call2 (Fcar (list), start, end);
       list = Fcdr (list);
     }
-  UNGCPRO;
 }
 
 /* Check for read-only intervals between character positions START ... END,
@@ -2138,7 +2105,6 @@ verify_interval_modification (struct buffer *buf,
   Lisp_Object hooks;
   Lisp_Object prev_mod_hooks;
   Lisp_Object mod_hooks;
-  struct gcpro gcpro1;
 
   hooks = Qnil;
   prev_mod_hooks = Qnil;
@@ -2295,7 +2261,6 @@ verify_interval_modification (struct buffer *buf,
 
       if (!inhibit_modification_hooks)
        {
-         GCPRO1 (hooks);
          hooks = Fnreverse (hooks);
          while (! EQ (hooks, Qnil))
            {
@@ -2303,7 +2268,6 @@ verify_interval_modification (struct buffer *buf,
                              make_number (end));
              hooks = Fcdr (hooks);
            }
-         UNGCPRO;
        }
     }
 }