diff options
Diffstat (limited to 'src/lisp.h')
-rw-r--r-- | src/lisp.h | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/lisp.h b/src/lisp.h index 43b3ec618f0..bf9db591bd5 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -228,14 +228,12 @@ extern bool suppress_checking EXTERNALLY_VISIBLE; USE_LSB_TAG not only requires the least 3 bits of pointers returned by malloc to be 0 but also needs to be able to impose a mult-of-8 alignment - on the few static Lisp_Objects used: lispsym, all the defsubr, and - the two special buffers buffer_defaults and buffer_local_symbols. */ + on the few static Lisp_Objects used, all of which are aligned via + the GCALIGN macro defined below. */ enum Lisp_Bits { - /* 2**GCTYPEBITS. This must be a macro that expands to a literal - integer constant, for MSVC. */ -#define GCALIGNMENT 8 + GCALIGNMENT = 1 << GCTYPEBITS, /* Number of bits in a Lisp_Object value, not counting the tag. */ VALBITS = EMACS_INT_WIDTH - GCTYPEBITS, @@ -247,10 +245,6 @@ enum Lisp_Bits FIXNUM_BITS = VALBITS + 1 }; -#if GCALIGNMENT != 1 << GCTYPEBITS -# error "GCALIGNMENT and GCTYPEBITS are inconsistent" -#endif - /* The maximum value that can be stored in a EMACS_INT, assuming all bits other than the type bits contribute to a nonnegative signed value. This can be used in #if, e.g., '#if USE_LSB_TAG' below expands to an @@ -277,18 +271,15 @@ DEFINE_GDB_SYMBOL_END (VALMASK) error !; #endif +/* Declare an object to have an address that is a multiple of + GCALIGNMENT. alignas is not suitable here, as it fails if the + object's natural alignment exceeds GCALIGNMENT. */ #ifdef HAVE_STRUCT_ATTRIBUTE_ALIGNED # define GCALIGNED __attribute__ ((aligned (GCALIGNMENT))) #else # define GCALIGNED /* empty */ #endif -/* A common multiple of the positive integers A and B. Ideally this - would be the least common multiple, but there's no way to do that - as a constant expression in C, so do the best that we can easily do. */ -#define COMMON_MULTIPLE(a, b) \ - ((a) % (b) == 0 ? (a) : (b) % (a) == 0 ? (b) : (a) * (b)) - /* Some operations are so commonly executed that they are implemented as macros, not functions, because otherwise runtime performance would suffer too much when compiling with GCC without optimization. @@ -2946,7 +2937,7 @@ CHECK_NUMBER_CDR (Lisp_Object x) #ifdef _MSC_VER #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ - static struct Lisp_Subr alignas (GCALIGNMENT) sname = \ + static struct Lisp_Subr GCALIGNED sname = \ { { (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) \ | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)) }, \ { (Lisp_Object (__cdecl *)(void))fnname }, \ @@ -2954,7 +2945,7 @@ CHECK_NUMBER_CDR (Lisp_Object x) Lisp_Object fnname #else /* not _MSC_VER */ #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ - static struct Lisp_Subr alignas (GCALIGNMENT) sname = \ + static struct Lisp_Subr GCALIGNED sname = \ { { PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \ { .a ## maxargs = fnname }, \ minargs, maxargs, lname, intspec, 0}; \ |