250 |
#define LISP_MAKE_RVALUE(o) (0+(o)) |
#define LISP_MAKE_RVALUE(o) (0+(o)) |
251 |
#endif /* NO_UNION_TYPE */ |
#endif /* NO_UNION_TYPE */ |
252 |
|
|
|
#ifndef VALMASK |
|
|
#define VALMASK ((((EMACS_INT) 1)<<VALBITS) - 1) |
|
|
#endif |
|
|
#define GCTYPEMASK ((((EMACS_INT) 1)<<GCTYPEBITS) - 1) |
|
|
|
|
253 |
/* Two flags that are set during GC. On some machines, these flags |
/* Two flags that are set during GC. On some machines, these flags |
254 |
are defined differently by the m- file. */ |
are defined differently by the m- file. */ |
255 |
|
|
|
/* This is set in the car of a cons to indicate it is marked. |
|
|
Likewise in the type slot of a float and in the size slot of strings. */ |
|
|
|
|
|
#ifndef MARKBIT |
|
|
#define MARKBIT ((EMACS_INT) ((EMACS_UINT) 1 << (VALBITS + GCTYPEBITS - 1))) |
|
|
#endif /*MARKBIT */ |
|
|
|
|
256 |
/* 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. */ |
257 |
|
|
258 |
#ifndef ARRAY_MARK_FLAG |
#ifndef ARRAY_MARK_FLAG |
259 |
#define ARRAY_MARK_FLAG ((MARKBIT >> 1) & ~MARKBIT) |
#define ARRAY_MARK_FLAG ((EMACS_INT) ((EMACS_UINT) 1 << (VALBITS + GCTYPEBITS - 1))) |
260 |
#endif /* no ARRAY_MARK_FLAG */ |
#endif /* no ARRAY_MARK_FLAG */ |
261 |
|
|
262 |
/* In the size word of a struct Lisp_Vector, this bit means it's really |
/* In the size word of a struct Lisp_Vector, this bit means it's really |
299 |
|
|
300 |
#ifdef NO_UNION_TYPE |
#ifdef NO_UNION_TYPE |
301 |
|
|
302 |
|
#define VALMASK ((((EMACS_INT) 1) << VALBITS) - 1) |
303 |
|
|
304 |
/* One need to override this if there must be high bits set in data space |
/* One need to override this if there must be high bits set in data space |
305 |
(doing the result of the below & ((1 << (GCTYPE + 1)) - 1) would work |
(doing the result of the below & ((1 << (GCTYPE + 1)) - 1) would work |
306 |
on all machines, but would penalize machines which don't need it) |
on all machines, but would penalize machines which don't need it) |
307 |
*/ |
*/ |
|
#ifndef XTYPE |
|
308 |
#define XTYPE(a) ((enum Lisp_Type) (((EMACS_UINT) (a)) >> VALBITS)) |
#define XTYPE(a) ((enum Lisp_Type) (((EMACS_UINT) (a)) >> VALBITS)) |
|
#endif |
|
|
|
|
|
#ifndef XSETTYPE |
|
|
#define XSETTYPE(a, b) ((a) = XUINT (a) | ((EMACS_INT)(b) << VALBITS)) |
|
|
#endif |
|
309 |
|
|
310 |
/* For integers known to be positive, XFASTINT provides fast retrieval |
/* For integers known to be positive, XFASTINT provides fast retrieval |
311 |
and XSETFASTINT provides fast storage. This takes advantage of the |
and XSETFASTINT provides fast storage. This takes advantage of the |
312 |
fact that Lisp_Int is 0. |
fact that Lisp_Int is 0. */ |
|
Beware: XFASTINT applied to a non-positive integer or to something |
|
|
else than an integer should return something that preserves all the |
|
|
info that was in the Lisp_Object, because it is used in EQ. */ |
|
313 |
#define XFASTINT(a) ((a) + 0) |
#define XFASTINT(a) ((a) + 0) |
314 |
#define XSETFASTINT(a, b) ((a) = (b)) |
#define XSETFASTINT(a, b) ((a) = (b)) |
315 |
|
|
316 |
/* Extract the value of a Lisp_Object as a signed integer. */ |
/* Extract the value of a Lisp_Object as a signed integer. */ |
317 |
|
|
318 |
#ifndef XINT /* Some machines need to do this differently. */ |
#ifndef XINT /* Some machines need to do this differently. */ |
319 |
#define XINT(a) ((EMACS_INT) (((a) << (BITS_PER_EMACS_INT - VALBITS)) \ |
#define XINT(a) ((((EMACS_INT) (a)) << (BITS_PER_EMACS_INT - VALBITS)) \ |
320 |
>> (BITS_PER_EMACS_INT - VALBITS))) |
>> (BITS_PER_EMACS_INT - VALBITS)) |
321 |
#endif |
#endif |
322 |
|
|
323 |
/* Extract the value as an unsigned integer. This is a basis |
/* Extract the value as an unsigned integer. This is a basis |
337 |
#define make_number(N) \ |
#define make_number(N) \ |
338 |
((((EMACS_INT) (N)) & VALMASK) | ((EMACS_INT) Lisp_Int) << VALBITS) |
((((EMACS_INT) (N)) & VALMASK) | ((EMACS_INT) Lisp_Int) << VALBITS) |
339 |
|
|
340 |
/* During garbage collection, XGCTYPE must be used for extracting types |
#define EQ(x, y) ((x) == (y)) |
|
so that the mark bit is ignored. XMARKBIT accesses the markbit. |
|
|
Markbits are used only in particular slots of particular structure types. |
|
|
Other markbits are always zero. |
|
|
Outside of garbage collection, all mark bits are always zero. */ |
|
|
|
|
|
#ifndef XGCTYPE |
|
|
#define XGCTYPE(a) ((enum Lisp_Type) (((a) >> VALBITS) & GCTYPEMASK)) |
|
|
#endif |
|
|
|
|
|
#endif /* NO_UNION_TYPE */ |
|
341 |
|
|
342 |
#ifndef NO_UNION_TYPE |
#else /* not NO_UNION_TYPE */ |
343 |
|
|
344 |
#define XTYPE(a) ((enum Lisp_Type) (a).u.type) |
#define XTYPE(a) ((enum Lisp_Type) (a).u.type) |
|
#define XSETTYPE(a, b) ((a).u.type = (char) (b)) |
|
345 |
|
|
346 |
/* For integers known to be positive, XFASTINT provides fast retrieval |
/* For integers known to be positive, XFASTINT provides fast retrieval |
347 |
and XSETFASTINT provides fast storage. This takes advantage of the |
and XSETFASTINT provides fast storage. This takes advantage of the |
369 |
extern Lisp_Object make_number (); |
extern Lisp_Object make_number (); |
370 |
#endif |
#endif |
371 |
|
|
372 |
|
#define EQ(x, y) ((x).s.val == (y).s.val) |
373 |
|
|
374 |
|
#endif /* NO_UNION_TYPE */ |
375 |
|
|
376 |
/* During garbage collection, XGCTYPE must be used for extracting types |
/* During garbage collection, XGCTYPE must be used for extracting types |
377 |
so that the mark bit is ignored. XMARKBIT access the markbit. |
so that the mark bit is ignored. XMARKBIT accesses the markbit. |
378 |
Markbits are used only in particular slots of particular structure types. |
Markbits are used only in particular slots of particular structure types. |
379 |
Other markbits are always zero. |
Other markbits are always zero. |
380 |
Outside of garbage collection, all mark bits are always zero. */ |
Outside of garbage collection, all mark bits are always zero. */ |
381 |
|
|
382 |
#define XGCTYPE(a) ((a).gu.type) |
#ifndef XGCTYPE |
383 |
|
/* The distinction does not exist now that the MARKBIT has been eliminated. */ |
384 |
#endif /* NO_UNION_TYPE */ |
#define XGCTYPE(a) XTYPE (a) |
385 |
|
#endif |
386 |
|
|
387 |
#ifndef XPNTR |
#ifndef XPNTR |
388 |
#ifdef HAVE_SHM |
#ifdef HAVE_SHM |
409 |
|
|
410 |
#define MOST_NEGATIVE_FIXNUM - ((EMACS_INT) 1 << (VALBITS - 1)) |
#define MOST_NEGATIVE_FIXNUM - ((EMACS_INT) 1 << (VALBITS - 1)) |
411 |
#define MOST_POSITIVE_FIXNUM (((EMACS_INT) 1 << (VALBITS - 1)) - 1) |
#define MOST_POSITIVE_FIXNUM (((EMACS_INT) 1 << (VALBITS - 1)) - 1) |
412 |
|
/* Mask indicating the significant bits of a Lisp_Int. |
413 |
|
I.e. (x & INTMASK) == XUINT (make_number (x)). */ |
414 |
|
#define INTMASK ((((EMACS_INT) 1) << VALBITS) - 1) |
415 |
|
|
416 |
/* Value is non-zero if C integer I doesn't fit into a Lisp fixnum. */ |
/* Value is non-zero if C integer I doesn't fit into a Lisp fixnum. */ |
417 |
|
|
983 |
|
|
984 |
/* These structures are used for various misc types. */ |
/* These structures are used for various misc types. */ |
985 |
|
|
|
/* A miscellaneous object, when it's on the free list. */ |
|
|
struct Lisp_Free |
|
|
{ |
|
|
int type : 16; /* = Lisp_Misc_Free */ |
|
|
unsigned gcmarkbit : 1; |
|
|
int spacer : 15; |
|
|
union Lisp_Misc *chain; |
|
|
}; |
|
|
|
|
986 |
struct Lisp_Marker |
struct Lisp_Marker |
987 |
{ |
{ |
988 |
int type : 16; /* = Lisp_Misc_Marker */ |
int type : 16; /* = Lisp_Misc_Marker */ |
1147 |
}; |
}; |
1148 |
|
|
1149 |
|
|
1150 |
|
/* A miscellaneous object, when it's on the free list. */ |
1151 |
|
struct Lisp_Free |
1152 |
|
{ |
1153 |
|
int type : 16; /* = Lisp_Misc_Free */ |
1154 |
|
unsigned gcmarkbit : 1; |
1155 |
|
int spacer : 15; |
1156 |
|
union Lisp_Misc *chain; |
1157 |
|
}; |
1158 |
|
|
1159 |
/* To get the type field of a union Lisp_Misc, use XMISCTYPE. |
/* To get the type field of a union Lisp_Misc, use XMISCTYPE. |
1160 |
It uses one of these struct subtypes to get the type field. */ |
It uses one of these struct subtypes to get the type field. */ |
1161 |
|
|
1316 |
#define GC_NATNUMP(x) (GC_INTEGERP (x) && XINT (x) >= 0) |
#define GC_NATNUMP(x) (GC_INTEGERP (x) && XINT (x) >= 0) |
1317 |
|
|
1318 |
#define INTEGERP(x) (XTYPE ((x)) == Lisp_Int) |
#define INTEGERP(x) (XTYPE ((x)) == Lisp_Int) |
1319 |
#define GC_INTEGERP(x) (XGCTYPE ((x)) == Lisp_Int) |
#define GC_INTEGERP(x) INTEGERP (x) |
1320 |
#define SYMBOLP(x) (XTYPE ((x)) == Lisp_Symbol) |
#define SYMBOLP(x) (XTYPE ((x)) == Lisp_Symbol) |
1321 |
#define GC_SYMBOLP(x) (XGCTYPE ((x)) == Lisp_Symbol) |
#define GC_SYMBOLP(x) (XGCTYPE ((x)) == Lisp_Symbol) |
1322 |
#define MISCP(x) (XTYPE ((x)) == Lisp_Misc) |
#define MISCP(x) (XTYPE ((x)) == Lisp_Misc) |
1387 |
|
|
1388 |
#define SUB_CHAR_TABLE_P(x) (CHAR_TABLE_P (x) && NILP (XCHAR_TABLE (x)->top)) |
#define SUB_CHAR_TABLE_P(x) (CHAR_TABLE_P (x) && NILP (XCHAR_TABLE (x)->top)) |
1389 |
|
|
1390 |
#define EQ(x, y) (XFASTINT (x) == XFASTINT (y)) |
#define GC_EQ(x, y) EQ (x, y) |
|
#define GC_EQ(x, y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y)) |
|
1391 |
|
|
1392 |
#define CHECK_LIST(x) \ |
#define CHECK_LIST(x) \ |
1393 |
do { if (!CONSP ((x)) && !NILP (x)) x = wrong_type_argument (Qlistp, (x)); } while (0) |
do { if (!CONSP ((x)) && !NILP (x)) x = wrong_type_argument (Qlistp, (x)); } while (0) |