aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog14
-rw-r--r--src/lisp.h17
2 files changed, 31 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7a36b02cd67..0021ec4298b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,19 @@
12001-01-09 Gerd Moellmann <gerd@gnu.org> 12001-01-09 Gerd Moellmann <gerd@gnu.org>
2 2
3 * lisp.h (STRING_BYTES) [GC_CHECK_STRING_BYTES]: Call
4 function string_bytes.
5 (GC_CHECK_STRING_BYTES): Moved here from alloc.c.
6
7 * alloc.c (CHECK_STRING_BYTES) [GC_CHECK_STRING_BYTES]: New macro.
8 (check_sblock, string_bytes) [GC_CHECK_STRING_BYTES]: New functions.
9 (check_string_bytes) [GC_CHECK_STRING_BYTES]: Add parameter ALL_P.
10 (allocate_string) [GC_CHECK_STRING_BYTES]: Always check strings in
11 the current sblock.
12 (mark_object) [GC_CHECK_STRING_BYTES]: Use CHECK_STRING_BYTES.
13 (gc_sweep) [GC_CHECK_STRING_BYTES]: Call check_string_bytes
14 after sweeping strings, and at the end.
15 (GC_CHECK_STRING_BYTES): Moved to lisp.h.
16
3 * alloc.c (Fgarbage_collect): Use a record_unwind_protect to 17 * alloc.c (Fgarbage_collect): Use a record_unwind_protect to
4 ensure that pop_message is called. 18 ensure that pop_message is called.
5 19
diff --git a/src/lisp.h b/src/lisp.h
index f2096a5f616..b1951ea4365 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -26,6 +26,12 @@ Boston, MA 02111-1307, USA. */
26#define P_(proto) () 26#define P_(proto) ()
27#endif 27#endif
28 28
29/* Define this temporarily to hunt a bug. If defined, the size of
30 strings is redundantly recorded in sdata structures so that it can
31 be compared to the sizes recorded in Lisp strings. */
32
33#define GC_CHECK_STRING_BYTES 1
34
29 35
30/* These are default choices for the types to use. */ 36/* These are default choices for the types to use. */
31#ifdef _LP64 37#ifdef _LP64
@@ -620,9 +626,20 @@ struct Lisp_Cons
620 (XSTRING (STR)->size_byte >= 0) 626 (XSTRING (STR)->size_byte >= 0)
621 627
622/* Return the length in bytes of STR. */ 628/* Return the length in bytes of STR. */
629
630#ifdef GC_CHECK_STRING_BYTES
631
632struct Lisp_String;
633extern int string_bytes P_ ((struct Lisp_String *));
634#define STRING_BYTES(S) string_bytes ((S))
635
636#else /* not GC_CHECK_STRING_BYTES */
637
623#define STRING_BYTES(STR) \ 638#define STRING_BYTES(STR) \
624 ((STR)->size_byte < 0 ? (STR)->size : (STR)->size_byte) 639 ((STR)->size_byte < 0 ? (STR)->size : (STR)->size_byte)
625 640
641#endif /* not GC_CHECK_STRING_BYTES */
642
626/* Set the length in bytes of STR. */ 643/* Set the length in bytes of STR. */
627#define SET_STRING_BYTES(STR, SIZE) ((STR)->size_byte = (SIZE)) 644#define SET_STRING_BYTES(STR, SIZE) ((STR)->size_byte = (SIZE))
628 645