aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2004-05-13 17:12:21 +0000
committerStefan Monnier2004-05-13 17:12:21 +0000
commitf6c741f9422833bed2fae805185754ec38b1030d (patch)
treecb6f4af9f2c52866dee8cec06af301be9bb1310c /src
parent46554de4a0616bc5f7ab4d820a218352995f1de1 (diff)
downloademacs-f6c741f9422833bed2fae805185754ec38b1030d.tar.gz
emacs-f6c741f9422833bed2fae805185754ec38b1030d.zip
(USE_LSB_TAG): Make it the default when it is known to work.
Diffstat (limited to 'src')
-rw-r--r--src/lisp.h39
1 files changed, 33 insertions, 6 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 9a9d48e79f3..bcd066360b3 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -284,24 +284,51 @@ enum pvec_type
284#define BOOL_VECTOR_BITS_PER_CHAR 8 284#define BOOL_VECTOR_BITS_PER_CHAR 8
285 285
286/***** Select the tagging scheme. *****/ 286/***** Select the tagging scheme. *****/
287/* There are basically two options that control the tagging scheme:
288 - NO_UNION_TYPE says that Lisp_Object should be an integer instead
289 of a union.
290 - USE_LSB_TAG means that we can assume the least 3 bits of pointers are
291 always 0, and we can thus use them to hold tag bits, without
292 restricting our addressing space.
293
294 If USE_LSB_TAG is not set, then we use the top 3 bits for tagging, thus
295 restricting our possible address range. Currently USE_LSB_TAG is not
296 allowed together with a union. This is not due to any fundamental
297 technical (or political ;-) problem: nobody wrote the code to do it yet.
298
299 USE_LSB_TAG not only requires the least 3 bits of pointers returned by
300 malloc to be 0 but also needs to be able to impose a mult-of-8 alignment
301 on the few static Lisp_Objects used: all the defsubr as well
302 as the two special buffers buffer_defaults and buffer_local_symbols. */
287 303
288/* First, try and define DECL_ALIGN(type,var) which declares a static 304/* First, try and define DECL_ALIGN(type,var) which declares a static
289 variable VAR of type TYPE with the added requirement that it be 305 variable VAR of type TYPE with the added requirement that it be
290 TYPEBITS-aligned. */ 306 TYPEBITS-aligned. */
291#if defined USE_LSB_TAG && !defined DECL_ALIGN 307#ifndef DECL_ALIGN
292/* What compiler directive should we use for non-gcc compilers? -stef */ 308/* What compiler directive should we use for non-gcc compilers? -stef */
293# if defined (__GNUC__) 309# if defined (__GNUC__)
294# define DECL_ALIGN(type, var) \ 310# define DECL_ALIGN(type, var) \
295 type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var 311 type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var
296# else
297# error "USE_LSB_TAG used without defining DECL_ALIGN"
298# endif 312# endif
299#endif 313#endif
300 314
301#ifndef USE_LSB_TAG 315/* Let's USE_LSB_TAG on systems where we know malloc returns mult-of-8. */
316#if defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ || defined MAC_OSX
317/* We also need to be able to specify mult-of-8 alignment on static vars. */
318# if defined DECL_ALIGN
319/* We currently do not support USE_LSB_TAG with a union Lisp_Object. */
320# if defined NO_UNION_TYPE
321# define USE_LSB_TAG
322# endif
323# endif
324#endif
325
302/* Just remove the alignment annotation if we don't use it. */ 326/* Just remove the alignment annotation if we don't use it. */
303#undef DECL_ALIGN 327#ifndef DECL_ALIGN
304#define DECL_ALIGN(type, var) type var 328# ifdef USE_LSB_TAG
329# error "USE_LSB_TAG used without defining DECL_ALIGN"
330# endif
331# define DECL_ALIGN(type, var) type var
305#endif 332#endif
306 333
307 334