emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r108960: Move marker debugging code u


From: Dmitry Antipov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108960: Move marker debugging code under MARKER_DEBUG.
Date: Mon, 09 Jul 2012 07:15:10 +0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108960
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Mon 2012-07-09 07:15:10 +0400
message:
  Move marker debugging code under MARKER_DEBUG.
  * marker.c (MARKER_DEBUG): Move marker debugging code under
  #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
  for bootstrap with --enable-checking (~3x slowdown reported
  by Juanma Barranquero <address@hidden>).
  (verify_bytepos): Move under #ifdef MARKER_DEBUG.
modified:
  src/ChangeLog
  src/marker.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-07-08 23:00:38 +0000
+++ b/src/ChangeLog     2012-07-09 03:15:10 +0000
@@ -1,3 +1,12 @@
+2012-07-09  Dmitry Antipov  <address@hidden>
+
+       Move marker debugging code under MARKER_DEBUG.
+       * marker.c (MARKER_DEBUG): Move marker debugging code under
+       #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
+       for bootstrap with --enable-checking (~3x slowdown reported
+       by Juanma Barranquero <address@hidden>).
+       (verify_bytepos): Move under #ifdef MARKER_DEBUG.
+
 2012-07-08  Paul Eggert  <address@hidden>
 
        * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.

=== modified file 'src/marker.c'
--- a/src/marker.c      2012-07-06 14:16:54 +0000
+++ b/src/marker.c      2012-07-09 03:15:10 +0000
@@ -31,9 +31,14 @@
 static struct buffer *cached_buffer;
 static int cached_modiff;
 
-#ifdef ENABLE_CHECKING
+/* Juanma Barranquero <address@hidden> reported ~3x increased
+   bootstrap time when byte_char_debug_check is enabled; so this
+   is never turned on by --enable-checking configure option.  */
+
+#ifdef MARKER_DEBUG
 
 extern int count_markers (struct buffer *) EXTERNALLY_VISIBLE;
+extern ptrdiff_t verify_bytepos (ptrdiff_t charpos) EXTERNALLY_VISIBLE;
 
 static void
 byte_char_debug_check (struct buffer *b, ptrdiff_t charpos, ptrdiff_t bytepos)
@@ -57,11 +62,11 @@
     abort ();
 }
 
-#else /* not ENABLE_CHECKING */
+#else /* not MARKER_DEBUG */
 
 #define byte_char_debug_check(b,charpos,bytepos) do { } while (0)
 
-#endif /* ENABLE_CHECKING */
+#endif /* MARKER_DEBUG */
  
 void
 clear_charpos_cache (struct buffer *b)
@@ -237,25 +242,6 @@
 
 #undef CONSIDER
 
-/* Used for debugging: recompute the bytepos corresponding to CHARPOS
-   in the simplest, most reliable way.  */
-
-extern ptrdiff_t verify_bytepos (ptrdiff_t charpos) EXTERNALLY_VISIBLE;
-ptrdiff_t
-verify_bytepos (ptrdiff_t charpos)
-{
-  ptrdiff_t below = 1;
-  ptrdiff_t below_byte = 1;
-
-  while (below != charpos)
-    {
-      below++;
-      BUF_INC_POS (current_buffer, below_byte);
-    }
-
-  return below_byte;
-}
-
 /* buf_bytepos_to_charpos returns the char position corresponding to
    BYTEPOS.  */
 
@@ -781,7 +767,7 @@
   return Qnil;
 }
 
-#ifdef ENABLE_CHECKING
+#ifdef MARKER_DEBUG
 
 /* For debugging -- count the markers in buffer BUF.  */
 
@@ -797,7 +783,25 @@
   return total;
 }
 
-#endif /* ENABLE_CHECKING */
+/* For debugging -- recompute the bytepos corresponding
+   to CHARPOS in the simplest, most reliable way.  */
+
+ptrdiff_t
+verify_bytepos (ptrdiff_t charpos)
+{
+  ptrdiff_t below = 1;
+  ptrdiff_t below_byte = 1;
+
+  while (below != charpos)
+    {
+      below++;
+      BUF_INC_POS (current_buffer, below_byte);
+    }
+
+  return below_byte;
+}
+
+#endif /* MARKER_DEBUG */
 
 void
 syms_of_marker (void)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]