aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2009-11-03 15:30:39 +0000
committerStefan Monnier2009-11-03 15:30:39 +0000
commitb349d11143018fa0e3174d7eb01e039694dc24cb (patch)
tree58798c844d431458250e56f88409878b89b6b07a /src
parent6e39d3b2b075f7ff982aeb5800aa502994c41db6 (diff)
downloademacs-b349d11143018fa0e3174d7eb01e039694dc24cb.tar.gz
emacs-b349d11143018fa0e3174d7eb01e039694dc24cb.zip
Make USE_LSB_TAG work with USE_LISP_UNION_TYPE.
(P_): Support for prototypes is now required.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/lisp.h50
2 files changed, 34 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3c82211c553..52d3a7c93a1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12009-11-03 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * lisp.h: Make USE_LSB_TAG work with USE_LISP_UNION_TYPE.
4 (P_): Support for prototypes is now required.
5
12009-10-31 Chong Yidong <cyd@stupidchicken.com> 62009-10-31 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * frame.c (Fmake_frame_invisible, Fframe_visible_p): Doc fix 8 * frame.c (Fmake_frame_invisible, Fframe_visible_p): Doc fix
diff --git a/src/lisp.h b/src/lisp.h
index 6444aac84d3..4bf3d392811 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -22,11 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22#define EMACS_LISP_H 22#define EMACS_LISP_H
23 23
24/* Declare the prototype for a general external function. */ 24/* Declare the prototype for a general external function. */
25#if defined (PROTOTYPES) || defined (WINDOWSNT)
26#define P_(proto) proto 25#define P_(proto) proto
27#else
28#define P_(proto) ()
29#endif
30 26
31/* Use the configure flag --enable-checking[=LIST] to enable various 27/* Use the configure flag --enable-checking[=LIST] to enable various
32 types of run time checks for Lisp objects. */ 28 types of run time checks for Lisp objects. */
@@ -139,10 +135,7 @@ extern void die P_((const char *, const char *, int)) NO_RETURN;
139#if defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ || defined DARWIN_OS 135#if defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ || defined DARWIN_OS
140/* We also need to be able to specify mult-of-8 alignment on static vars. */ 136/* We also need to be able to specify mult-of-8 alignment on static vars. */
141# if defined DECL_ALIGN 137# if defined DECL_ALIGN
142/* We currently do not support USE_LSB_TAG with a union Lisp_Object. */ 138# define USE_LSB_TAG
143# ifndef USE_LISP_UNION_TYPE
144# define USE_LSB_TAG
145# endif
146# endif 139# endif
147#endif 140#endif
148 141
@@ -367,12 +360,6 @@ enum pvec_type
367 (var) = ((EMACS_INT) (type)) | ((EMACS_INT) (ptr))) 360 (var) = ((EMACS_INT) (type)) | ((EMACS_INT) (ptr)))
368#define make_number(N) (((EMACS_INT) (N)) << GCTYPEBITS) 361#define make_number(N) (((EMACS_INT) (N)) << GCTYPEBITS)
369 362
370/* XFASTINT and XSETFASTINT are for use when the integer is known to be
371 positive, in which case the implementation can sometimes be faster
372 depending on the tagging scheme. With USE_LSB_TAG, there's no benefit. */
373#define XFASTINT(a) XINT (a)
374#define XSETFASTINT(a, b) ((a) = make_number (b))
375
376#define XPNTR(a) ((EMACS_INT) ((a) & ~TYPEMASK)) 363#define XPNTR(a) ((EMACS_INT) ((a) & ~TYPEMASK))
377 364
378#else /* not USE_LSB_TAG */ 365#else /* not USE_LSB_TAG */
@@ -423,12 +410,6 @@ enum pvec_type
423 410
424#define XTYPE(a) ((enum Lisp_Type) (a).u.type) 411#define XTYPE(a) ((enum Lisp_Type) (a).u.type)
425 412
426/* For integers known to be positive, XFASTINT provides fast retrieval
427 and XSETFASTINT provides fast storage. This takes advantage of the
428 fact that Lisp_Int is 0. */
429#define XFASTINT(a) ((a).i + 0)
430#define XSETFASTINT(a, b) ((a).i = (b))
431
432#ifdef EXPLICIT_SIGN_EXTEND 413#ifdef EXPLICIT_SIGN_EXTEND
433/* Make sure we sign-extend; compilers have been known to fail to do so. */ 414/* Make sure we sign-extend; compilers have been known to fail to do so. */
434#define XINT(a) (((a).s.val << (BITS_PER_EMACS_INT - VALBITS)) \ 415#define XINT(a) (((a).s.val << (BITS_PER_EMACS_INT - VALBITS)) \
@@ -439,9 +420,28 @@ enum pvec_type
439 420
440#define XUINT(a) ((a).u.val) 421#define XUINT(a) ((a).u.val)
441 422
442#define XSET(var, vartype, ptr) \ 423#ifdef USE_LSB_TAG
424
425# define XSET(var, vartype, ptr) \
426 (eassert ((((EMACS_UINT) (ptr)) & ((1 << GCTYPEBITS) - 1)) == 0), \
427 (var).u.val = ((EMACS_UINT) (ptr)) >> GCTYPEBITS, \
428 (var).u.type = ((char) (vartype)))
429
430# define XPNTR(v) (((v).s.val) << GCTYPEBITS)
431
432#else /* !USE_LSB_TAG */
433
434/* For integers known to be positive, XFASTINT provides fast retrieval
435 and XSETFASTINT provides fast storage. This takes advantage of the
436 fact that Lisp_Int is 0. */
437# define XFASTINT(a) ((a).i + 0)
438# define XSETFASTINT(a, b) ((a).i = (b))
439
440# define XSET(var, vartype, ptr) \
443 (((var).s.val = ((EMACS_INT) (ptr))), ((var).s.type = ((char) (vartype)))) 441 (((var).s.val = ((EMACS_INT) (ptr))), ((var).s.type = ((char) (vartype))))
444 442
443#endif /* !USE_LSB_TAG */
444
445#if __GNUC__ >= 2 && defined (__OPTIMIZE__) 445#if __GNUC__ >= 2 && defined (__OPTIMIZE__)
446#define make_number(N) \ 446#define make_number(N) \
447 (__extension__ ({ Lisp_Object _l; _l.s.val = (N); _l.s.type = Lisp_Int; _l; })) 447 (__extension__ ({ Lisp_Object _l; _l.s.val = (N); _l.s.type = Lisp_Int; _l; }))
@@ -451,6 +451,14 @@ extern Lisp_Object make_number P_ ((EMACS_INT));
451 451
452#endif /* USE_LISP_UNION_TYPE */ 452#endif /* USE_LISP_UNION_TYPE */
453 453
454/* For integers known to be positive, XFASTINT sometimes provides
455 faster retrieval and XSETFASTINT provides faster storage.
456 If not, fallback on the non-accelerated path. */
457#ifndef XFASTINT
458# define XFASTINT(a) (XINT (a))
459# define XSETFASTINT(a, b) (XSETINT (a, b))
460#endif
461
454#define EQ(x, y) (XHASH (x) == XHASH (y)) 462#define EQ(x, y) (XHASH (x) == XHASH (y))
455 463
456#ifndef XPNTR 464#ifndef XPNTR