diff options
| author | Stefan Monnier | 2003-07-09 20:31:19 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-07-09 20:31:19 +0000 |
| commit | 5f6bf5fecb9eb6e8448adabad1c4e0d7b7c841e4 (patch) | |
| tree | fddc85791275ab7755157729bdc30d579ac3736e | |
| parent | f209c999c0431d9c48c2efc089d4e5757df583c7 (diff) | |
| download | emacs-5f6bf5fecb9eb6e8448adabad1c4e0d7b7c841e4.tar.gz emacs-5f6bf5fecb9eb6e8448adabad1c4e0d7b7c841e4.zip | |
(VALBITS): Define in terms of GCTYPEBITS.
(struct interval): Move to intervals.h.
(struct Lisp_Marker): Use EMACS_INT for position info.
(forward_point): Remove prototype of defunct function.
(Qmodification_hooks, Qrear_nonsticky, Fnext_property_change)
(Fget_text_property, Fset_text_properties, Ftext_propertes_not_all)
(syms_of_textprop, set_text_properties): Remove prototypes that are
already in intervals.h.
| -rw-r--r-- | src/ChangeLog | 19 | ||||
| -rw-r--r-- | src/lisp.h | 83 |
2 files changed, 30 insertions, 72 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index dd9d9cecb26..9c2d4cb2348 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,24 @@ | |||
| 1 | 2003-07-09 Stefan Monnier <monnier@cs.yale.edu> | 1 | 2003-07-09 Stefan Monnier <monnier@cs.yale.edu> |
| 2 | 2 | ||
| 3 | * lisp.h (VALBITS): Define in terms of GCTYPEBITS. | ||
| 4 | (struct interval): Move to intervals.h. | ||
| 5 | (struct Lisp_Marker): Use EMACS_INT for position info. | ||
| 6 | (forward_point): Remove prototype of defunct function. | ||
| 7 | (Qmodification_hooks, Qrear_nonsticky, Fnext_property_change) | ||
| 8 | (Fget_text_property, Fset_text_properties, Ftext_propertes_not_all) | ||
| 9 | (syms_of_textprop, set_text_properties): Remove prototypes that are | ||
| 10 | already in intervals.h. | ||
| 11 | |||
| 12 | * intervals.h (struct interval): Move from lisp.h. | ||
| 13 | Use EMACS_INT for position and size info. | ||
| 14 | |||
| 15 | * coding.c: Include intervals.h for Fset_text_properties. | ||
| 16 | |||
| 17 | * buffer.h (struct buffer_text, struct buffer): Use EMACS_INT for | ||
| 18 | position and length information. | ||
| 19 | |||
| 20 | 2003-07-09 Stefan Monnier <monnier@cs.yale.edu> | ||
| 21 | |||
| 3 | Change overlays_after and overlays_before so the overlays themselves | 22 | Change overlays_after and overlays_before so the overlays themselves |
| 4 | are linked into lists, rather than using cons cells. After all each | 23 | are linked into lists, rather than using cons cells. After all each |
| 5 | Lisp_Misc already occupies 5 words, so we can add a `next' field to | 24 | Lisp_Misc already occupies 5 words, so we can add a `next' field to |
diff --git a/src/lisp.h b/src/lisp.h index be3d2adfad4..a79f34386f8 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -154,15 +154,16 @@ enum Lisp_Misc_Type | |||
| 154 | Lisp_Misc_Limit | 154 | Lisp_Misc_Limit |
| 155 | }; | 155 | }; |
| 156 | 156 | ||
| 157 | /* These values are overridden by the m- file on some machines. */ | ||
| 158 | #ifndef VALBITS | ||
| 159 | #define VALBITS (BITS_PER_EMACS_INT - 4) | ||
| 160 | #endif | ||
| 161 | |||
| 162 | #ifndef GCTYPEBITS | 157 | #ifndef GCTYPEBITS |
| 163 | #define GCTYPEBITS 3 | 158 | #define GCTYPEBITS 3 |
| 164 | #endif | 159 | #endif |
| 165 | 160 | ||
| 161 | /* These values are overridden by the m- file on some machines. */ | ||
| 162 | #ifndef VALBITS | ||
| 163 | /* The -1 is for the markbit. */ | ||
| 164 | #define VALBITS (BITS_PER_EMACS_INT - GCTYPEBITS - 1) | ||
| 165 | #endif | ||
| 166 | |||
| 166 | #ifndef NO_UNION_TYPE | 167 | #ifndef NO_UNION_TYPE |
| 167 | 168 | ||
| 168 | #ifndef WORDS_BIG_ENDIAN | 169 | #ifndef WORDS_BIG_ENDIAN |
| @@ -546,57 +547,7 @@ extern size_t pure_size; | |||
| 546 | bcopy (new, XSTRING (string)->data + index, count) | 547 | bcopy (new, XSTRING (string)->data + index, count) |
| 547 | 548 | ||
| 548 | 549 | ||
| 549 | /* Basic data type for use of intervals. See the macros in intervals.h. */ | 550 | /* See the macros in intervals.h. */ |
| 550 | |||
| 551 | struct interval | ||
| 552 | { | ||
| 553 | /* The first group of entries deal with the tree structure. */ | ||
| 554 | |||
| 555 | unsigned int total_length; /* Length of myself and both children. */ | ||
| 556 | unsigned int position; /* Cache of interval's character position. */ | ||
| 557 | /* This field is usually updated | ||
| 558 | simultaneously with an interval | ||
| 559 | traversal, there is no guarantee | ||
| 560 | that it is valid for a random | ||
| 561 | interval. */ | ||
| 562 | struct interval *left; /* Intervals which precede me. */ | ||
| 563 | struct interval *right; /* Intervals which succeed me. */ | ||
| 564 | |||
| 565 | /* Parent in the tree, or the Lisp_Object containing this interval tree. | ||
| 566 | |||
| 567 | The mark bit on the root interval of an interval tree says | ||
| 568 | whether we have started (and possibly finished) marking the | ||
| 569 | tree. If GC comes across an interval tree whose root's parent | ||
| 570 | field has its markbit set, it leaves the tree alone. | ||
| 571 | |||
| 572 | You'd think we could store this information in the parent object | ||
| 573 | somewhere (after all, that should be visited once and then | ||
| 574 | ignored too, right?), but strings are GC'd strangely. */ | ||
| 575 | union | ||
| 576 | { | ||
| 577 | struct interval *interval; | ||
| 578 | Lisp_Object obj; | ||
| 579 | } up; | ||
| 580 | unsigned int up_obj : 1; | ||
| 581 | |||
| 582 | unsigned gcmarkbit : 1; | ||
| 583 | |||
| 584 | /* The remaining components are `properties' of the interval. | ||
| 585 | The first four are duplicates for things which can be on the list, | ||
| 586 | for purposes of speed. */ | ||
| 587 | |||
| 588 | unsigned int write_protect : 1; /* Non-zero means can't modify. */ | ||
| 589 | unsigned int visible : 1; /* Zero means don't display. */ | ||
| 590 | unsigned int front_sticky : 1; /* Non-zero means text inserted just | ||
| 591 | before this interval goes into it. */ | ||
| 592 | unsigned int rear_sticky : 1; /* Likewise for just after it. */ | ||
| 593 | |||
| 594 | /* Properties of this interval. | ||
| 595 | The mark bit on this field says whether this particular interval | ||
| 596 | tree node has been visited. Since intervals should never be | ||
| 597 | shared, GC aborts if it seems to have visited an interval twice. */ | ||
| 598 | Lisp_Object plist; | ||
| 599 | }; | ||
| 600 | 551 | ||
| 601 | typedef struct interval *INTERVAL; | 552 | typedef struct interval *INTERVAL; |
| 602 | 553 | ||
| @@ -1085,7 +1036,6 @@ struct Lisp_Free | |||
| 1085 | union Lisp_Misc *chain; | 1036 | union Lisp_Misc *chain; |
| 1086 | }; | 1037 | }; |
| 1087 | 1038 | ||
| 1088 | /* In a marker, the markbit of the chain field is used as the gc mark bit. */ | ||
| 1089 | struct Lisp_Marker | 1039 | struct Lisp_Marker |
| 1090 | { | 1040 | { |
| 1091 | int type : 16; /* = Lisp_Misc_Marker */ | 1041 | int type : 16; /* = Lisp_Misc_Marker */ |
| @@ -1105,9 +1055,9 @@ struct Lisp_Marker | |||
| 1105 | this is used to chain of all the markers in a given buffer. */ | 1055 | this is used to chain of all the markers in a given buffer. */ |
| 1106 | struct Lisp_Marker *next; | 1056 | struct Lisp_Marker *next; |
| 1107 | /* This is the char position where the marker points. */ | 1057 | /* This is the char position where the marker points. */ |
| 1108 | int charpos; | 1058 | EMACS_INT charpos; |
| 1109 | /* This is the byte position. */ | 1059 | /* This is the byte position. */ |
| 1110 | int bytepos; | 1060 | EMACS_INT bytepos; |
| 1111 | }; | 1061 | }; |
| 1112 | 1062 | ||
| 1113 | /* Forwarding pointer to an int variable. | 1063 | /* Forwarding pointer to an int variable. |
| @@ -1217,8 +1167,7 @@ struct Lisp_Buffer_Local_Value | |||
| 1217 | Lisp_Object cdr; | 1167 | Lisp_Object cdr; |
| 1218 | }; | 1168 | }; |
| 1219 | 1169 | ||
| 1220 | /* In an overlay object, the mark bit of the plist is used as the GC mark. | 1170 | /* START and END are markers in the overlay's buffer, and |
| 1221 | START and END are markers in the overlay's buffer, and | ||
| 1222 | PLIST is the overlay's property list. */ | 1171 | PLIST is the overlay's property list. */ |
| 1223 | struct Lisp_Overlay | 1172 | struct Lisp_Overlay |
| 1224 | { | 1173 | { |
| @@ -2172,7 +2121,6 @@ extern void swap_in_global_binding P_ ((Lisp_Object)); | |||
| 2172 | EXFUN (Fend_of_line, 1); | 2121 | EXFUN (Fend_of_line, 1); |
| 2173 | EXFUN (Fforward_char, 1); | 2122 | EXFUN (Fforward_char, 1); |
| 2174 | EXFUN (Fforward_line, 1); | 2123 | EXFUN (Fforward_line, 1); |
| 2175 | extern int forward_point P_ ((int)); | ||
| 2176 | extern int internal_self_insert P_ ((int, int)); | 2124 | extern int internal_self_insert P_ ((int, int)); |
| 2177 | extern void syms_of_cmds P_ ((void)); | 2125 | extern void syms_of_cmds P_ ((void)); |
| 2178 | extern void keys_of_cmds P_ ((void)); | 2126 | extern void keys_of_cmds P_ ((void)); |
| @@ -3010,28 +2958,19 @@ extern void record_property_change P_ ((int, int, Lisp_Object, Lisp_Object, | |||
| 3010 | extern void syms_of_undo P_ ((void)); | 2958 | extern void syms_of_undo P_ ((void)); |
| 3011 | 2959 | ||
| 3012 | /* defined in textprop.c */ | 2960 | /* defined in textprop.c */ |
| 3013 | extern Lisp_Object Qmodification_hooks; | 2961 | extern Lisp_Object Qfont, Qmouse_face; |
| 3014 | extern Lisp_Object Qrear_nonsticky, Qfont, Qmouse_face; | ||
| 3015 | extern Lisp_Object Qinsert_in_front_hooks, Qinsert_behind_hooks; | 2962 | extern Lisp_Object Qinsert_in_front_hooks, Qinsert_behind_hooks; |
| 3016 | EXFUN (Fnext_property_change, 3); | ||
| 3017 | EXFUN (Fnext_single_property_change, 4); | 2963 | EXFUN (Fnext_single_property_change, 4); |
| 3018 | EXFUN (Fnext_single_char_property_change, 4); | 2964 | EXFUN (Fnext_single_char_property_change, 4); |
| 3019 | EXFUN (Fprevious_single_property_change, 4); | 2965 | EXFUN (Fprevious_single_property_change, 4); |
| 3020 | EXFUN (Fget_text_property, 3); | ||
| 3021 | EXFUN (Fput_text_property, 5); | 2966 | EXFUN (Fput_text_property, 5); |
| 3022 | EXFUN (Fset_text_properties, 4); | ||
| 3023 | EXFUN (Ftext_property_not_all, 5); | ||
| 3024 | EXFUN (Fprevious_char_property_change, 2); | 2967 | EXFUN (Fprevious_char_property_change, 2); |
| 3025 | EXFUN (Fnext_char_property_change, 2); | 2968 | EXFUN (Fnext_char_property_change, 2); |
| 3026 | extern void report_interval_modification P_ ((Lisp_Object, Lisp_Object)); | 2969 | extern void report_interval_modification P_ ((Lisp_Object, Lisp_Object)); |
| 3027 | extern void syms_of_textprop P_ ((void)); | ||
| 3028 | extern Lisp_Object next_single_char_property_change P_ ((Lisp_Object, | 2970 | extern Lisp_Object next_single_char_property_change P_ ((Lisp_Object, |
| 3029 | Lisp_Object, | 2971 | Lisp_Object, |
| 3030 | Lisp_Object, | 2972 | Lisp_Object, |
| 3031 | Lisp_Object)); | 2973 | Lisp_Object)); |
| 3032 | extern Lisp_Object set_text_properties P_ ((Lisp_Object, Lisp_Object, | ||
| 3033 | Lisp_Object, Lisp_Object, | ||
| 3034 | Lisp_Object)); | ||
| 3035 | 2974 | ||
| 3036 | /* defined in xmenu.c */ | 2975 | /* defined in xmenu.c */ |
| 3037 | EXFUN (Fx_popup_menu, 2); | 2976 | EXFUN (Fx_popup_menu, 2); |