aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorKen Raeburn2000-03-29 22:14:34 +0000
committerKen Raeburn2000-03-29 22:14:34 +0000
commite0b8c689e2b1d80da6ed235ae400ad10d117b706 (patch)
treef54bb195d821f61b0f7c3fbf4eae79b72978fdbe /src/alloc.c
parent141384bdd2a332b79b36d118cd13becaf0b326b9 (diff)
downloademacs-e0b8c689e2b1d80da6ed235ae400ad10d117b706.tar.gz
emacs-e0b8c689e2b1d80da6ed235ae400ad10d117b706.zip
Stop assuming interval pointers and lisp objects can be distinguished by
inspection. Beginnings of support for expensive internal consistency checks. * config.in (ENABLE_CHECKING): Undef. * lisp.h (struct interval): Replace "parent" field with a union of interval pointer and Lisp_Object; add new bitfield to use as discriminant. Change other flag fields to bitfields. (CHECK): New macro for consistency checking. If ENABLE_CHECKING is defined and the supplied test fails, print a message and abort. (eassert): New macro. Use CHECK to provide an assert-like facility. * intervals.h (NULL_INTERVAL_P): Now applies only to real interval pointers; abort if the value looks like a lisp object. (NULL_INTERVAL_P, NULL_PARENT, HAS_PARENT, HAS_OBJECT, SET_PARENT, SET_OBJECT, INTERVAL_PARENT, GET_INTERVAL_OBJECT, COPY_PARENT): Modify for new interval parent definition. * alloc.c (mark_interval_tree, MARK_INTERVAL_TREE, UNMARK_BALANCE_INTERVALS): Update references that need an addressable lisp object in the interval structure. (die): New function. (suppress_checking): New variable. * intervals.c (interval_start_pos): Just return 0 if there's no parent object.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/alloc.c b/src/alloc.c
index d7e4214c6c4..3b5d0e57ace 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -766,7 +766,7 @@ mark_interval_tree (tree)
766 766
767 /* XMARK expands to an assignment; the LHS of an assignment can't be 767 /* XMARK expands to an assignment; the LHS of an assignment can't be
768 a cast. */ 768 a cast. */
769 XMARK (* (Lisp_Object *) &tree->parent); 769 XMARK (tree->up.obj);
770 770
771 traverse_intervals (tree, 1, 0, mark_interval, Qnil); 771 traverse_intervals (tree, 1, 0, mark_interval, Qnil);
772} 772}
@@ -777,7 +777,7 @@ mark_interval_tree (tree)
777#define MARK_INTERVAL_TREE(i) \ 777#define MARK_INTERVAL_TREE(i) \
778 do { \ 778 do { \
779 if (!NULL_INTERVAL_P (i) \ 779 if (!NULL_INTERVAL_P (i) \
780 && ! XMARKBIT (*(Lisp_Object *) &i->parent)) \ 780 && ! XMARKBIT (i->up.obj)) \
781 mark_interval_tree (i); \ 781 mark_interval_tree (i); \
782 } while (0) 782 } while (0)
783 783
@@ -790,7 +790,7 @@ mark_interval_tree (tree)
790 do { \ 790 do { \
791 if (! NULL_INTERVAL_P (i)) \ 791 if (! NULL_INTERVAL_P (i)) \
792 { \ 792 { \
793 XUNMARK (* (Lisp_Object *) (&(i)->parent)); \ 793 XUNMARK ((i)->up.obj); \
794 (i) = balance_intervals (i); \ 794 (i) = balance_intervals (i); \
795 } \ 795 } \
796 } while (0) 796 } while (0)
@@ -4649,6 +4649,18 @@ Frames, windows, buffers, and subprocesses count as vectors\n\
4649 4649
4650 return Flist (8, consed); 4650 return Flist (8, consed);
4651} 4651}
4652
4653int suppress_checking;
4654void
4655die (msg, file, line)
4656 const char *msg;
4657 const char *file;
4658 int line;
4659{
4660 fprintf (stderr, "\r\nEmacs fatal error: %s:%d: %s\r\n",
4661 file, line, msg);
4662 abort ();
4663}
4652 4664
4653/* Initialization */ 4665/* Initialization */
4654 4666