emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/lisp.h


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/lisp.h
Date: Mon, 17 Nov 2003 18:29:33 -0500

Index: emacs/src/lisp.h
diff -c emacs/src/lisp.h:1.471 emacs/src/lisp.h:1.472
*** emacs/src/lisp.h:1.471      Wed Nov  5 11:00:38 2003
--- emacs/src/lisp.h    Mon Nov 17 18:29:30 2003
***************
*** 250,273 ****
  #define LISP_MAKE_RVALUE(o) (0+(o))
  #endif /* NO_UNION_TYPE */
  
- #ifndef VALMASK
- #define VALMASK ((((EMACS_INT) 1)<<VALBITS) - 1)
- #endif
- 
  /* Two flags that are set during GC.  On some machines, these flags
     are defined differently by the m- file.  */
  
- /* 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 */
- 
  /* In the size word of a vector, this bit means the vector has been marked.  
*/
  
  #ifndef ARRAY_MARK_FLAG
! #define ARRAY_MARK_FLAG ((MARKBIT >> 1) & ~MARKBIT)
  #endif /* no ARRAY_MARK_FLAG */
  
  /* In the size word of a struct Lisp_Vector, this bit means it's really
--- 250,262 ----
  #define LISP_MAKE_RVALUE(o) (0+(o))
  #endif /* NO_UNION_TYPE */
  
  /* Two flags that are set during GC.  On some machines, these flags
     are defined differently by the m- file.  */
  
  /* In the size word of a vector, this bit means the vector has been marked.  
*/
  
  #ifndef ARRAY_MARK_FLAG
! #define ARRAY_MARK_FLAG ((EMACS_INT) ((EMACS_UINT) 1 << (VALBITS + GCTYPEBITS 
- 1)))
  #endif /* no ARRAY_MARK_FLAG */
  
  /* In the size word of a struct Lisp_Vector, this bit means it's really
***************
*** 310,329 ****
  
  #ifdef NO_UNION_TYPE
  
  /* One need to override this if there must be high bits set in data space
     (doing the result of the below & ((1 << (GCTYPE + 1)) - 1) would work
      on all machines, but would penalize machines which don't need it)
   */
- #ifndef XTYPE
  #define XTYPE(a) ((enum Lisp_Type) (((EMACS_UINT) (a)) >> VALBITS))
- #endif
  
  /* For integers known to be positive, XFASTINT provides fast retrieval
     and XSETFASTINT provides fast storage.  This takes advantage of the
!    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.  */
  #define XFASTINT(a) ((a) + 0)
  #define XSETFASTINT(a, b) ((a) = (b))
  
--- 299,315 ----
  
  #ifdef NO_UNION_TYPE
  
+ #define VALMASK ((((EMACS_INT) 1) << VALBITS) - 1)
+ 
  /* One need to override this if there must be high bits set in data space
     (doing the result of the below & ((1 << (GCTYPE + 1)) - 1) would work
      on all machines, but would penalize machines which don't need it)
   */
  #define XTYPE(a) ((enum Lisp_Type) (((EMACS_UINT) (a)) >> VALBITS))
  
  /* For integers known to be positive, XFASTINT provides fast retrieval
     and XSETFASTINT provides fast storage.  This takes advantage of the
!    fact that Lisp_Int is 0.  */
  #define XFASTINT(a) ((a) + 0)
  #define XSETFASTINT(a, b) ((a) = (b))
  
***************
*** 351,362 ****
  #define make_number(N)                \
    ((((EMACS_INT) (N)) & VALMASK) | ((EMACS_INT) Lisp_Int) << VALBITS)
  
! #endif /* NO_UNION_TYPE */
  
! #ifndef NO_UNION_TYPE
  
  #define XTYPE(a) ((enum Lisp_Type) (a).u.type)
