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:
Nobuyoshi Nakada 2021-01-31 12:50:29 +09:00
Родитель e1f475e13f
Коммит ae0a179c4b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 7CD2805BFA3770C6
1 изменённых файлов: 5 добавлений и 3 удалений

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),