+2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
+
+ 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 <lekktu@gmail.com>).
+ (verify_bytepos): Move under #ifdef MARKER_DEBUG.
+
2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
* systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
static struct buffer *cached_buffer;
static int cached_modiff;
-#ifdef ENABLE_CHECKING
+/* Juanma Barranquero <lekktu@gmail.com> 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)
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)
#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;
-}
-\f
/* buf_bytepos_to_charpos returns the char position corresponding to
BYTEPOS. */
return Qnil;
}
-#ifdef ENABLE_CHECKING
+#ifdef MARKER_DEBUG
/* For debugging -- count the markers in buffer BUF. */
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 */
\f
void
syms_of_marker (void)