- #define XSETTYPE(a, b) ((a).u.type = (char) (b))
  
  /* For integers known to be positive, XFASTINT provides fast retrieval
     and XSETFASTINT provides fast storage.  This takes advantage of the
--- 337,347 ----
  #define make_number(N)                \
    ((((EMACS_INT) (N)) & VALMASK) | ((EMACS_INT) Lisp_Int) << VALBITS)
  
! #define EQ(x, y) ((x) == (y))
  
! #else /* not NO_UNION_TYPE */
  
  #define XTYPE(a) ((enum Lisp_Type) (a).u.type)
  
  /* For integers known to be positive, XFASTINT provides fast retrieval
     and XSETFASTINT provides fast storage.  This takes advantage of the
***************
*** 384,389 ****
--- 369,376 ----
  extern Lisp_Object make_number ();
  #endif
  
+ #define EQ(x, y) ((x).s.val == (y).s.val)
+ 
  #endif /* NO_UNION_TYPE */
  
  /* During garbage collection, XGCTYPE must be used for extracting types
***************
*** 394,400 ****
  
  #ifndef XGCTYPE
  /* The distinction does not exist now that the MARKBIT has been eliminated.  
*/
! #define XGCTYPE(a) XTYPE(a)
  #endif
  
  #ifndef XPNTR
--- 381,387 ----
  
  #ifndef XGCTYPE
  /* The distinction does not exist now that the MARKBIT has been eliminated.  
*/
! #define XGCTYPE(a) XTYPE (a)
  #endif
  
  #ifndef XPNTR
***************
*** 422,427 ****
--- 409,417 ----
  
  #define MOST_NEGATIVE_FIXNUM  - ((EMACS_INT) 1 << (VALBITS - 1))
  #define MOST_POSITIVE_FIXNUM  (((EMACS_INT) 1 << (VALBITS - 1)) - 1)
+ /* Mask indicating the significant bits of a Lisp_Int.
+    I.e. (x & INTMASK) == XUINT (make_number (x)).  */
+ #define INTMASK ((((EMACS_INT) 1) << VALBITS) - 1)
  
  /* Value is non-zero if C integer I doesn't fit into a Lisp fixnum.  */
  
***************
*** 989,1003 ****
  
  /* These structures are used for various misc types.  */
  
- /* 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;
-   };
- 
  struct Lisp_Marker
  {
    int type : 16;              /* = Lisp_Misc_Marker */
--- 979,984 ----
***************
*** 1162,1167 ****
--- 1143,1157 ----
    };
  
  
+ /* 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;
+   };
+ 
  /* To get the type field of a union Lisp_Misc, use XMISCTYPE.
     It uses one of these struct subtypes to get the type field.  */
  
***************
*** 1321,1327 ****
  #define GC_NATNUMP(x) (GC_INTEGERP (x) && XINT (x) >= 0)
  
  #define INTEGERP(x) (XTYPE ((x)) == Lisp_Int)
! #define GC_INTEGERP(x) (XGCTYPE ((x)) == Lisp_Int)
  #define SYMBOLP(x) (XTYPE ((x)) == Lisp_Symbol)
  #define GC_SYMBOLP(x) (XGCTYPE ((x)) == Lisp_Symbol)
  #define MISCP(x) (XTYPE ((x)) == Lisp_Misc)
--- 1311,1317 ----
  #define GC_NATNUMP(x) (GC_INTEGERP (x) && XINT (x) >= 0)
  
  #define INTEGERP(x) (XTYPE ((x)) == Lisp_Int)
! #define GC_INTEGERP(x) INTEGERP (x)
  #define SYMBOLP(x) (XTYPE ((x)) == Lisp_Symbol)
  #define GC_SYMBOLP(x) (XGCTYPE ((x)) == Lisp_Symbol)
  #define MISCP(x) (XTYPE ((x)) == Lisp_Misc)
***************
*** 1392,1399 ****
  
  #define SUB_CHAR_TABLE_P(x) (CHAR_TABLE_P (x) && NILP (XCHAR_TABLE (x)->top))
  
! #define EQ(x, y) (XFASTINT (x) == XFASTINT (y))
! #define GC_EQ(x, y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y))
  
  #define CHECK_LIST(x) \
    do { if (!CONSP ((x)) && !NILP (x)) x = wrong_type_argument (Qlistp, (x)); 
} while (0)
--- 1382,1388 ----
  
  #define SUB_CHAR_TABLE_P(x) (CHAR_TABLE_P (x) && NILP (XCHAR_TABLE (x)->top))
  
! #define GC_EQ(x, y) EQ (x, y)
  
  #define CHECK_LIST(x) \
    do { if (!CONSP ((x)) && !NILP (x)) x = wrong_type_argument (Qlistp, (x)); 
} while (0)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]