163 |
|
|
164 |
/* These values are overridden by the m- file on some machines. */ |
/* These values are overridden by the m- file on some machines. */ |
165 |
#ifndef VALBITS |
#ifndef VALBITS |
166 |
/* The -1 is for the markbit. */ |
#define VALBITS (BITS_PER_EMACS_INT - GCTYPEBITS) |
|
#define VALBITS (BITS_PER_EMACS_INT - GCTYPEBITS - 1) |
|
167 |
#endif |
#endif |
168 |
|
|
169 |
#ifndef NO_UNION_TYPE |
#ifndef NO_UNION_TYPE |
182 |
struct |
struct |
183 |
{ |
{ |
184 |
EMACS_INT val : VALBITS; |
EMACS_INT val : VALBITS; |
185 |
EMACS_INT type : GCTYPEBITS + 1; |
EMACS_UINT type : GCTYPEBITS; |
186 |
} s; |
} s; |
187 |
struct |
struct |
188 |
{ |
{ |
189 |
EMACS_UINT val : VALBITS; |
EMACS_UINT val : VALBITS; |
190 |
EMACS_INT type : GCTYPEBITS + 1; |
EMACS_UINT type : GCTYPEBITS; |
191 |
} u; |
} u; |
192 |
struct |
struct |
193 |
{ |
{ |
194 |
EMACS_UINT val : VALBITS; |
EMACS_UINT val : VALBITS; |
195 |
enum Lisp_Type type : GCTYPEBITS; |
enum Lisp_Type type : GCTYPEBITS; |
|
/* The markbit is not really part of the value of a Lisp_Object, |
|
|
and is always zero except during garbage collection. */ |
|
|
EMACS_UINT markbit : 1; |
|
196 |
} gu; |
} gu; |
197 |
} |
} |
198 |
Lisp_Object; |
Lisp_Object; |
208 |
|
|
209 |
struct |
struct |
210 |
{ |
{ |
211 |
EMACS_INT type : GCTYPEBITS+1; |
EMACS_UINT type : GCTYPEBITS; |
212 |
EMACS_INT val : VALBITS; |
EMACS_INT val : VALBITS; |
213 |
} s; |
} s; |
214 |
struct |
struct |
215 |
{ |
{ |
216 |
EMACS_INT type : GCTYPEBITS+1; |
EMACS_UINT type : GCTYPEBITS; |
217 |
EMACS_UINT val : VALBITS; |
EMACS_UINT val : VALBITS; |
218 |
} u; |
} u; |
219 |
struct |
struct |
220 |
{ |
{ |
|
/* The markbit is not really part of the value of a Lisp_Object, |
|
|
and is always zero except during garbage collection. */ |
|
|
EMACS_UINT markbit : 1; |
|
221 |
enum Lisp_Type type : GCTYPEBITS; |
enum Lisp_Type type : GCTYPEBITS; |
222 |
EMACS_UINT val : VALBITS; |
EMACS_UINT val : VALBITS; |
223 |
} gu; |
} gu; |
262 |
Likewise in the type slot of a float and in the size slot of strings. */ |
Likewise in the type slot of a float and in the size slot of strings. */ |
263 |
|
|
264 |
#ifndef MARKBIT |
#ifndef MARKBIT |
265 |
#define MARKBIT ((EMACS_INT) ((EMACS_UINT) 1 << (VALBITS + GCTYPEBITS))) |
#define MARKBIT ((EMACS_INT) ((EMACS_UINT) 1 << (VALBITS + GCTYPEBITS - 1))) |
266 |
#endif /*MARKBIT */ |
#endif /*MARKBIT */ |
267 |
|
|
268 |
/* In the size word of a vector, this bit means the vector has been marked. */ |
/* In the size word of a vector, this bit means the vector has been marked. */ |
316 |
on all machines, but would penalize machines which don't need it) |
on all machines, but would penalize machines which don't need it) |
317 |
*/ |
*/ |
318 |
#ifndef XTYPE |
#ifndef XTYPE |
319 |
#define XTYPE(a) ((enum Lisp_Type) ((a) >> VALBITS)) |
#define XTYPE(a) ((enum Lisp_Type) (((EMACS_UINT) (a)) >> VALBITS)) |
320 |
#endif |
#endif |
321 |
|
|
322 |
#ifndef XSETTYPE |
#ifndef XSETTYPE |
366 |
#define XGCTYPE(a) ((enum Lisp_Type) (((a) >> VALBITS) & GCTYPEMASK)) |
#define XGCTYPE(a) ((enum Lisp_Type) (((a) >> VALBITS) & GCTYPEMASK)) |
367 |
#endif |
#endif |
368 |
|
|
|
#if VALBITS + GCTYPEBITS == BITS_PER_EMACS_INT - 1 |
|
|
/* Make XMARKBIT faster if mark bit is sign bit. */ |
|
|
#ifndef XMARKBIT |
|
|
#define XMARKBIT(a) ((a) < 0) |
|
|
#endif |
|
|
#endif /* markbit is sign bit */ |
|
|
|
|
|
#ifndef XMARKBIT |
|
|
#define XMARKBIT(a) ((a) & MARKBIT) |
|
|
#endif |
|
|
|
|
|
#ifndef XMARK |
|
|
#define XMARK(a) ((a) |= MARKBIT) |
|
|
#endif |
|
|
|
|
|
#ifndef XUNMARK |
|
|
#define XUNMARK(a) ((a) &= ~MARKBIT) |
|
|
#endif |
|
|
|
|
369 |
#endif /* NO_UNION_TYPE */ |
#endif /* NO_UNION_TYPE */ |
370 |
|
|
371 |
#ifndef NO_UNION_TYPE |
#ifndef NO_UNION_TYPE |
406 |
Outside of garbage collection, all mark bits are always zero. */ |
Outside of garbage collection, all mark bits are always zero. */ |
407 |
|
|
408 |
#define XGCTYPE(a) ((a).gu.type) |
#define XGCTYPE(a) ((a).gu.type) |
|
#define XMARKBIT(a) ((a).gu.markbit) |
|
|
#define XMARK(a) (XMARKBIT(a) = 1) |
|
|
#define XUNMARK(a) (XMARKBIT(a) = 0) |
|
409 |
|
|
410 |
#endif /* NO_UNION_TYPE */ |
#endif /* NO_UNION_TYPE */ |
411 |
|
|