/[emacs]/emacs/src/lisp.h
ViewVC logotype

Diff of /emacs/src/lisp.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.467 by miles, Mon Sep 1 15:45:56 2003 UTC revision 1.468 by monnier, Thu Sep 11 23:52:17 2003 UTC
# Line 163  enum Lisp_Misc_Type Line 163  enum Lisp_Misc_Type
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
# Line 183  union Lisp_Object Line 182  union Lisp_Object
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;
# Line 212  union Lisp_Object Line 208  union 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;
# Line 269  LISP_MAKE_RVALUE (Lisp_Object o) Line 262  LISP_MAKE_RVALUE (Lisp_Object o)
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.  */
# Line 323  enum pvec_type Line 316  enum pvec_type
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
# Line 373  enum pvec_type Line 366  enum pvec_type
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
# Line 432  extern Lisp_Object make_number (); Line 406  extern Lisp_Object make_number ();
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    

Legend:
Removed from v.1.467  
changed lines
  Added in v.1.468

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26