зеркало из https://github.com/github/ruby.git
Narrowed down the condition to pack RValue
Because of `double` in `RFloat`, `RValue` would be packed by `sizeof(double)` by default, on platforms where `double` is wider than `VALUE`. Size of `RValue` is multiple of 5 now.
This commit is contained in:
Родитель
e1f475e13f
Коммит
ae0a179c4b
8
gc.c
8
gc.c
|
@ -552,8 +552,8 @@ struct RMoved {
|
|||
|
||||
#define RMOVED(obj) ((struct RMoved *)(obj))
|
||||
|
||||
#if defined(_MSC_VER) || defined(__CYGWIN__)
|
||||
#pragma pack(push, 1) /* magic for reducing sizeof(RVALUE): 24 -> 20 */
|
||||
#if (SIZEOF_DOUBLE > SIZEOF_VALUE) && (defined(_MSC_VER) || defined(__CYGWIN__))
|
||||
#pragma pack(push, 4) /* == SIZEOF_VALUE: magic for reducing sizeof(RVALUE): 24 -> 20 */
|
||||
#endif
|
||||
|
||||
typedef struct RVALUE {
|
||||
|
@ -604,10 +604,12 @@ typedef struct RVALUE {
|
|||
#endif
|
||||
} RVALUE;
|
||||
|
||||
#if defined(_MSC_VER) || defined(__CYGWIN__)
|
||||
#if (SIZEOF_DOUBLE > SIZEOF_VALUE) && (defined(_MSC_VER) || defined(__CYGWIN__))
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
STATIC_ASSERT(sizeof_rvalue, sizeof(RVALUE) == 5*SIZEOF_VALUE);
|
||||
|
||||
typedef uintptr_t bits_t;
|
||||
enum {
|
||||
BITS_SIZE = sizeof(bits_t),
|
||||
|
|
Загрузка…
Ссылка в новой задаче