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:
parent
e1f475e13f
commit
ae0a179c4b
8
gc.c
8
gc.c
@ -552,8 +552,8 @@ struct RMoved {
|
|||||||
|
|
||||||
#define RMOVED(obj) ((struct RMoved *)(obj))
|
#define RMOVED(obj) ((struct RMoved *)(obj))
|
||||||
|
|
||||||
#if defined(_MSC_VER) || defined(__CYGWIN__)
|
#if (SIZEOF_DOUBLE > SIZEOF_VALUE) && (defined(_MSC_VER) || defined(__CYGWIN__))
|
||||||
#pragma pack(push, 1) /* magic for reducing sizeof(RVALUE): 24 -> 20 */
|
#pragma pack(push, 4) /* == SIZEOF_VALUE: magic for reducing sizeof(RVALUE): 24 -> 20 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct RVALUE {
|
typedef struct RVALUE {
|
||||||
@ -604,10 +604,12 @@ typedef struct RVALUE {
|
|||||||
#endif
|
#endif
|
||||||
} RVALUE;
|
} RVALUE;
|
||||||
|
|
||||||
#if defined(_MSC_VER) || defined(__CYGWIN__)
|
#if (SIZEOF_DOUBLE > SIZEOF_VALUE) && (defined(_MSC_VER) || defined(__CYGWIN__))
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
STATIC_ASSERT(sizeof_rvalue, sizeof(RVALUE) == 5*SIZEOF_VALUE);
|
||||||
|
|
||||||
typedef uintptr_t bits_t;
|
typedef uintptr_t bits_t;
|
||||||
enum {
|
enum {
|
||||||
BITS_SIZE = sizeof(bits_t),
|
BITS_SIZE = sizeof(bits_t),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user