aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2003-09-11 23:52:41 +0000
committerStefan Monnier2003-09-11 23:52:41 +0000
commit31003b9e540b55d23ff2c00c7a71d0eec3a24e16 (patch)
tree55f923adfb3dcaf00c157f1917ef9b58cdb345bf /src
parent1aad248540c6e1d18f7138434cac3666f52308c1 (diff)
downloademacs-31003b9e540b55d23ff2c00c7a71d0eec3a24e16.tar.gz
emacs-31003b9e540b55d23ff2c00c7a71d0eec3a24e16.zip
(VALBITS): Don't remove 1 for the markbit.
(union Lisp_Object): Use unsigned int for types. Remove markbit. (MARKBIT): Remove 1 from VALBITS so we still use same old val. (XTYPE): Use unsigned right-shift. (XMARKBIT, XMARK, XUNMARK): Remove.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/lisp.h43
2 files changed, 13 insertions, 36 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 380d0d208f6..cd233fe2811 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,11 @@
12003-09-11 Stefan Monnier <monnier@iro.umontreal.ca> 12003-09-11 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * lisp.h (VALBITS): Don't remove 1 for the markbit.
4 (union Lisp_Object): Use unsigned int for types. Remove markbit.
5 (MARKBIT): Remove 1 from VALBITS so we still use same old val.
6 (XTYPE): Use unsigned right-shift.
7 (XMARKBIT, XMARK, XUNMARK): Remove.
8
3 * alloc.c (init_intervals, init_symbol, init_marker): 9 * alloc.c (init_intervals, init_symbol, init_marker):
4 Don't preallocate anything. 10 Don't preallocate anything.
5 (Fgarbage_collect, mark_object): Ignore the markbit. 11 (Fgarbage_collect, mark_object): Ignore the markbit.
diff --git a/src/lisp.h b/src/lisp.h
index aaa555e4fc0..df22444560b 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -163,8 +163,7 @@ enum Lisp_Misc_Type
163 163
164/* These values are overridden by the m- file on some machines. */ 164/* These values are overridden by the m- file on some machines. */
165#ifndef VALBITS 165#ifndef VALBITS
166/* The -1 is for the markbit. */ 166#define VALBITS (BITS_PER_EMACS_INT - GCTYPEBITS)
167#define VALBITS (BITS_PER_EMACS_INT - GCTYPEBITS - 1)
168#endif 167#endif
169 168
170#ifndef NO_UNION_TYPE 169#ifndef NO_UNION_TYPE
@@ -183,20 +182,17 @@ union Lisp_Object
183 struct 182 struct
184 { 183 {
185 EMACS_INT val : VALBITS; 184 EMACS_INT val : VALBITS;
186 EMACS_INT type : GCTYPEBITS + 1; 185 EMACS_UINT type : GCTYPEBITS;
187 } s; 186 } s;
188 struct 187 struct
189 { 188 {
190 EMACS_UINT val : VALBITS; 189 EMACS_UINT val : VALBITS;
191 EMACS_INT type : GCTYPEBITS + 1; 190 EMACS_UINT type : GCTYPEBITS;
192 } u; 191 } u;
193 struct 192 struct
194 { 193 {
195 EMACS_UINT val : VALBITS; 194 EMACS_UINT val : VALBITS;
196 enum Lisp_Type type : GCTYPEBITS; 195 enum Lisp_Type type : GCTYPEBITS;
197 /* The markbit is not really part of the value of a Lisp_Object,
198 and is always zero except during garbage collection. */
199 EMACS_UINT markbit : 1;
200 } gu; 196 } gu;
201 } 197 }
202Lisp_Object; 198Lisp_Object;
@@ -212,19 +208,16 @@ union Lisp_Object
212 208
213 struct 209 struct
214 { 210 {
215 EMACS_INT type : GCTYPEBITS+1; 211 EMACS_UINT type : GCTYPEBITS;
216 EMACS_INT val : VALBITS; 212 EMACS_INT val : VALBITS;
217 } s; 213 } s;
218 struct 214 struct
219 { 215 {
220 EMACS_INT type : GCTYPEBITS+1; 216 EMACS_UINT type : GCTYPEBITS;
221 EMACS_UINT val : VALBITS; 217 EMACS_UINT val : VALBITS;
222 } u; 218 } u;
223 struct 219 struct
224 { 220 {
225 /* The markbit is not really part of the value of a Lisp_Object,
226 and is always zero except during garbage collection. */
227 EMACS_UINT markbit : 1;
228 enum Lisp_Type type : GCTYPEBITS; 221 enum Lisp_Type type : GCTYPEBITS;
229 EMACS_UINT val : VALBITS; 222 EMACS_UINT val : VALBITS;
230 } gu; 223 } gu;
@@ -269,7 +262,7 @@ LISP_MAKE_RVALUE (Lisp_Object o)
269 Likewise in the type slot of a float and in the size slot of strings. */ 262 Likewise in the type slot of a float and in the size slot of strings. */
270 263
271#ifndef MARKBIT 264#ifndef MARKBIT
272#define MARKBIT ((EMACS_INT) ((EMACS_UINT) 1 << (VALBITS + GCTYPEBITS))) 265#define MARKBIT ((EMACS_INT) ((EMACS_UINT) 1 << (VALBITS + GCTYPEBITS - 1)))
273#endif /*MARKBIT */ 266#endif /*MARKBIT */
274 267
275/* In the size word of a vector, this bit means the vector has been marked. */ 268/* In the size word of a vector, this bit means the vector has been marked. */
@@ -323,7 +316,7 @@ enum pvec_type
323 on all machines, but would penalize machines which don't need it) 316 on all machines, but would penalize machines which don't need it)
324 */ 317 */
325#ifndef XTYPE 318#ifndef XTYPE
326#define XTYPE(a) ((enum Lisp_Type) ((a) >> VALBITS)) 319#define XTYPE(a) ((enum Lisp_Type) (((EMACS_UINT) (a)) >> VALBITS))
327#endif 320#endif
328 321
329#ifndef XSETTYPE 322#ifndef XSETTYPE
@@ -373,25 +366,6 @@ enum pvec_type
373#define XGCTYPE(a) ((enum Lisp_Type) (((a) >> VALBITS) & GCTYPEMASK)) 366#define XGCTYPE(a) ((enum Lisp_Type) (((a) >> VALBITS) & GCTYPEMASK))
374#endif 367#endif
375 368
376#if VALBITS + GCTYPEBITS == BITS_PER_EMACS_INT - 1
377/* Make XMARKBIT faster if mark bit is sign bit. */
378#ifndef XMARKBIT
379#define XMARKBIT(a) ((a) < 0)
380#endif
381#endif /* markbit is sign bit */
382
383#ifndef XMARKBIT
384#define XMARKBIT(a) ((a) & MARKBIT)
385#endif
386
387#ifndef XMARK
388#define XMARK(a) ((a) |= MARKBIT)
389#endif
390
391#ifndef XUNMARK
392#define XUNMARK(a) ((a) &= ~MARKBIT)
393#endif
394
395#endif /* NO_UNION_TYPE */ 369#endif /* NO_UNION_TYPE */
396 370
397#ifndef NO_UNION_TYPE 371#ifndef NO_UNION_TYPE
@@ -432,9 +406,6 @@ extern Lisp_Object make_number ();
432 Outside of garbage collection, all mark bits are always zero. */ 406 Outside of garbage collection, all mark bits are always zero. */
433 407
434#define XGCTYPE(a) ((a).gu.type) 408#define XGCTYPE(a) ((a).gu.type)
435#define XMARKBIT(a) ((a).gu.markbit)
436#define XMARK(a) (XMARKBIT(a) = 1)
437#define XUNMARK(a) (XMARKBIT(a) = 0)
438 409
439#endif /* NO_UNION_TYPE */ 410#endif /* NO_UNION_TYPE */
440 411