diff options
| author | Andreas Schwab | 2012-04-15 18:20:54 +0200 |
|---|---|---|
| committer | Andreas Schwab | 2012-04-15 18:20:54 +0200 |
| commit | d55c12ed1f80711ef27a52fa0ba6e366f0b7a585 (patch) | |
| tree | c8aec040114e98aeb95b6c035bae942a7de8be90 /src/lisp.h | |
| parent | 7a76850c2022cf9e8ccadc972d76463f1055a7fe (diff) | |
| download | emacs-d55c12ed1f80711ef27a52fa0ba6e366f0b7a585.tar.gz emacs-d55c12ed1f80711ef27a52fa0ba6e366f0b7a585.zip | |
Simplify enforcement of object address alignment
* lisp.h (struct Lisp_Symbol): Remove explicit padding.
(struct Lisp_Misc_Any): Likewise.
(struct Lisp_Free): Likewise.
* alloc.c (union aligned_Lisp_Symbol): Define.
(SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
aligned_Lisp_Symbol instead of struct Lisp_Symbol.
(union aligned_Lisp_Misc): Define.
(MARKER_BLOCK_SIZE, struct marker_block): Use union
aligned_Lisp_Misc instead of union Lisp_Misc.
(Fmake_symbol, allocate_misc, gc_sweep): Adjust
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/lisp.h b/src/lisp.h index 81d17f4b922..d1e2cc8715d 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -1134,8 +1134,6 @@ struct Lisp_Symbol | |||
| 1134 | special (with `defvar' etc), and shouldn't be lexically bound. */ | 1134 | special (with `defvar' etc), and shouldn't be lexically bound. */ |
| 1135 | unsigned declared_special : 1; | 1135 | unsigned declared_special : 1; |
| 1136 | 1136 | ||
| 1137 | unsigned spacer : 23; | ||
| 1138 | |||
| 1139 | /* The symbol's name, as a Lisp string. | 1137 | /* The symbol's name, as a Lisp string. |
| 1140 | The name "xname" is used to intentionally break code referring to | 1138 | The name "xname" is used to intentionally break code referring to |
| 1141 | the old field "name" of type pointer to struct Lisp_String. */ | 1139 | the old field "name" of type pointer to struct Lisp_String. */ |
| @@ -1337,8 +1335,6 @@ struct Lisp_Misc_Any /* Supertype of all Misc types. */ | |||
| 1337 | ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_??? */ | 1335 | ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_??? */ |
| 1338 | unsigned gcmarkbit : 1; | 1336 | unsigned gcmarkbit : 1; |
| 1339 | int spacer : 15; | 1337 | int spacer : 15; |
| 1340 | /* Make it as long as "Lisp_Free without padding". */ | ||
| 1341 | void *fill; | ||
| 1342 | }; | 1338 | }; |
| 1343 | 1339 | ||
| 1344 | struct Lisp_Marker | 1340 | struct Lisp_Marker |
| @@ -1530,13 +1526,6 @@ struct Lisp_Free | |||
| 1530 | unsigned gcmarkbit : 1; | 1526 | unsigned gcmarkbit : 1; |
| 1531 | int spacer : 15; | 1527 | int spacer : 15; |
| 1532 | union Lisp_Misc *chain; | 1528 | union Lisp_Misc *chain; |
| 1533 | #ifdef USE_LSB_TAG | ||
| 1534 | /* Try to make sure that sizeof(Lisp_Misc) preserves TYPEBITS-alignment. | ||
| 1535 | This assumes that Lisp_Marker is the largest of the alternatives and | ||
| 1536 | that Lisp_Misc_Any has the same size as "Lisp_Free w/o padding". */ | ||
| 1537 | char padding[((((sizeof (struct Lisp_Marker) - 1) >> GCTYPEBITS) + 1) | ||
| 1538 | << GCTYPEBITS) - sizeof (struct Lisp_Misc_Any)]; | ||
| 1539 | #endif | ||
| 1540 | }; | 1529 | }; |
| 1541 | 1530 | ||
| 1542 | /* To get the type field of a union Lisp_Misc, use XMISCTYPE. | 1531 | /* To get the type field of a union Lisp_Misc, use XMISCTYPE. |
| @@ -1545,19 +1534,19 @@ struct Lisp_Free | |||
| 1545 | union Lisp_Misc | 1534 | union Lisp_Misc |
| 1546 | { | 1535 | { |
| 1547 | struct Lisp_Misc_Any u_any; /* Supertype of all Misc types. */ | 1536 | struct Lisp_Misc_Any u_any; /* Supertype of all Misc types. */ |
| 1548 | struct Lisp_Free u_free; /* Includes padding to force alignment. */ | 1537 | struct Lisp_Free u_free; |
| 1549 | struct Lisp_Marker u_marker; /* 5 */ | 1538 | struct Lisp_Marker u_marker; |
| 1550 | struct Lisp_Overlay u_overlay; /* 5 */ | 1539 | struct Lisp_Overlay u_overlay; |
| 1551 | struct Lisp_Save_Value u_save_value; /* 3 */ | 1540 | struct Lisp_Save_Value u_save_value; |
| 1552 | }; | 1541 | }; |
| 1553 | 1542 | ||
| 1554 | union Lisp_Fwd | 1543 | union Lisp_Fwd |
| 1555 | { | 1544 | { |
| 1556 | struct Lisp_Intfwd u_intfwd; /* 2 */ | 1545 | struct Lisp_Intfwd u_intfwd; |
| 1557 | struct Lisp_Boolfwd u_boolfwd; /* 2 */ | 1546 | struct Lisp_Boolfwd u_boolfwd; |
| 1558 | struct Lisp_Objfwd u_objfwd; /* 2 */ | 1547 | struct Lisp_Objfwd u_objfwd; |
| 1559 | struct Lisp_Buffer_Objfwd u_buffer_objfwd; /* 2 */ | 1548 | struct Lisp_Buffer_Objfwd u_buffer_objfwd; |
| 1560 | struct Lisp_Kboard_Objfwd u_kboard_objfwd; /* 2 */ | 1549 | struct Lisp_Kboard_Objfwd u_kboard_objfwd; |
| 1561 | }; | 1550 | }; |
| 1562 | 1551 | ||
| 1563 | /* Lisp floating point type */ | 1552 | /* Lisp floating point type */ |