changeset 35184:07ec5658a7a5

(STRING_BYTES) [GC_CHECK_STRING_BYTES]: Call function string_bytes. (GC_CHECK_STRING_BYTES): Moved here from alloc.c.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 09 Jan 2001 20:11:16 +0000
parents cc2a06489f0d
children d6427b0a4cd8
files src/lisp.h
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lisp.h	Tue Jan 09 20:10:50 2001 +0000
+++ b/src/lisp.h	Tue Jan 09 20:11:16 2001 +0000
@@ -26,6 +26,12 @@
 #define P_(proto) ()
 #endif
 
+/* Define this temporarily to hunt a bug.  If defined, the size of
+   strings is redundantly recorded in sdata structures so that it can
+   be compared to the sizes recorded in Lisp strings.  */
+
+#define GC_CHECK_STRING_BYTES 1
+
 
 /* These are default choices for the types to use.  */
 #ifdef _LP64
@@ -620,9 +626,20 @@
   (XSTRING (STR)->size_byte >= 0)
 
 /* Return the length in bytes of STR.  */
+
+#ifdef GC_CHECK_STRING_BYTES
+
+struct Lisp_String;
+extern int string_bytes P_ ((struct Lisp_String *));
+#define STRING_BYTES(S) string_bytes ((S))
+
+#else /* not GC_CHECK_STRING_BYTES */
+
 #define STRING_BYTES(STR)  \
   ((STR)->size_byte < 0 ? (STR)->size : (STR)->size_byte)
 
+#endif /* not GC_CHECK_STRING_BYTES */
+
 /* Set the length in bytes of STR.  */
 #define SET_STRING_BYTES(STR, SIZE)  ((STR)->size_byte = (SIZE))