aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorStefan Monnier2009-11-06 18:47:48 +0000
committerStefan Monnier2009-11-06 18:47:48 +0000
commit2de9f71c22f9def6adaa6782eea25bc569cb8561 (patch)
tree399507700b025f007803c590ef825f5eea3f989d /src/data.c
parent7ac65b38938cdee2916350bc0b16f21a00dca444 (diff)
downloademacs-2de9f71c22f9def6adaa6782eea25bc569cb8561.tar.gz
emacs-2de9f71c22f9def6adaa6782eea25bc569cb8561.zip
Let integers use up 2 tags to give them one extra bit and double their range.
* lisp.h (USE_2_TAGS_FOR_INTS): New macro. (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P): New macros. (enum Lisp_Type): Use them. Give explicit values. (Lisp_Type_Limit): Remove. (XINT, XUINT, make_number) [!USE_LISP_UNION_TYPE]: (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK): Pay attention to USE_2_TAGS_FOR_INTS. (INTEGERP): Use LISP_INT_TAG_P. * fns.c (internal_equal): Simplify the default case. (sxhash): Use case_Lisp_Int. * data.c (wrong_type_argument): Don't check against Lisp_Type_Limit any more. (Ftype_of): Use case_Lisp_Int. (store_symval_forwarding): Take into account the fact that Ints can now have more than one tag. * buffer.c (syms_of_buffer): Use LISP_INT_TAG. buffer_slot_type_mismatch): * xfaces.c (face_attr_equal_p): * print.c (print_object): * alloc.c (mark_maybe_object, mark_object, survives_gc_p): Use case_Lisp_Int.
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/data.c b/src/data.c
index fc50658dd7c..7110fb7eae7 100644
--- a/src/data.c
+++ b/src/data.c
@@ -108,10 +108,12 @@ Lisp_Object
108wrong_type_argument (predicate, value) 108wrong_type_argument (predicate, value)
109 register Lisp_Object predicate, value; 109 register Lisp_Object predicate, value;
110{ 110{
111 /* If VALUE is not even a valid Lisp object, abort here 111 /* If VALUE is not even a valid Lisp object, we'd want to abort here
112 where we can get a backtrace showing where it came from. */ 112 where we can get a backtrace showing where it came from. We used
113 if ((unsigned int) XTYPE (value) >= Lisp_Type_Limit) 113 to try and do that by checking the tagbits, but nowadays all
114 abort (); 114 tagbits are potentially valid. */
115 /* if ((unsigned int) XTYPE (value) >= Lisp_Type_Limit)
116 * abort (); */
115 117
116 xsignal2 (Qwrong_type_argument, predicate, value); 118 xsignal2 (Qwrong_type_argument, predicate, value);
117} 119}
@@ -184,7 +186,7 @@ for example, (type-of 1) returns `integer'. */)
184{ 186{
185 switch (XTYPE (object)) 187 switch (XTYPE (object))
186 { 188 {
187 case Lisp_Int: 189 case_Lisp_Int:
188 return Qinteger; 190 return Qinteger;
189 191
190 case Lisp_Symbol: 192 case Lisp_Symbol:
@@ -975,8 +977,10 @@ store_symval_forwarding (symbol, valcontents, newval, buf)
975 int offset = XBUFFER_OBJFWD (valcontents)->offset; 977 int offset = XBUFFER_OBJFWD (valcontents)->offset;
976 Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype; 978 Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype;
977 979
978 if (! NILP (type) && ! NILP (newval) 980 if (!(NILP (type) || NILP (newval)
979 && XTYPE (newval) != XINT (type)) 981 || (XINT (type) == LISP_INT_TAG
982 ? INTEGERP (newval)
983 : XTYPE (newval) == XINT (type))))
980 buffer_slot_type_mismatch (newval, XINT (type)); 984 buffer_slot_type_mismatch (newval, XINT (type));
981 985
982 if (buf == NULL) 986 if (buf == NULL)